McpHub
MCP bridge that folds multiple MCP servers' capabilities into a few fixed tools for AI tools.
التثبيت
أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: .cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).
McpHubclaude mcp add mcphub -- dnx McpHub@0.0.1.1 --yes
{
"mcpServers": {
"mcphub": {
"command": "dnx",
"args": [
"McpHub@0.0.1.1",
"--yes"
]
}
}
}
التوثيق
مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.
McpHub
MCP bridge -- folds the capabilities (tools / prompts / resources) of multiple MCP servers into 4 fixed tools, exposed uniformly to AI tools.
Quick Start
stdio mode (default)
dotnet run --project src/McpHub -- --config examples/mcp-hub.config.json
Configure in your AI tool's mcp.json:
{
"servers": {
"mcp-hub": {
"command": "dotnet",
"args": [
"run",
"--project", "path/to/McpHub",
"--", "--config", "path/to/mcp-hub.config.json"
]
}
}
}
HTTP mode
dotnet run --project src/McpHub -- --http --port 8080 --config examples/mcp-hub.config.json
Client connects to http://localhost:8080/ (Streamable HTTP).
CLI Options
| Option | Alias | Description | Default |
|---|---|---|---|
--config | -c | Path to the MCP configuration file | Auto-discovered |
--http | - | Use HTTP (Streamable HTTP) transport | stdio |
--port | - | HTTP mode listening port | 8080 |
--workspace | -w | Workspace folder for ${workspaceFolder} substitution | Current directory |
--verbose | - | Output verbose diagnostic logs to stderr | Off |
暴露的 3 个 Tool
| Tool | 说明 |
|---|---|
list_mcp_capabilities | 列出所有上游 MCP server 的可用能力(tools/prompts/resources),可选 kind 过滤 |
describe_mcp_capability | 查询某个能力的完整调用方式(参数 schema 等),输入限定名 serverName.capabilityName |
call_mcp_capability | 实际调用某个能力,传入限定名 + arguments |
配置文件格式
兼容 VS Code 族(servers 键)和 Claude/Cursor 族(mcpServers 键),自动推断 transport 类型:
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"],
"env": { "API_KEY": "..." }
},
"remote-server": {
"type": "http",
"url": "https://example.com/mcp",
"headers": { "Authorization": "Bearer xxx" }
}
}
}
支持变量替换:
${workspaceFolder}— 工作区目录${env:VAR_NAME}— 环境变量
配置文件发现顺序(未指定 --config 时):
--config显式指定- 当前目录
mcp.json - 当前目录
.mcp.json .vscode/mcp.jsonclaude_desktop_config.json
架构
AI 工具 ←stdio/http→ McpHub ←stdio/http→ 多个上游 MCP Server
│
├── list_mcp_capabilities → 聚合所有 server 的 tools/prompts/resources
├── describe_mcp_capability → 透传 schema 详情
└── call_mcp_capability → 透传调用
详见 设计文档。
الأسئلة الشائعة
ما هو McpHub؟
MCP bridge that folds multiple MCP servers' capabilities into a few fixed tools for AI tools.
كيف أثبّت McpHub؟
يعمل على جهازك. في Claude Code: claude mcp add mcphub -- dnx McpHub@0.0.1.1 --yes. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.
هل يحتاج McpHub إلى مفتاح API؟
لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.
هل McpHub مفتوح المصدر؟
نعم. شيفرته متاحة على GitHub بترخيص MIT.
من يصون McpHub؟
ينشره john0king. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.
من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.