High‑performance C++ implementation of the Model Context Protocol (MCP), with support for tools, resources, prompts, and multiple transport layers (STDIO, HTTP/SSE, WebSocket).
fastmcpp is a C++ port of the Python fastmcp library, providing native performance for MCP servers and clients with a small, focused dependency set.
Status: Beta – core MCP features track the Python fastmcp reference, but the C++ test suite is intentionally much smaller than the Python one.
Current version: 2.13.0. Python fastmcp remains the canonical source of truth for behavior and API; this C++ port is expected to follow it.
- Core MCP protocol implementation (JSON‑RPC).
- Multiple transports: STDIO, HTTP (SSE), WebSocket.
- Tool management and invocation.
- Resources and prompts support.
- JSON Schema validation.
- Middleware for request/response processing.
- Integration with MCP‑compatible CLI tools.
- Cross‑platform: Windows, Linux, macOS.
- C++17 or later compiler.
- CMake 3.20 or higher.
- nlohmann/json (fetched automatically).
Optional:
- libcurl (for HTTP POST streaming).
- cpp‑httplib (HTTP server, fetched automatically).
- easywsclient (WebSocket client, fetched automatically).
Key options:
| CMAKE_BUILD_TYPE | Debug | Build configuration (Debug/Release/RelWithDebInfo) |
| FASTMCPP_ENABLE_POST_STREAMING | OFF | Enable HTTP POST streaming (requires libcurl) |
| FASTMCPP_FETCH_CURL | OFF | Fetch and build curl if not found |
| FASTMCPP_ENABLE_STREAMING_TESTS | OFF | Enable SSE streaming tests |
| FASTMCPP_ENABLE_WS_STREAMING_TESTS | OFF | Enable WebSocket streaming tests |
Windows (Visual Studio):
Linux/macOS:
Current status (CI / WSL configuration):
- 24/24 tests passing (100% success rate).
- 3 streaming tests disabled due to infrastructure dependencies.
- C++ test line count is much smaller than the Python fastmcp suite (see CCSDK parity docs).
See the examples/ directory for complete programs, including:
- stdio_server.cpp – STDIO MCP server.
- server_quickstart.cpp – HTTP server with routes.
- client_quickstart.cpp – HTTP client usage.
- tool_example.cpp – tool registration and invocation.
- middleware_example.cpp – request/response middleware.
Contributions are welcome. Please:
- Ensure all tests pass.
- Follow the existing code style.
- Add tests for new features.
- Update documentation as needed.
Copyright 2025 Elias Bachaalany
Licensed under the Apache License 2.0. See LICENSE and NOTICE for details.
This is a C++ port of fastmcp by Jeremiah Lowin. The Python library is the canonical implementation; fastmcpp aims to match its behavior for core features.
For issues and questions, use the GitHub issue tracker: https://github.com/0xeb/fastmcpp/issues.
.png)


