/ Каталог / Песочница / mcphub
● Сообщество samanhappy ⚡ Сразу

mcphub

автор samanhappy · samanhappy/mcphub

Run all your MCP servers behind one endpoint — group them, smart-route by vector search, hot-swap configs without downtime.

MCPHub is a TypeScript hub that mounts many MCP servers under a single HTTP endpoint with routing by group, by server, or via a vector-search 'smart' router. OAuth, social login, PostgreSQL mode for production. Docker is the recommended deploy.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

mcphub.replay ▶ готово
0/0

Установка

Выберите клиент

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "mcphub": {
      "command": "npx",
      "args": [
        "-y",
        "mcphub"
      ],
      "_inferred": true
    }
  }
}

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "mcphub": {
      "command": "npx",
      "args": [
        "-y",
        "mcphub"
      ],
      "_inferred": true
    }
  }
}

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "mcphub": {
      "command": "npx",
      "args": [
        "-y",
        "mcphub"
      ],
      "_inferred": true
    }
  }
}

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "mcphub": {
      "command": "npx",
      "args": [
        "-y",
        "mcphub"
      ],
      "_inferred": true
    }
  }
}

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "mcphub",
      "command": "npx",
      "args": [
        "-y",
        "mcphub"
      ]
    }
  ]
}

Continue использует массив объектов серверов, а не map.

~/.config/zed/settings.json
{
  "context_servers": {
    "mcphub": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "mcphub"
        ]
      }
    }
  }
}

Добавьте в context_servers. Zed перезагружается автоматически.

claude mcp add mcphub -- npx -y mcphub

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: mcphub

How to expose 20 MCP servers through one URL for your team

👤 Platform engineers, team leads ⏱ ~30 min intermediate

Когда использовать: Engineers keep copy-pasting local configs and breaking each other's setups.

Предварительные требования
  • Docker and a server with a DNS name — Any cheap VPS works; use Caddy or nginx for TLS
  • mcp_settings.json listing your servers — Start from the MCPHub sample and add one entry per MCP
Поток
  1. Deploy the hub
    Run: docker run -p 3000:3000 -v $PWD/mcp_settings.json:/app/mcp_settings.json samanhappy/mcphub✓ Скопировано
    → Admin login URL + generated password in logs
  2. Create groups
    In the admin UI, create groups 'dev' (github, filesystem, postgres) and 'data' (postgres, bigquery).✓ Скопировано
    → Groups visible at /mcp/dev and /mcp/data
  3. Distribute the URL
    Share https://mcp.yourco.internal/mcp/dev with the team; they add it as a single HTTP MCP in their client.✓ Скопировано
    → Team members connect with one config line

Итог: A single operable endpoint replaces 20 per-machine setups.

Подводные камни
  • Leaking the admin password from Docker logs — Set ADMIN_PASSWORD env var explicitly; rotate on first login
  • Exposing the hub to the public internet — Put it behind a VPN or require bearer tokens per user

How to let $smart pick the right MCP for a prompt automatically

👤 Teams running too many tools to fit in a single context ⏱ ~15 min advanced

Когда использовать: You have 200+ tools across MCPs and blow past your model's tool budget.

Поток
  1. Enable the $smart endpoint
    Point your client at https://hub.example.com/mcp/$smart instead of a specific server.✓ Скопировано
    → Single meta-tool exposed that routes on intent
  2. Prompt naturally
    Find PRs in github.com/org/repo that are waiting on me and put them on my calendar as a 30-min review slot.✓ Скопировано
    → Hub picks github + google-calendar tools behind the scenes

Итог: Fewer tools in context, same capability.

Подводные камни
  • Smart router picks the wrong MCP on ambiguous prompts — Keep the per-group endpoints available as a fallback

How to add a new MCP server to the hub without downtime

👤 Operators ⏱ ~5 min beginner

Когда использовать: A new MCP just dropped and you want it live today without kicking everyone off.

Поток
  1. Edit mcp_settings.json via the UI
    In the MCPHub dashboard, add a new server entry and save.✓ Скопировано
    → Hot reload notification, new tools appear
  2. Assign to a group
    Add the new server to the 'data' group.✓ Скопировано
    → /mcp/data now includes the new tools

Итог: New MCP online in under a minute, no client reconnects required.

Комбинации

Сочетайте с другими MCP — эффект x10

mcphub + toolhive

Use ToolHive to containerize the individual MCPs, MCPHub to route to them

Register my ToolHive-run github MCP in MCPHub under the 'dev' group.✓ Скопировано
mcphub + proxy

Expose stdio-only MCPs over HTTP for the hub

Use mcp-proxy to bridge my local stdio MCP to HTTP so MCPHub can mount it.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
(meta) route-by-group HTTP path /mcp/{group} Regular use — narrow your blast radius free
(meta) route-by-server /mcp/{server} When you want exactly one server's surface free
(meta) $smart semantic router /mcp/$smart When you have too many tools for context 1 vector search per call

Стоимость и лимиты

Во что обходится

Квота API
None imposed by the hub; downstream MCPs keep their own quotas
Токенов на вызов
Adds ~50 tokens of tool metadata overhead
Деньги
Free (open source, Apache 2.0)
Совет
Use group routes, not $smart, for deterministic behavior and zero extra vector-search cost.

Безопасность

Права, секреты, радиус поражения

Минимальные скоупы: Bearer token per user Network-level restriction to trusted clients
Хранение учётных данных: ADMIN_PASSWORD env var; downstream MCP secrets via mcp_settings.json or secret manager
Исходящий трафик: The hub only proxies — your data goes wherever each downstream MCP sends it
Никогда не давайте: Public exposure without auth Admin UI on the open internet

Устранение неполадок

Частые ошибки и исправления

Cannot log in / password unknown

Check the container logs on first boot for the generated password or set ADMIN_PASSWORD.

Проверить: docker logs mcphub | grep -i password
New MCP shows up but no tools

The downstream MCP probably failed to start. Click 'Logs' on the server card.

Smart router returns 'no matching tool'

Reindex the vector store from Settings > Index tools.

OAuth redirect mismatch

Register the exact callback URL in your OAuth provider (must match hub's public URL).

Альтернативы

mcphub в сравнении

АльтернативаКогда использоватьКомпромисс
Unla (MCP Gateway)You want YAML-driven REST-to-MCP conversion plus multi-tenantGo-based, different operator model
ToolHiveYou want container-level isolation per MCPFocuses on running MCPs, less on routing/aggregation
mcp-proxyYou just need transport bridging, not multi-server aggregationSingle-server; no UI

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills