mcp-cpp
MCP Servermcp-cpppublic

json rpc

JSON-RPC 2.0 C++ library

Repository Info

1
Stars
0
Forks
1
Watchers
0
Issues
C++
Language
MIT License
License

About This Server

JSON-RPC 2.0 C++ library

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

json_rpc

中文

Pure and lightweight Modern C++ JSON-RPC 2.0 library

Component

Jsonrpc implements JSON-RPC 2.0 all objects:

  • Request
    • Notification
    • Parameter
  • Response
    • Error
  • Batch

Jsonrpc is based on JSON for Modern C++.

Code example

#include "json_rpc/json_rpc.h"

  std::string json_str = R"({
        "jsonrpc": "2.0",
        "method": "subtract",
        "params": [42, 23],
        "id": 1
    })";
    
   Request request;
   if (const auto status = request.ParseJson(json_str); !status.Ok()) {
     // invalid request
     LOG(ERROR) << "invalid request: " << status.Message();
     return;
   }
   if (request.IsNotification()) {
     // no response needs to be returned
     return; 
   }
   if (request.IsInternalMethod()) {
     // deal with internal method
     return;
   }
   Response response(request.Id());
   if (request.Method() == "subtract") {
       int a = request.Params().Array()[0].get<int>();
       int b = request.Params().Array()[1].get<int>();
       response.SetResult(a - b);
   }

More code example

Quick Start

1

Clone the repository

git clone https://github.com/mcp-cpp/json-rpc
2

Install dependencies

cd json-rpc
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownermcp-cpp
Repojson-rpc
LanguageC++
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation