gopher MCP server
2026년 10월 30일 커밋개발자가 C++로 MCP server와 client를 구축할 수 있도록 지원하며, Python, TypeScript, Go, Rust, Java, C#용 C API 바인딩을 제공합니다.
다른 이름 GopherSecurity/gopher-mcp
- 스타
- 155
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 10월 30일
- 라이선스
- Apache-2.0
gopher MCP란?
개발자가 C++로 MCP server와 client를 구축할 수 있도록 지원하며, Python, TypeScript, Go, Rust, Java, C#용 C API 바인딩을 제공합니다.
프로젝트 README에서 생성된 요약
gopher MCP server 정보
이 C++ SDK를 사용하면 Model Context Protocol을 활용하여 고성능 AI 기반 애플리케이션을 구축할 수 있습니다. 임베디드 시스템, IoT 기기, 게임 엔진 또는 저지연 백엔드 서비스를 개발하는 개발자에게 프로덕션 수준의 구현을 제공합니다. 이 SDK는 stdio, WebSocket, TCP, SSE를 포함한 HTTP 등 다양한 전송 방식을 지원하여 AI 모델과 외부 데이터 소스 간의 유연한 연결을 가능하게 합니다.
개발자는 Python, TypeScript, Go, Rust, Java, C#, Ruby용 바인딩을 제공하는 안정적인 C API를 사용하여 이 기술을 다양한 환경에 통합할 수 있습니다. 아키텍처는 요청 처리를 위한 모듈형 필터 체인을 특징으로 하며, 서킷 브레이커, 속도 제한(rate limiting), 커넥션 풀링과 같은 엔터프라이즈급 신뢰성 도구를 포함합니다. 복잡한 AI 도구 상호작용을 관리하면서도 속도를 유지할 수 있도록 제로 카피 버퍼와 락 프리(lock-free) 연산이 필요한 고성능 시나리오에 최적화되어 설계되었습니다.
활용 사례
- 1저지연 AI 서비스 구현제로 카피 버퍼를 사용하여 AI 모델과 고속 통신이 필요한 백엔드 서비스를 구축합니다.
- 2에지 디바이스에 AI 배포IoT 기기와 같이 리소스가 제한된 하드웨어에서 Model Context Protocol 구현체를 실행합니다.
- 3신뢰할 수 있는 AI 연결 관리내장된 속도 제한 및 서킷 브레이커를 사용하여 AI 인프라를 과부하로부터 보호합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능gophersecurity/gopher-mcp is public and reachablegithub.com/gophersecurity/gopher-mcp ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-10-30github.com/gophersecurity/gopher-mcp ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음0 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기MCP C++ SDK - Model Context Protocol Implementation for C++
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!
Table of Contents
- Architecture Overview
- Cross-Language Support
- What is MCP?
- Features
- Quick Start
- Examples
- Installation
- Documentation
- Comparison with Other C++ MCP SDKs
- FAQ
- Adopters
- Contributing
- License
Architecture Overview
┌─────────────────────────────────────────────────────────────────────┐
│ 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 │ │
│ └────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
Design Principles
- Thread-Safe Dispatcher Model - All I/O in dispatcher threads, no complex synchronization
- Filter Chain Architecture - Modular, composable request processing
- Production Patterns - Connection pooling, circuit breaker, graceful shutdown
Cross-Language Support
Use 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}
What is MCP?
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:
- AI assistants to access files, databases, and APIs
- Developers to expose tools and resources to AI models
- Applications to integrate AI capabilities with enterprise systems
This MCP C++ SDK implements the official MCP specification in high-performance C++, suitable for:
- Embedded systems and IoT devices
- High-frequency trading and real-time applications
- Game engines and graphics applications
- Native desktop and mobile applications
- Backend services requiring low latency
Features
| Category | Features |
|---|---|
| Protocol | Full MCP 2025-06-18, 2025-11-25 and 2026-07-28 specifications, 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 |
Quick Start
Build and Install
# Show all available commands
make help
# Build
make
# Install (auto-prompts for sudo if needed)
make install
# Run tests
make test
Create an MCP Server
#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();
}
Create an MCP Client
#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();
}
Examples
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:
- Resource registration and subscriptions
- Tool execution (calculator, database query, system info)
- Prompt templates
- Session management
- HTTP/SSE endpoints
Installation
Prerequisites
- C++14 compiler (GCC 8+, Clang 10+, MSVC 2019+)
- CMake 3.10+
- libevent 2.1+
- OpenSSL 1.1+ (optional, for TLS)
Build Options
# 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
Windows (Cygwin + MinGW)
Building on Windows requires Cygwin with MinGW-w64 toolchain:
Prerequisites
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
Build Commands
# 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
Output
- Build directory:
build-mingw/ - Executable:
build-mingw/examples/mcp/mcp_example_server.exe
Documentation
MCP C++ Documentation
- Examples Guide - Working server and client examples
MCP CPP Core Components
- MCP Protocol in C++ - Model Context Protocol implementation details
- Tasks - Long-running tool calls as tasks, on the server and the client
- Filter Chain - Processing pipeline architecture
- Transport Layer - Transport implementations
- Network Layer - Connection management and socket abstraction
Design Documents
- Event Loop Design - Event-driven architecture and dispatcher design
- Filter Usage Guide - Comprehensive guide for using and creating filters
- CTAD Alternatives - Class Template Argument Deduction alternatives for C++14
- MCP Serialization Coverage - JSON serialization implementation details
Comparison with Other C++ MCP SDKs
Several 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 spec version | 2025-06-18, 2025-11-25, 2026-07-28 | 2025-03-26 | 2025-11-25 (in progress) |
| C++ standard | C++14 / 17 / 20 | C++17 | C++20 |
| Transports | stdio, HTTP+SSE, HTTPS, Streamable HTTP, WebSocket, TCP | stdio, HTTP+SSE | stdio, HTTP |
| Client + server | Yes | Yes | Yes |
| TLS | Yes | Yes (build flag) | — |
| Event model | Event-driven dispatcher (libevent), thread-safe by design | — | — |
| Resilience | Connection pooling, circuit breaker, rate limiting, backpressure | — | — |
| Observability | Metrics, tracing hooks, structured logging | — | — |
| Language bindings | Python, TypeScript, Go, Rust, Java, C#, Ruby via stable C API | C++ only | C++ only |
| License | Apache-2.0 | MIT | MIT |
If you need a small dependency for a quick stdio tool, a lightweight SDK like
cpp-mcp is a fine choice. If you need an MCP C++ SDK for production —
long-lived connections, multiple transports, observability, or calling the
SDK from other languages — that is what gopher-mcp is built for.
FAQ
What is the Model Context Protocol?
MCP is an open protocol by Anthropic that standardizes how AI models interact with external tools and data. It defines JSON-RPC methods for resources (data), tools (actions), and prompts (templates).
Why use C++ for MCP?
C++ provides maximum performance and portability. This SDK is ideal for embedded systems, real-time applications, game engines, and any environment where Python/Node.js overhead is unacceptable.
Does this work with Claude, GPT, and other AI models?
Yes. MCP is model-agnostic. Any AI system that supports MCP can use servers built with this SDK.
How do I integrate with my Python/Node.js application?
Use the C API bindings. The SDK provides a stable C interface that can be called from any language with FFI support.
Is this production-ready?
Yes. The SDK includes connection pooling, circuit breakers, rate limiting, TLS support, and comprehensive error handling suitable for enterprise deployments.
What transports are supported?
- stdio - Standard input/output (CLI tools)
- HTTP+SSE - HTTP with Server-Sent Events (web applications)
- HTTPS+SSE - Secure HTTP+SSE
- WebSocket - Bidirectional real-time
- TCP - Raw TCP sockets
How does this compare to cpp-mcp and other C++ MCP libraries?
See the comparison table. In short: gopher-mcp targets production use — more transports (Streamable HTTP, WebSocket, TCP), connection pooling, circuit breakers, observability, and multi-language bindings — while lighter SDKs optimize for minimal footprint.
How do I contribute?
See CONTRIBUTING.md for guidelines. Issues and pull requests welcome!
Adopters
Using this MCP C++ SDK in your product or project? We'd love to list you here — open a pull request or issue to add yourself.
- Gopher Security - MCP-native AI security platform
Keywords & Search Terms
MCP C++, MCP CPP, Model Context Protocol C++, MCP SDK, C++ MCP, CPP MCP, Model Context Protocol CPP, MCP implementation, AI model integration C++, LLM integration C++, MCP server C++, MCP client C++, Model Context Protocol SDK, C++ AI SDK, Enterprise MCP, Production MCP C++
Contributing
Contributions are welcome! Please read our contributing guidelines before submitting pull requests.
License
Apache License 2.0 - see LICENSE for details.
Related Projects
gopher MCP 질문
gopher-mcp는 어떤 전송 방식을 지원하나요?
stdio, HTTP+SSE, HTTPS+SSE, streamable HTTP, WebSocket, TCP 전송 방식을 지원합니다.
Python이나 Go에서 이 C++ MCP SDK를 사용할 수 있나요?
네. 이 SDK는 Python, TypeScript, Go, Rust, Java, C#, Ruby용 바인딩이 포함된 안정적인 C API(libgopher_mcp_c)를 제공합니다.
gopher-mcp를 빌드하기 위한 사전 요구 사항은 무엇인가요?
C++14 컴파일러(GCC 8+, Clang 10+, 또는 MSVC 2019+), CMake 3.10+, libevent 2.1+가 필요하며, TLS를 위해 OpenSSL 1.1+를 선택적으로 사용할 수 있습니다.
gopher-mcp에 보안 및 관측성 기능이 포함되어 있나요?
네. TLS/SSL, 인증 미들웨어, 요청 검증, 구조화된 로깅, 메트릭 및 헬스 엔드포인트를 제공합니다.
gopher-mcp를 빌드하고 설치하려면 어떻게 해야 하나요?
빌드하려면 make를, 설치하려면 make install을, 테스트를 실행하려면 make test를 실행하십시오.