itcv-GmbH /
cpp-mcp-sdk
The first fully MCP 2025-11-25 compliant C++ SDK - Build production-ready MCP servers and clients with complete protocol support including Streamable HTTP transport and OAuth-based authorization.
61/100 healthLoading repository data…
GopherSecurity / repository
C++ MCP SDK - build Model Context Protocol (MCP) servers and clients in C++ / CPP. Enterprise-grade security, observability, connectivity. Stdio, HTTP+SSE, Streamable HTTP, WebSocket, TCP transports. Bindings for Python, TypeScript, Go, Rust, Java, C#.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
The most comprehensive C++ implementation of the Model Context Protocol (MCP) for building AI-powered applications. Production-ready SDK with enterprise features including multi-transport support, connection pooling, and multi-language bindings via C API (Python, TypeScript, Go, Rust, Java, C#, Ruby and more).
⭐ Please give a star if you find this useful!
┌─────────────────────────────────────────────────────────────────────┐
│ Application Layer │
│ ┌────────────────────────────────────────────────────────────────┐ │
│ │ MCP Server │ MCP Client │ Custom Applications │ │
│ └────────────────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────────────┤
│ Cross-Language Binding Layer │
│ ┌────────────────────────────────────────────────────────────────┐ │
│ │ Python │ TypeScript │ Go │ Rust │ Java │ C# │ Ruby │ Swift │ │
│ └────────────────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────────────┤
│ C API (FFI Layer) │
│ ┌────────────────────────────────────────────────────────────────┐ │
│ │ libgopher_mcp_c: Opaque Handles │ RAII Guards │ Type Safety │ │
│ └────────────────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────────────┤
│ Protocol Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌────────────┐ │
│ │ JSON-RPC │ │ Requests │ │ Responses │ │ Notify │ │
│ │ Codec │ │ Dispatch │ │ Routing │ │ Stream │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ └────────────┘ │
├─────────────────────────────────────────────────────────────────────┤
│ Filter Chain Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌────────────┐ │
│ │ HTTP / SSE │ │ Routing │ │ Rate Limiter │ │ Auth │ │
│ │ Codecs │ │ & CORS │ │ Circuit Brk │ │ Metrics │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ └────────────┘ │
├─────────────────────────────────────────────────────────────────────┤
│ Transport Layer │
│ ┌────────────────────────────────────────────────────────────────┐ │
│ │ Stdio │ HTTP(S)+SSE │ Streamable HTTP │ WebSocket │ TCP │ │
│ └────────────────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────────────┤
│ Network Layer │
│ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │
│ │ Connection │ │ Listener │ │ Socket │ │
│ │ Management │ │ & Accept │ │ Interface │ │
│ └────────────────┘ └────────────────┘ └────────────────┘ │
├─────────────────────────────────────────────────────────────────────┤
│ Event Loop & Dispatcher │
│ ┌────────────────────────────────────────────────────────────────┐ │
│ │ Libevent │ Timer Management │ I/O Events │ Buffer │ Result │ │
│ └────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
Selected from shared topics, language and repository description—not editorial ratings.
itcv-GmbH /
The first fully MCP 2025-11-25 compliant C++ SDK - Build production-ready MCP servers and clients with complete protocol support including Streamable HTTP transport and OAuth-based authorization.
61/100 healthjesspig /
C++17 implementation of the Model Context Protocol (MCP), providing both client and server libraries for building MCP-based AI tooling integrations.
71/100 healthUse MCP C++ SDK from any programming language via the stable C API (libgopher_mcp_c):
| Language | Binding Type | Features |
|---|---|---|
| Python | ctypes/cffi | Async support, type hints |
| TypeScript/Node.js | N-API | High performance, native async |
| Go | CGO | Goroutine-safe wrappers |
| Rust | FFI | Safe wrappers, ownership guarantees |
| Java | JNI | Automatic resource management |
| C#/.NET | P/Invoke | Async/await support |
| Ruby | Native extension | GC integration |
# Installation paths
Headers: /usr/local/include/gopher-mcp/mcp/c_api/
Library: /usr/local/lib/libgopher_mcp_c.{so,dylib,dll}
Model Context Protocol (MCP) is an open protocol that enables AI models (like Claude, GPT, etc.) to securely interact with external tools, data sources, and services. MCP provides a standardized way for:
This MCP C++ SDK implements the official MCP specification in high-performance C++, suitable for:
| Category | Features |
|---|---|
| Protocol | Full MCP 2025-06-18 and 2025-11-25 specifications, 2026-07-28 (in progress), JSON-RPC 2.0, resources, tools, prompts |
| Transports | stdio, HTTP+SSE, HTTPS+SSE, WebSocket, TCP |
| Performance | Zero-copy buffers, lock-free operations, connection pooling |
| Reliability | Circuit breaker, rate limiting, retry with backoff, graceful shutdown |
| Security | TLS/SSL, authentication middleware, request validation |
| Observability | Structured logging, metrics, health endpoints |
| Cross-Language | C API for Python, Node.js, Go, Rust, Java, C#, Ruby bindings |
# Show all available commands
make help
# Build
make
# Install (auto-prompts for sudo if needed)
make install
# Run tests
make test
#include "mcp/server/mcp_server.h"
int main() {
mcp::server::McpServerConfig config;
config.server_name = "my-mcp-server";
auto server = mcp::server::createMcpServer(config);
// Register a tool
mcp::Tool calculator;
calculator.name = "add";
calculator.description = "Add two numbers";
server->registerTool(calculator, [](const std::string& name,
const mcp::optional<mcp::Metadata>& arguments,
mcp::server::SessionContext& ctx) {
mcp::CallToolResult result;
auto args = arguments.value();
auto a_it = args.find("a");
auto b_it = args.find("b");
double a = mcp::holds_alternative<double>(a_it->second)
? mcp::get<double>(a_it->second) : 0.0;
double b = mcp::holds_alternative<double>(b_it->second)
? mcp::get<double>(b_it->second) : 0.0;
result.content.push_back(mcp::TextContent{"Result: " + std::to_string(a + b)});
return result;
});
server->listen("http://0.0.0.0:3000");
server->run();
}
#include "mcp/client/mcp_client.h"
int main() {
mcp::client::McpClientConfig config;
config.client_name = "my-mcp-client";
auto client = mcp::client::createMcpClient(config);
client->connect("http://localhost:3000");
// Initialize protocol
auto init = client->initializeProtocol().get();
// Call a tool
auto args = mcp::make<mcp::Metadata>()
.add("a", 10.0)
.add("b", 5.0)
.build();
auto result = client->callTool("add", mcp::make_optional(args)).get();
}
See examples/mcp/README.md for complete working examples:
# Terminal 1: Start server
./build/examples/mcp/mcp_example_server --verbose
# Terminal 2: Run client with demo
./build/examples/mcp/mcp_example_client --demo --verbose
The example server includes:
# Debug build
make debug
# Release build
make release
# Static libraries only
cmake -B build -DBUILD_SHARED_LIBS=OFF
# Without C API
cmake -B build -DBUILD_C_API=OFF
# Custom install prefix
cmake -B build -DCMAKE_INSTALL_PREFIX=~/.local
Building on Windows requires Cygwin with MinGW-w64 toolchain:
Install Cygwin with these packages:
make, cmake - Build toolsmingw64-x86_64-gcc-g++ - MinGW C++ compilermingw64-x86_64-libevent - Event librarymingw64-x86_64-openssl - SSL/TLS library# From Cygwin bash shell
./build-mingw.sh # Release build (default)
./build-mingw.sh debug # Debug build
./build-mingw.sh release # Release build
./build-mingw.sh clean # Clean build directory
build-mingw/build-mingw/examples/mcp/mcp_example_server.exeSeveral C++ implementations of the Model Context Protocol exist. They serve different needs — this table is meant to help you pick the right one:
| gopher-mcp (this SDK) | hkr04/cpp-mcp | Neumann-Labs/mcp-cpp | |
|---|---|---|---|
| Focus | Production / enterprise deployments | Lightweight, minimal footprint | Modern C++20 framework |
| MCP |
SuvBaral /
The missing .NET SDK for Model Context Protocol (MCP) build AI-callable tool servers in C# for Claude Desktop, Claude Code, and any MCP client.
58/100 health