|
cxxmcp 1.1.6
C++ MCP SDK
|
[
](LICENSE)
-brightgreen.svg) -brightgreen.svg)
A production-ready C++17 SDK for the Model Context Protocol — build MCP servers and clients that embed directly into native C++ applications, with full protocol coverage and cross-SDK conformance validation.
Read this in Chinese.
| Area | Status |
|---|---|
| Protocol & JSON-RPC | Typed models, serialization, initialize validation, raw escape hatches |
| Server SDK | Tool/prompt/resource registries, typed handlers, task-aware calls, notifications |
| Client SDK | HTTP, stdio, process-stdio, async helpers, roots, sampling, elicitation, tasks |
| Transports | stdio, process stdio, Streamable HTTP (stateful sessions), legacy SSE compat, WebSocket (auto-reconnect) |
| Packaging | CMake find_package, Conan 2, vcpkg overlay, FetchContent / CPM |
| Peer/Service boundary | RMCP-style role-aware Peer<Role> and Service<Role> |
Protocol coverage: tool, prompt, resource, resource template, completion, logging, roots, sampling, elicitation, task lifecycle, progress, cancellation, and raw JSON-RPC escape hatches for vendor extensions.
Conformance: Validated against the official modelcontextprotocol/conformance runner (--suite all).
| cxxmcp | RMCP | |
|---|---|---|
| Server | 109/110 (99%) | 48/95 (51%) |
| Client | 448/448 (100%) | — (runner crashed) |
Full details in conformance evidence.
cxxmcp is a release-candidate-quality C++ MCP SDK with full protocol coverage, cross-SDK conformance validation, and multiple transport options. See conformance evidence and ecosystem maturity evidence for details.
Build from source:
The quick-start client uses Streamable HTTP, so source builds that compile that client path must also set -DCXXMCP_ENABLE_HTTP=ON.
Package managers: conanfile.py (Conan 2), packaging/vcpkg/ports/cxxmcp-sdk (vcpkg overlay), packaging/xmake/ (xmake). See package consumption.
| Option | Default | Description |
|---|---|---|
CXXMCP_BUILD_SDK | ON | Build the aggregate SDK layer (protocol + client + server) |
CXXMCP_BUILD_CLIENT | OFF | Build the MCP client library |
CXXMCP_BUILD_SERVER | OFF | Build the MCP server library |
CXXMCP_BUILD_EXAMPLES | OFF | Build example executables |
CXXMCP_BUILD_TESTS | BUILD_TESTING | Build tests |
CXXMCP_BUILD_BENCHMARKS | OFF | Build benchmark executables |
CXXMCP_ENABLE_HTTP | OFF | Build HTTP/SSE transport (uses bundled cpp-httplib unless CXXMCP_USE_SYSTEM_DEPS=ON) |
CXXMCP_ENABLE_OPENSSL | OFF | Enable OpenSSL-backed HTTP/WebSocket TLS support |
CXXMCP_ENABLE_AUTH | OFF | Build the optional OAuth 2.1 / DPoP auth target |
CXXMCP_ENABLE_WEBSOCKET | OFF | Build WebSocket transport (requires CXXMCP_ENABLE_HTTP) |
| Target | Purpose |
|---|---|
cxxmcp::protocol | MCP protocol models and JSON-RPC serialization |
cxxmcp::transport | Role-generic transport contracts |
cxxmcp::handler | Client/server handler interfaces |
cxxmcp::peer | Role-aware execution boundary |
cxxmcp::service | Service lifecycle boundary |
cxxmcp::client | Embeddable MCP client SDK |
cxxmcp::server | Embeddable MCP server SDK |
cxxmcp::auth | Optional OAuth 2.1 / DPoP contract (CXXMCP_ENABLE_AUTH=ON) |
cxxmcp::auth_openssl | Optional OpenSSL-backed JOSE/JWT/DPoP helpers (CXXMCP_ENABLE_AUTH=ON, CXXMCP_AUTH_CRYPTO=OpenSSL) |
cxxmcp::sdk | Aggregate public SDK target |
find_package and goIn-tree examples cover server/client peers, auth, tasks, elicitation, and transport adapters. Run them with:
See examples.md for the full list. The separate cxxmcp-examples repository exercises the SDK through an external CMake project with advanced scenarios.
cxxmcp is a community C++ MCP SDK preparing official SDK candidate evidence. The Peer/Service boundary, transport layer, and conformance gates are in release-candidate shape. It is not an official MCP SDK unless accepted by the MCP maintainers.
MinGW UCRT64 GCC and MinGW CLANG64 Clang are tracked as provisional, best-effort compiler compatibility evidence. These targets are not release-supported. The compiler-compat workflow runs them with continue-on-error: true while they remain provisional.