This repository provides a C++ SDK for the Model Context Protocol (MCP), enabling the creation of MCP servers and clients with features like JSON-RPC, multiple transport options, and comprehensive error handling.
A C++ SDK for the Model Context Protocol (MCP), providing a framework for building MCP servers and clients using modern C++17 practices.
The library utilizes CMake for building:
# Configure the build
cmake -B build
# Build the library
cmake --build build
# Run tests
cd build && ctest
A simple echo server and client example demonstrates basic library usage.
To run the echo server:
./build/examples/simple_server/echo_server
To run the echo client:
./build/examples/simple_client/echo_client
The client sends a request and notification on startup, then echoes user-entered messages from the server.
The project is under active development, with core types, JSON serialization, error handling, transport interface, STDIO transport, and logging utilities already implemented. Upcoming features include session management, HTTP/SSE transport, and server/client implementations.
See the LICENSE file for details.
Neumann-Labs/mcp-cpp
March 4, 2025
March 25, 2025
C++