Get the FREE Ultimate OpenClaw Setup Guide →

MCPServer.cpp

A high-performance C++ implementation of the Model Communication Protocol server,which supports python plugins.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio caomengxuan666-mcpserver.cpp ./bin/mcp-server++

How to use

MCPServer.cpp is a high-performance C++20 implementation of the Model Communication Protocol server. It exposes a JSON-RPC 2.0 interface over HTTP with optional Server-Sent Events (SSE) streaming, allowing clients to execute built-in tools, manage plugins, and interact with resources provided by the server. Practical workflows include sending JSON-RPC requests to run built-in tools (such as file operations or HTTP requests) or to invoke plugin-provided functionality. The server is designed for high throughput and asynchronous I/O using ASIO, and it supports a pluggable system so you can extend its capabilities without touching core logic. To start, run the compiled binary (for example, the provided mcp-server++) and connect to its HTTP endpoint to begin sending RPC calls or subscribe to SSE streams for real-time updates.

How to install

Prerequisites:

  • A modern C++20 compatible compiler (GCC 10+, Clang 12+, MSVC with C++20 support)
  • CMake 3.23 or newer
  • Git

Step-by-step installation from source:

  1. Clone the repository: git clone https://github.com/caomengxuan666/MCPServer.cpp.git cd MCPServer.cpp

  2. Create a build directory and configure with CMake: mkdir build cd build cmake ..

  3. Build the project: cmake --build . --config Release

    or on Linux/macOS:

    make -j$(nproc)

  4. Run the server: ./bin/mcp-server++

  5. Optional: adjust build options via CMake, e.g. enable tests or adjust optimizations, using cmake -D<OPTION>=<VALUE> .. before building.

Additional notes

Tips and common considerations:

  • HTTPS is disabled by default. To enable HTTPS, configure enable_https=1 in your config.ini and provide valid SSL certificate paths as per the documentation.
  • The server supports a plugin system. You can drop dynamic libraries into the plugin path and enable them via configuration to extend built-in tools, HTTP client capabilities, and system commands.
  • Built-in tools include file operations, HTTP requests, and system commands. You can invoke these via JSON-RPC 2.0 requests.
  • For development, you can build in Debug mode to get more verbose logging and easier debugging. Use CMake options to toggle BUILD_TESTS or set CMAKE_BUILD_TYPE=Debug.
  • If you plan to deploy with SSE, ensure your client handles streaming responses and that your transport layer is configured for HTTP/1.1 as documented.
  • Review the authentication documentation (AUTH.md) to secure access to the server when exposed publicly.

Related MCP Servers

Sponsor this space

Reach thousands of developers