gopher-mcp

MCP安全风控

提供方 GopherSecurity · 包名 gopher-mcp

安全风控 stdio · 本地进程 未标注 社区 / 第三方 Claude DesktopCursorClineClaude Code
查看接入方式

MCP C++ SDK - Model Context Protocol implementation in CPP with enterprise-grade security, visibility and connectivity.

一句话选型结论

按资料字段整理

gopher-mcp 属于安全风控类 MCP 服务器,stdio · 本地进程,鉴权方式未标注,可直接接入 Claude Desktop、Cursor、Cline 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类安全风控 传输方式stdio · 本地进程 鉴权未标注 部署方式本地部署
GitHub 星标 107 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

安全风控
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

ai ai-tools async cplusplus cpp

支持客户端

适用场景

aiai-toolsasync

安装与配置

stdio · 本地进程 未标注
客户端在本机拉起子进程,数据不出本机
git clone https://github.com/GopherSecurity/gopher-mcp && cd gopher-mcp

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Cross-platform,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
资产与漏洞排查

盘点资产、扫漏洞、看暴露面。

日志与审计

汇总日志、查异常行为。

合规检查

按规则检查配置与权限是否合规。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Cursor、Cline,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在安全风控场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Cursor 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
gopher-mcp当前 未标注 stdio · 本地进程 本地部署 有 2026-04-20
Cyber Strike AI 75 未标注 未标注 无 2026-05-17
mcp-for-beginners 未标注 stdio · 本地进程 本地部署 有 2026-04-13
casdoor 未标注 stdio · 本地进程 本地部署 有 2026-04-12
kubeshark 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Modelcontextprotocol C22988b0 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

安全风控
字段来自项目仓库与公开索引,中文说明由本站标注
提供方GopherSecurity上游标注的维护方 GopherSecurity
分类安全风控本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式未标注远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时gopher-mcp · Cross-platform本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-04-20上游最后核验时间

详细介绍

17.2 KB
来自项目仓库与上游目录的原文,未做删改

MCP C++ SDK - Model Context Protocol Implementation for C++

⭐ 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

1. **Thread-Safe Dispatcher Model** - All I/O in dispatcher threads, no complex synchronization
2. **Filter Chain Architecture** - Modular, composable request processing
3. **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 |
```bash
# 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```bash

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```cpp
#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```cpp

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:```bash
# 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```bash

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 tools
- `mingw64-x86_64-gcc-g++` - MinGW C++ compiler
- `mingw64-x86_64-libevent` - Event library
- `mingw64-x86_64-openssl` - SSL/TLS library

#### Build Commands```bash
# 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

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

  • Model Context Protocol Specification
  • MCP TypeScript SDK
  • MCP Python SDK

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
gopher-mcp 怎么安装?

在客户端按下面的安装命令接入:git clone https://github.com/GopherSecurity/gopher-mcp && cd gopher-mcp。对应的包名是 gopher-mcp。装完在客户端配置里引用同一个包或端点。

gopher-mcp 怎么在 Claude Desktop、Cursor、Cline 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

gopher-mcp 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

gopher-mcp 需要 API Key 吗?

资料没有标注鉴权方式,是否需要密钥取决于服务本身,接入前按官方文档确认。

gopher-mcp 支持哪些客户端?

资料标注支持 Claude Desktop、Cursor、Cline、Claude Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

gopher-mcp 能提供哪些能力?

资料显示能力标签包括 ai、ai-tools、async、cplusplus、cpp。具体工具清单以官方文档为准。

gopher-mcp 需要什么运行环境?

运行时为 Cross-platform;属于本地进程,需要在本机装好运行环境。

gopher-mcp 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-04-20。