PHPackages                             inurosen/jsonrpc-server - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. inurosen/jsonrpc-server

ActiveLibrary[API Development](/categories/api)

inurosen/jsonrpc-server
=======================

JSON-RPC 2.0 Server Library for PHP

1.3.2(5y ago)14.7k↓86.2%GPL-3.0-or-laterPHPPHP &gt;=7.1CI failing

Since Feb 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Inurosen/jsonrpc-server)[ Packagist](https://packagist.org/packages/inurosen/jsonrpc-server)[ RSS](/packages/inurosen-jsonrpc-server/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (1)Versions (16)Used By (0)

JSON-RPC 2.0 Server for PHP
===========================

[](#json-rpc-20-server-for-php)

Requirements
------------

[](#requirements)

- PHP 7.1+

Installation
------------

[](#installation)

```
composer require inurosen/jsonrpc-server

```

Usage
-----

[](#usage)

### 1. Configure

[](#1-configure)

#### OOP style

[](#oop-style)

```
class FooService {
    public function bar($params) {
        return $params;
    }
}

MethodRegistry::register('hello.world', 'FooService@bar', HelloWorldValidator::class);
```

#### Closure style

[](#closure-style)

```
MethodRegistry::register('hello.world', function ($params) {
    return 'Hello world!';
}, HelloWorldValidator::class);
```

### 2. Execute

[](#2-execute)

```
$jsonRpcServer = new \Inurosen\JsonRPCServer\JsonRPCService();

$jsonRpcServer->call('{"jsonrpc": "2.0", "method": "hello.world", "params": {"param1": 1, "param2": 2}, "id": 1}');
$result = $jsonRpcServer->getResponse()->toString();

echo $result;
```

Result will be a JSON-RPC result.

### 3. Validate

[](#3-validate)

Validators must implement `Inurosen\JsonRPCServer\Interfaces\ValidatorInterface`. Extending `Inurosen\JsonRPCServer\Validator` and assigning rules is enough.

```
public function rules(): array
{
    return [
        'id' => [
            \Inurosen\JsonRPCServer\Rules\RequiredRule::class,
            \Inurosen\JsonRPCServer\Rules\IntegerRule::class,
        ],
    ];
}
```

Or if your params is not object but a scalar or simple value

```
public function rules(): array
{
    return [
        \Inurosen\JsonRPCServer\Rules\RequiredRule::class,
        \Inurosen\JsonRPCServer\Rules\IntegerRule::class,
    ];
}
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~50 days

Total

14

Last Release

2033d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.0

1.0.1PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1375364?v=4)[Renat Khaertdinov](/maintainers/Inurosen)[@Inurosen](https://github.com/Inurosen)

---

Top Contributors

[![Inurosen](https://avatars.githubusercontent.com/u/1375364?v=4)](https://github.com/Inurosen "Inurosen (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/inurosen-jsonrpc-server/health.svg)

```
[![Health](https://phpackages.com/badges/inurosen-jsonrpc-server/health.svg)](https://phpackages.com/packages/inurosen-jsonrpc-server)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
