{"id":50315335,"url":"https://github.com/caomengxuan666/cxxmcp","last_synced_at":"2026-05-29T00:00:57.829Z","repository":{"id":308325686,"uuid":"1032414652","full_name":"caomengxuan666/cxxmcp","owner":"caomengxuan666","description":"Modern C++ SDK and runtime for the Model Context Protocol (MCP).","archived":false,"fork":false,"pushed_at":"2026-05-26T04:07:17.000Z","size":8954,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-26T04:08:50.282Z","etag":null,"topics":["c-plus-plus","cmake","cpp","json-rpc","mcp","mcp-sdk","model-context-protocol","sdk","streamable-http"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caomengxuan666.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-05T09:18:08.000Z","updated_at":"2026-05-26T04:01:41.000Z","dependencies_parsed_at":"2025-08-22T04:17:14.999Z","dependency_job_id":"8817a8c1-89fd-4814-a72c-e583649af483","html_url":"https://github.com/caomengxuan666/cxxmcp","commit_stats":null,"previous_names":["caomengxuan666/mcpserver.cpp","caomengxuan666/cxxmcp"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/caomengxuan666/cxxmcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caomengxuan666%2Fcxxmcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caomengxuan666%2Fcxxmcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caomengxuan666%2Fcxxmcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caomengxuan666%2Fcxxmcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caomengxuan666","download_url":"https://codeload.github.com/caomengxuan666/cxxmcp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caomengxuan666%2Fcxxmcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33630999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","cmake","cpp","json-rpc","mcp","mcp-sdk","model-context-protocol","sdk","streamable-http"],"created_at":"2026-05-29T00:00:38.050Z","updated_at":"2026-05-29T00:00:57.823Z","avatar_url":"https://github.com/caomengxuan666.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cxxmcp\n\n[![C++17](https://img.shields.io/badge/C%2B%2B-17-00599C.svg)](https://isocpp.org/)\n[![CMake](https://img.shields.io/badge/build-CMake-064F8C.svg)](https://cmake.org/)\n[![Release gates](https://github.com/caomengxuan666/cxxmcp/actions/workflows/release-gates.yml/badge.svg)](https://github.com/caomengxuan666/cxxmcp/actions/workflows/release-gates.yml)\n[![Pages](https://github.com/caomengxuan666/cxxmcp/actions/workflows/pages.yml/badge.svg)](https://caomengxuan666.github.io/cxxmcp/)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![MCP](https://img.shields.io/badge/protocol-Model%20Context%20Protocol-111827.svg)](https://modelcontextprotocol.io/)\n[![SDK](https://img.shields.io/badge/package-C%2B%2B%20SDK-0F766E.svg)](#quick-install)\n\n`cxxmcp` is a modern C++17 SDK for building\n[Model Context Protocol](https://modelcontextprotocol.io/) clients and servers\nin native C++ applications.\n\nUse it to expose local tools over MCP, connect to existing MCP servers, or embed\ntyped MCP protocol support into your own client/server process without adopting\nan additional hosting layer.\n\nRead this in [Chinese](README_zh.md).\n\n## Start Here\n\n| I want to... | Use |\n|---|---|\n| Build an MCP server with typed tools | `cxxmcp::server` and `mcp::ServerPeer` |\n| Connect to an MCP server | `cxxmcp::client` and `mcp::ClientPeer` |\n| Share protocol DTOs or JSON-RPC helpers | `cxxmcp::protocol` |\n| Use the complete SDK surface | `cxxmcp::sdk` |\n\nThe public SDK surface is intentionally narrow and package-friendly:\n`protocol`, `transport`, `handler`, `peer`, `service`, `client`, and `server`\nare the core library layers. Tooling and application hosting stay outside the\ncore SDK contract.\n\n## Contents\n\n- [Why cxxmcp](#why-cxxmcp)\n- [Quick Install](#quick-install)\n- [Quick Start](#quick-start)\n- [Capability Snapshot](#capability-snapshot)\n- [SDK Map](#sdk-map)\n- [Quality Signals](#quality-signals)\n- [Using As A Library](#using-as-a-library)\n- [Build From Source](#build-from-source)\n- [Package Targets](#package-targets)\n- [Protocol Boundary](#protocol-boundary)\n- [Capability Classification](#capability-classification)\n- [HTTP Transport Policy](#http-transport-policy)\n- [Compatibility Contract](#compatibility-contract)\n- [Examples](#examples)\n- [Release Evidence](#release-evidence)\n- [Documentation](#documentation)\n- [Project Status](#project-status)\n\n## Why cxxmcp\n\n- Normal CMake consumption with `find_package(cxxmcp CONFIG REQUIRED)`\n- C++17 public SDK targets with typed MCP protocol models\n- Embeddable client and server libraries for real C++ applications\n- RMCP-style `Peer`, `Service`, and handler boundaries for SDK-first authoring\n- stdio, process stdio, Streamable HTTP, and legacy SSE-compatible transport\n  paths\n- Typed tool, prompt, resource, completion, elicitation, sampling, task,\n  progress, and cancellation surfaces\n- Raw JSON-RPC escape hatches for vendor-specific or future MCP behavior\n- Package-smoke and cross-SDK interoperability tests used as release gates\n\n## Quick Install\n\nIf cxxmcp is installed into a CMake prefix, downstream use is the usual SDK\nflow:\n\n```cmake\nfind_package(cxxmcp CONFIG REQUIRED)\n\nadd_executable(my_server server.cpp)\ntarget_link_libraries(my_server PRIVATE cxxmcp::server)\n\nadd_executable(my_client client.cpp)\ntarget_link_libraries(my_client PRIVATE cxxmcp::client)\n```\n\nBuild and install a local SDK package from this checkout:\n\n```powershell\ncmake -S . -B build -DCXXMCP_BUILD_CLIENT=ON -DCXXMCP_BUILD_SERVER=ON\ncmake --build build --config Release\ncmake --install build --config Release --prefix out/install/cxxmcp\n```\n\nPublic SDK headers and package targets are C++17. Repository-local examples,\ntests, and documentation checks may require C++20.\n\nPackage-manager work starts from the SDK-only contract:\n\n- Conan 2 recipe: `conanfile.py`\n- vcpkg overlay port: `packaging/vcpkg/ports/cxxmcp`\n- xmake-repo recipe draft: `packaging/xmake/packages/c/cxxmcp/xmake.lua`\n- FetchContent / CPM.cmake snippets:\n  [Package consumption](docs/package_consumption.md). CPM users provide or\n  bootstrap their own `CPM.cmake`; cxxmcp does not install that helper.\n\nThese paths build only the C++17 SDK targets from this repository.\nThe vcpkg port is an overlay port for this checkout:\n\n```powershell\nvcpkg install cxxmcp --overlay-ports=C:\\path\\to\\MCPServer.cpp\\packaging\\vcpkg\\ports\n```\n\nManifest-mode projects can use\n`packaging/vcpkg/vcpkg-configuration.overlay-example.json` as a starting point\nand pin their own vcpkg `builtin-baseline`. cxxmcp is not in the curated\nregistry today; a future registry port will need a release tag, SHA512 source\narchive hash, triplet-controlled linkage, and the same SDK-only dependency\ncontract.\n\n## Quick Start\n\nStart with the normal CMake target for the side you are building:\n\n```cmake\nfind_package(cxxmcp CONFIG REQUIRED)\n\nadd_executable(my_mcp_server server.cpp)\ntarget_link_libraries(my_mcp_server PRIVATE cxxmcp::server)\n```\n\nThen create a peer, register typed handlers, and serve it over a transport:\n\n```cpp\n#include \u003ccxxmcp/peer.hpp\u003e\n#include \u003ccxxmcp/run.hpp\u003e\n\nint main() {\n    return mcp::ServerPeer::builder()\n        .name(\"demo-server\")\n        .version(\"1.0.0\")\n        .stdio()\n        .tool\u003cmcp::protocol::Json, mcp::protocol::Json\u003e(\"echo\",\n            [](const mcp::protocol::Json\u0026 input) {\n                return mcp::protocol::Json{{\"echo\", input}};\n            })\n        .run();\n}\n```\n\nFor client code and lower-level transport examples, see\n[Complete Peer/Service Examples](#complete-peerservice-examples).\n\n## Capability Snapshot\n\n| Area | Status |\n|---|---|\n| Protocol and JSON-RPC | Typed models, serialization helpers, initialize version validation, raw request/notification escape hatches |\n| Client SDK | HTTP, stdio, process-stdio, request handles, typed async helpers, roots, sampling, elicitation, tasks |\n| Server SDK | Registries, typed tool helpers, prompt/resource handlers, task-aware tool calls, notifications |\n| Peer/service boundary | RMCP-like role-aware `Peer\u003cRole\u003e` and `Service\u003cRole\u003e` public shape |\n| Transports | stdio, process stdio, Streamable HTTP, legacy SSE compatibility paths |\n| Packaging | Exported CMake targets, install tree support, package-smoke fixture |\n\n## SDK Map\n\n```mermaid\nflowchart TD\n    app[Application code]\n    peer[Peer / Service]\n    sdk[Client SDK / Server SDK]\n    core[Protocol / Transport / Handler]\n    io[stdio / process stdio / Streamable HTTP / SSE compatibility]\n    app --\u003e peer\n    peer --\u003e sdk\n    sdk --\u003e core\n    core --\u003e io\n```\n\n## Quality Signals\n\n- Release gates cover public headers, package-smoke consumption, transports,\n  SDK behavior, and RMCP / TypeScript / Python interoperability.\n- Release candidates are expected to publish workflow artifacts, Doxygen API\n  docs, source archives, checksums, and release evidence for the exact commit.\n- Compatibility expectations are tracked in\n  [Compatibility policy](docs/compatibility_policy.md) and\n  [Release gates](docs/release_gates.md).\n- The official SDK candidate path is tracked in\n  [Official SDK candidate process](docs/official_sdk_candidate_process.md).\n\nProject status: `cxxmcp` is a community C++ MCP SDK preparing official SDK\ncandidate evidence. It is not an official MCP SDK unless accepted or listed by\nthe MCP maintainers.\n\n## Using As A Library\n\nInstalled-package usage should look like a normal CMake SDK:\n\n`Peer` and `Service` remain the application entry points. The `client` and\n`server` package targets provide the embeddable SDK layers behind those entry\npoints, not a separate first-choice architecture.\n\n```cmake\nfind_package(cxxmcp CONFIG REQUIRED)\n\nadd_executable(my_client main.cpp)\ntarget_link_libraries(my_client PRIVATE cxxmcp::client)\n\nadd_executable(my_server server.cpp)\ntarget_link_libraries(my_server PRIVATE cxxmcp::server)\n```\n\nUse `cxxmcp::sdk` when one target should pull in the public protocol, client,\nand server SDK layers.\n\nThe package, repository, installed include path, and CMake targets use the\n`cxxmcp` name. The C++ namespace is intentionally `mcp` and is part of the\nstable source API; it should not be renamed inside a stable major release line.\n\nCommon public headers:\n\n```cpp\n#include \u003ccxxmcp/protocol.hpp\u003e\n#include \u003ccxxmcp/request.hpp\u003e\n#include \u003ccxxmcp/transport.hpp\u003e\n#include \u003ccxxmcp/handler.hpp\u003e\n#include \u003ccxxmcp/peer.hpp\u003e\n#include \u003ccxxmcp/service.hpp\u003e\n#include \u003ccxxmcp/client.hpp\u003e\n#include \u003ccxxmcp/server.hpp\u003e\n#include \u003ccxxmcp/sdk.hpp\u003e\n```\n\n## Build From Source\n\nRequirements:\n\n- CMake 3.23+\n- A C++17 compiler for SDK targets\n- A C++20 compiler when building examples or tests\n\nDefault SDK build:\n\n```powershell\ncmake -S . -B build\ncmake --build build\n```\n\nBuild client and server SDKs explicitly:\n\n```powershell\ncmake -S . -B build-sdk -DCXXMCP_BUILD_CLIENT=ON -DCXXMCP_BUILD_SERVER=ON\ncmake --build build-sdk\n```\n\nBuild examples:\n\n```powershell\ncmake --preset examples\ncmake --build --preset examples\nctest --preset examples\n```\n\nBuild and run the full smoke test set:\n\n```powershell\ncmake -S . -B build-smoke -DCXXMCP_BUILD_SDK=ON -DCXXMCP_BUILD_CLIENT=ON -DCXXMCP_BUILD_SERVER=ON -DCXXMCP_BUILD_TESTS=ON\ncmake --build build-smoke --config Debug\nctest --test-dir build-smoke -C Debug --output-on-failure\n```\n\nInstall to a local prefix:\n\n```powershell\ncmake --install build-smoke --config Debug --prefix out/install/cxxmcp\n```\n\n## Complete Peer/Service Examples\n\n### Canonical Server Peer/Service\n\n```cpp\n#include \u003ccxxmcp/peer.hpp\u003e\n#include \u003ccxxmcp/run.hpp\u003e\n\nint main() {\n    return mcp::ServerPeer::builder()\n        .name(\"demo-server\")\n        .version(\"1.0.0\")\n        .stdio()\n        .tool(mcp::server::tool\u003cmcp::protocol::Json, mcp::protocol::Json\u003e(\"echo\")\n            .description(\"Echo the incoming payload\")\n            .handler([](const mcp::protocol::Json\u0026 input) {\n                return mcp::protocol::Json{{\"echo\", input}};\n            }))\n        .run();\n}\n```\n\n### Canonical Client Peer/Service\n\n```cpp\n#include \u003ccxxmcp/peer.hpp\u003e\n#include \u003ccxxmcp/run.hpp\u003e\n\nint main() {\n    return mcp::ClientPeer::builder()\n        .streamable_http(\"http://127.0.0.1:3000/mcp\")\n        .run([](auto\u0026 svc) {\n            svc.peer().initialize();\n            svc.peer().list_all_tools();\n            svc.peer().call_tool(\"echo\",\n                                 mcp::protocol::Json{{\"value\", \"hello\"}});\n        });\n}\n```\n\n### Compatibility App Builder (Deprecated)\n\n`server::App::builder()` is deprecated. Use `ServerPeer::builder()` with\n`cxxmcp/run.hpp` instead — same `.tool\u003cArgs, Result\u003e(name, handler)` syntax,\none-call `.run()` entry point:\n\n```cpp\n#include \u003cstring\u003e\n\n#include \u003ccxxmcp/peer.hpp\u003e\n#include \u003ccxxmcp/run.hpp\u003e\n\nint main() {\n    return mcp::ServerPeer::builder()\n        .name(\"demo-server\")\n        .version(\"1.0.0\")\n        .instructions(\"Expose local tools over MCP.\")\n        .stdio()\n        .tool\u003cstd::string, std::string\u003e(\"echo\", [](const std::string\u0026 text) {\n            return text;\n        })\n        .run();\n}\n```\n\n## Package Targets\n\n| Target | Purpose |\n|---|---|\n| `cxxmcp::protocol` | MCP protocol models and JSON-RPC serialization |\n| `cxxmcp::transport` | Role-generic transport contracts and shared transport helpers |\n| `cxxmcp::handler` | Client/server handler interfaces and aggregates |\n| `cxxmcp::peer` | Role-aware client/server execution boundary |\n| `cxxmcp::service` | Service lifecycle boundary around peers |\n| `cxxmcp::client` | Embeddable MCP client SDK |\n| `cxxmcp::server` | Embeddable MCP server SDK |\n| `cxxmcp::auth` | Optional OAuth 2.1 / DPoP contract scaffold when `CXXMCP_ENABLE_AUTH=ON` |\n| `cxxmcp::sdk` | Aggregate public SDK target |\n| `cxxmcp::plugin_sdk` | Optional plugin authoring surface |\n| `cxxmcp::adapters` | Optional adapter helpers |\n\nGateway/runtime/CLI tooling lives outside this SDK repository. The in-tree\n`plugin_sdk` and `adapters` targets are optional SDK-adjacent surfaces, not\nfirst-choice SDK entry points.\n\n## Protocol Boundary\n\ncxxmcp follows the MCP JSON-RPC wire shape. It does not define a custom MCP\ndialect or alternate wire format. Normal application code should use typed\nhelpers for tools, prompts, resources, completion, roots, sampling,\nelicitation, tasks, progress, and cancellation. Raw JSON-RPC request and\nnotification APIs remain available for vendor-specific methods, forward\ncompatibility, and conformance tests. Unusual host integrations should be\nimplemented through compatibility adapters over the public transport contracts,\nnot by extending the protocol.\n\nTasks and elicitation are exposed as typed SDK capabilities, but they remain\noptional feature families. A milestone that targets core MCP parity must not\nforce applications to implement task or elicitation handlers unless that\nmilestone explicitly covers those capabilities. Capability negotiation and raw\nJSON-RPC escape hatches remain the compatibility path for partial or future\nfeature support. Server-side task and elicitation lifecycle semantics are documented in\n[Capability lifecycles](docs/capability_lifecycles.md). Request timeout,\ncancellation, progress, and shutdown semantics are documented in\n[Request lifecycle](docs/request_lifecycle.md).\n\n## Capability Classification\n\ncxxmcp treats protocol capabilities as negotiated contracts, not as global\nfeature promises. Once `initialize` capabilities are known, typed helpers fail\nlocally with a protocol error instead of sending a method that the peer did not\nadvertise. Raw JSON-RPC APIs remain available for vendor extensions and future\nprotocol fields.\n\n| Classification | Capability families | SDK rule |\n|---|---|---|\n| Core protocol | initialize, initialized, ping, JSON-RPC errors, raw request/notification escape hatches, cancellation, progress, and the typed model/serialization layer | Always part of the SDK contract. These are not optional product features, though individual transports may still report transport-level failures. |\n| Core advertised server features | tools, prompts, resources, resource templates, completion, logging, resource subscribe/unsubscribe | Public typed helpers are stable. Helpers that depend on advertised server capabilities are gated after initialize. |\n| Core advertised client features | roots, sampling, elicitation, cancellation and progress callbacks | Public typed handlers/helpers are stable. Server-side `ClientPeer` helpers are gated by the connected client's negotiated capabilities. |\n| Optional task lifecycle | task-aware tool calls, task list/get/cancel/result, task status notifications, task request parameters on supported feature calls | Stable typed protocol models and helpers exist, but applications only need to implement them when they advertise or require task support. |\n| Optional advanced interaction | elicitation form/URL flows and sampling details beyond basic request handling | Stable typed helpers exist, but implementations should keep them capability-gated and document user-facing behavior. |\n| Experimental or vendor extension | `experimental`, `extensions`, unknown JSON members, and vendor-specific methods | Raw JSON is preserved where modeled. Semantics are not guaranteed as stable SDK behavior until promoted into a documented capability family. |\n\n## Protocol Version Policy\n\ncxxmcp tracks published MCP protocol snapshots and does not mint custom\nversions. The SDK advertises and validates only versions listed by\n`protocol::supported_protocol_versions()`.\n\nWhen a new MCP snapshot is added, cxxmcp keeps the previous supported snapshot\nfor at least one minor release so clients and servers can overlap during\nrollout. Dropping a snapshot is a breaking compatibility event and must be\ncalled out in release notes and the public compatibility checklist.\n\nUnsupported versions fail fast with a protocol or transport validation error;\nthe SDK does not silently negotiate down to an unadvertised dialect. HTTP\nrequests additionally require `MCP-Protocol-Version` after initialize, and\ninitialize requests with mismatched header/body versions are rejected.\n\n## HTTP Transport Policy\n\nStreamable HTTP is the default HTTP path. The server transport currently runs in\nstateful mode: each successful `initialize` creates a distinct\n`Mcp-Session-Id`, and later POST, GET/SSE, and DELETE requests must send that\nsession id plus `MCP-Protocol-Version`. Unknown or deleted sessions are treated\nas stale and rejected.\n\nStateless server mode is not currently advertised by `server::HttpTransport`.\nServers that need Streamable HTTP in this SDK should use the stateful session\ncontract above. The client transport can still consume simple HTTP MCP\nendpoints that do not return `Mcp-Session-Id`; in that case it omits session\nheaders and treats each POST response independently.\n\nServer-to-client requests, notifications, client capabilities, replay windows,\nand pending responses are tracked per session. `SessionContext::client()` binds\nthe returned `ClientPeer` to the active session, so roots, sampling,\nelicitation, cancellation, and progress notifications are routed to the correct\nHTTP client. One live real-time SSE stream is accepted per session; reconnects\nwith `Last-Event-ID` can replay retained events while an old stream is closing.\n\nHTTP auth is intentionally exposed as SDK contracts rather than a bundled\nidentity provider. Server applications can install `server::AuthProvider`; the\nStreamable HTTP transport passes request headers into `SessionContext`, stores a\nsuccessful `AuthIdentity`, and maps auth-category failures to\n`401 Unauthorized` with `HttpTransportOptions::auth_challenge` as the\n`WWW-Authenticate` value. Client transports can set fixed request headers and a\nbearer token through `StreamableHttpClientTransportOptions`; the bearer helper\nis applied to POST, SSE GET, and session DELETE requests unless an explicit\n`Authorization` header is already present. The fuller OAuth 2.1 / DPoP\ndirection is tracked in [Auth design](docs/auth_design.md).\n\nLegacy SSE compatibility is compatibility-only. New code should use the\nStreamable HTTP POST/GET/DELETE behavior and treat raw SSE endpoints as an\nadapter concern, not a separate SDK protocol.\n\nThe current `cpp-httplib` backend decision and replacement trigger are tracked\nin `docs/compatibility_policy.md#http-transport-backend-evidence`.\n\n## CMake Options\n\n| Option | Default | Description |\n|---|---:|---|\n| `CXXMCP_BUILD_SDK` | `ON` | Build the aggregate public SDK layer |\n| `CXXMCP_BUILD_PROTOCOL` | `ON` | Build the MCP protocol library |\n| `CXXMCP_BUILD_CLIENT` | `OFF` | Build the MCP client library |\n| `CXXMCP_BUILD_SERVER` | `OFF` | Build the MCP server library |\n| `CXXMCP_BUILD_EXAMPLES` | `OFF` | Build example executables |\n| `CXXMCP_BUILD_TESTS` | `BUILD_TESTING` | Build tests for enabled layers |\n| `CXXMCP_BUILD_DOCS` | `OFF` | Build Doxygen API documentation |\n| `CXXMCP_ENABLE_AUTH` | `OFF` | Build the optional OAuth 2.1 / DPoP auth contract target |\n\n`CXXMCP_BUILD_SDK` enables the protocol, client, and server layers.\n\n## Async Request Executor\n\nAsync request helpers use a small process-wide bounded worker pool. The default\nis 4 workers with a queue size of 64, which is intended for local\nstdio/process-stdio MCP workloads. Gateway, remote HTTP, or high-concurrency\napplications may configure it before the first async request:\n\n```cpp\nmcp::configure_request_executor(\n    mcp::RequestExecutorOptions{.worker_count = 8, .max_queue_size = 256});\n```\n\nReconfiguration after the executor has been initialized is rejected so in-flight\nrequest semantics remain stable.\n\n## Compatibility Contract\n\n- Public SDK headers and package targets compile as C++17 by default. The\n  configurable `CXXMCP_SDK_CXX_STANDARD` cache value may be raised by a\n  downstream build, but public headers must not require it.\n- The release compiler matrix is Windows/MSVC, Linux/GCC, Linux/Clang, and\n  macOS/AppleClang. A release may only claim support for matrix entries that\n  passed the public-header, package-smoke, and conformance gates for that\n  release.\n- MinGW UCRT64 GCC and MinGW CLANG64 Clang are provisional best-effort\n  compatibility evidence from the scheduled `compiler-compat` workflow, not\n  release-supported targets, while their jobs remain `continue-on-error`.\n- Public include paths stay under `cxxmcp/...`; public targets are\n  `cxxmcp::protocol`, `cxxmcp::transport`, `cxxmcp::handler`,\n  `cxxmcp::peer`, `cxxmcp::service`, `cxxmcp::client`, `cxxmcp::server`, and\n  `cxxmcp::sdk`.\n- Source compatibility follows semantic versioning. Public renames must add the\n  new name first, keep the old alias with `CXXMCP_DEPRECATED(\"message\")`,\n  document the migration, and remove the alias only in the next major release.\n- ABI stability is explicitly out of scope while cxxmcp ships static libraries\n  by default. A shared-library ABI policy must be defined before treating shared\n  builds as stable release artifacts.\n- Release review must include a public header diff, independent public-header\n  compile tests, installed-tree `package_smoke`, and the conformance matrix\n  available for that release.\n- The full compatibility policy is tracked in\n  [Compatibility policy](docs/compatibility_policy.md). Release-blocking tests,\n  labels, and the supported compiler/generator/runtime matrix are tracked in\n  [Release gates](docs/release_gates.md).\n\n## Examples\n\nThe in-tree examples preset builds compact SDK entry points:\n\n- First-choice Peer/Service examples: `cxx17_consumer`, `auth_bearer_http`,\n  `server_stdio_peer`, `server_peer`, `client_peer`, `process_stdio_client`,\n  `timeout_cancellation`, `elicitation_client`, `stdio_server`,\n  `typed_stdio_server`\n- Focused capability examples: `auth_dpop_openssl`, `handler_contracts`,\n  `task_async_client_server`, `streamable_http_client`\n- Compatibility and low-level examples: `client_loopback`\n`ctest --preset examples` runs only self-contained smoke examples. Long-running\nstdio servers and external Streamable HTTP samples are build-checked but not run\nas standalone CTest cases.\n\nThe example taxonomy is maintained in `docs/examples.md`.\n\nThe separate\n[cxxmcp-examples](https://github.com/caomengxuan666/cxxmcp-examples)\nrepository is the downstream, application-style validation suite. It exercises\nthe SDK through a normal external CMake project and covers advanced surfaces\nthat are intentionally broader than the compact in-tree samples: direct\nStreamable HTTP and legacy SSE, process stdio, custom transports, transport\nadapters, async request handles, cursor pagination, subscriptions,\nserver-to-client callbacks, HTTP auth-lite, tasks and cancellation, and\nplugin/adapters.\n\n## Quality Bar\n\nThe repository keeps SDK-grade checks close to the source tree:\n\n- protocol, client/server, transport, SDK, and public target tests\n- package-smoke fixture for installed CMake target consumption\n- local RMCP conformance coverage\n- examples build preset\n- formatting, cpplint, clang-tidy, Doxygen, and release-evidence scripts\n\nCurrent standardization work is tracked in [Fact-standard TODO](todo.md).\n\n## Release Evidence\n\nA release may claim support only for compiler, generator, runtime-library, and\nplatform combinations where the release-blocking set passed for the release\ncommit. The release evidence package is expected to include:\n\n- `cxxmcp-release-gates-*` workflow artifacts with CTest logs and JUnit output\n- `cxxmcp-doxygen-html` API documentation\n- `cxxmcp-source` source archive plus `SHA256SUMS.txt`\n- `cxxmcp-release-evidence` with README, changelog, compatibility policy,\n  release gates, checklist, notes template, TODO, and examples\n\nInterop evidence is anchored by RMCP conformance coverage and process-stdio\nfixtures for RMCP, TypeScript SDK, and Python SDK clients.\n\n## Documentation\n\n- [GitHub Pages documentation](https://caomengxuan666.github.io/cxxmcp/)\n- [Fact-standard TODO](todo.md)\n- [Contributing](CONTRIBUTING.md)\n- [Security policy](SECURITY.md)\n- [Compatibility policy](docs/compatibility_policy.md)\n- [Dependency and reference policy](docs/dependency_policy.md)\n- External gateway boundary: `docs/runtime_gateway.md`\n- [Protocol model audit](docs/protocol_model_audit.md)\n- [External consumer template](templates/external_consumer)\n- [Release process](docs/release_process.md)\n- [Release gates](docs/release_gates.md)\n- [Release candidate checklist](docs/release_candidate_checklist.md)\n- [Release notes template](docs/release_notes_template.md)\n- [Official SDK candidate process](docs/official_sdk_candidate_process.md)\n- [Request lifecycle](docs/request_lifecycle.md)\n- [Changelog](CHANGELOG.md)\n\n## Project Status\n\n`cxxmcp` is an MCP C++ SDK with an RMCP-like public architecture and strong\nstandard-SDK potential. The SDK-first shape, Peer/Service boundary, built-in\ntransport behavior, and cross-SDK conformance gates are in strong release\ncandidate shape. Do not claim fact-standard status until the release-gates\nmatrix has produced auditable artifacts and the release candidate checklist has\nbeen completed for the exact release commit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaomengxuan666%2Fcxxmcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaomengxuan666%2Fcxxmcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaomengxuan666%2Fcxxmcp/lists"}