PHPackages                             eugenejenkins/json-rpc-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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. eugenejenkins/json-rpc-server

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

eugenejenkins/json-rpc-server
=============================

A lightweight JSON-RPC server implementation in PHP.

v1.0.0(1y ago)02MITPHPPHP &gt;=8.1.

Since Oct 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/EugeneJenkins/json-rpc-server)[ Packagist](https://packagist.org/packages/eugenejenkins/json-rpc-server)[ Docs](https://github.com/EugeneJenkins/json-rpc-server)[ RSS](/packages/eugenejenkins-json-rpc-server/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

PHP JSON-RPC Server
===================

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

This project is a JSON-RPC server implemented in PHP 8.1. It adheres to the [JSON-RPC 2.0 specification (RFC 7049)](https://www.jsonrpc.org/specification). The server is built in a canonical way, following best practices for handling JSON-RPC requests.

Features
--------

[](#features)

- Complies with the JSON-RPC 2.0 standard.
- Supports method registration and execution.
- Structured exception handling for request processing.

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

[](#requirements)

- PHP 8.1 or higher
- Composer

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

[](#installation)

1. Clone the repository:

    ```
    git clone git@github.com:EugeneJenkins/json-rpc-server.git
    cd json-rpc-server
    ```
2. Install dependencies::

    ```
    composer install
    ```

Example Usage
-------------

[](#example-usage)

```
$server = new Server;

$server->register('subtract', fn($minuend, $subtrahend) => $minuend - $subtrahend);
$server->register('add', fn($a, $b) => $a + $b);

$server->registerClass(Calculator::class);

$response = $server->execute();
$response->show();
```

To run the server locally, you can use the built-in PHP server:

```
php -S localhost:8008 index.php
```

How to Make Requests
--------------------

[](#how-to-make-requests)

You can send JSON-RPC requests to the server using any HTTP client (e.g., curl, Postman, etc.).

Example request:

```
curl -X POST http://localhost:8008 \
    -H "Content-Type: application/json" \
    -d '{
        "jsonrpc": "2.0",
        "method": "subtract",
        "params": {"minuend": 10, "subtrahend": 3},
        "id": 1
    }'
```

Example response:

```
{
    "jsonrpc": "2.0",
    "result": {
        "minuend": 10,
        "subtrahend": 3
    },
    "id": 1
}
```

Error Handling
--------------

[](#error-handling)

If an error occurs during the execution of a request, the server will respond with a JSON-RPC error object, as specified in the JSON-RPC 2.0 specification.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

580d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6859ea9ab6a2ba424c7aef1ae41977044128aeb50922da7b3116963e3e83c2ff?d=identicon)[EugeneJenkins](/maintainers/EugeneJenkins)

---

Top Contributors

[![EugeneJenkins](https://avatars.githubusercontent.com/u/48534955?v=4)](https://github.com/EugeneJenkins "EugeneJenkins (10 commits)")

---

Tags

phprpcserverjson-rpc

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/eugenejenkins-json-rpc-server/health.svg)

```
[![Health](https://phpackages.com/badges/eugenejenkins-json-rpc-server/health.svg)](https://phpackages.com/packages/eugenejenkins-json-rpc-server)
```

###  Alternatives

[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[php-mcp/server

PHP SDK for building Model Context Protocol (MCP) servers - Create MCP tools, resources, and prompts

828280.5k25](/packages/php-mcp-server)[datto/json-rpc-http

HTTP client and server for JSON-RPC 2.0

66525.9k5](/packages/datto-json-rpc-http)[thiagof/laravelrpc

JsonRPC Client/Server services for Laravel 5

337.5k](/packages/thiagof-laravelrpc)[renoki-co/laravel-healthchecks

Laravel Healthchecks is a simple controller class that helps you build your own healthchecks endpoint without issues.

5654.9k](/packages/renoki-co-laravel-healthchecks)[appserver-io/webserver

Multithreaded webserver for php written in php

455.7k1](/packages/appserver-io-webserver)

PHPackages © 2026

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