/ Каталог / Песочница / mcp-proxy
● Сообщество sparfenyuk ⚡ Сразу

mcp-proxy

автор sparfenyuk · sparfenyuk/mcp-proxy

Bridge stdio MCPs to SSE/Streamable HTTP and vice versa — one tiny Python tool that makes transports interoperate.

sparfenyuk/mcp-proxy is a transport bridge. Two modes: (1) stdio client connecting to a remote SSE/HTTP MCP — lets Claude Desktop talk to a remote server; (2) SSE server wrapping a local stdio MCP — exposes it over HTTP with CORS, auth, multiple named servers.

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

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

Живое демо

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

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

Установка

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

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

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

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

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

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "proxy": {
      "command": "uvx",
      "args": [
        "mcp-proxy"
      ],
      "_inferred": true
    }
  }
}

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

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "proxy": {
      "command": "uvx",
      "args": [
        "mcp-proxy"
      ],
      "_inferred": true
    }
  }
}

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

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "proxy",
      "command": "uvx",
      "args": [
        "mcp-proxy"
      ]
    }
  ]
}

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

~/.config/zed/settings.json
{
  "context_servers": {
    "proxy": {
      "command": {
        "path": "uvx",
        "args": [
          "mcp-proxy"
        ]
      }
    }
  }
}

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

claude mcp add proxy -- uvx mcp-proxy

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

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

Реальные сценарии: mcp-proxy

How to use a remote SSE MCP server inside Claude Desktop

👤 Devs with a team-hosted MCP gateway ⏱ ~10 min beginner

Когда использовать: Your team runs a gateway at https://mcp.team.internal but Claude Desktop only speaks stdio.

Предварительные требования
  • uv or pipx — brew install uv
Поток
  1. Install mcp-proxy
    Run: uv tool install mcp-proxy✓ Скопировано
    → mcp-proxy on PATH
  2. Configure Claude Desktop
    Add an MCP entry: command=mcp-proxy, args=['--headers','Authorization','Bearer $TOKEN','https://mcp.team.internal/sse'].✓ Скопировано
    → Claude Desktop connects on restart
  3. Verify
    In Claude, ask: what tools do you have?✓ Скопировано
    → Remote tools listed

Итог: Remote server usable from stdio-only clients.

Подводные камни
  • Auth header not picked up — Use --headers syntax exactly; some clients mangle env var interpolation — expand the token yourself
Сочетать с: mcphub

How to expose a local stdio MCP over HTTP for remote teammates

👤 Devs sharing a local tool temporarily ⏱ ~15 min intermediate

Когда использовать: You built a custom stdio MCP and a remote colleague wants to try it.

Поток
  1. Run proxy in inbound mode
    mcp-proxy --sse-host 0.0.0.0 --sse-port 3333 --named-server my-tool 'uvx my-tool-mcp'✓ Скопировано
    → SSE endpoint at :3333/my-tool/sse
  2. Tunnel it
    Use ngrok or cloudflared to expose 3333 on a public URL.✓ Скопировано
    → Shareable URL
  3. Teammate connects
    They add the URL to their client (via mcp-proxy or directly if their client supports SSE).✓ Скопировано
    → Shared session working

Итог: Ad-hoc sharing of local tools.

Подводные камни
  • No auth by default — Use --bearer-token or put it behind Caddy basic auth

How to serve multiple local MCPs from one proxy port

👤 Homelab tinkerers ⏱ ~15 min intermediate

Когда использовать: You want one gateway serving github, filesystem, and postgres MCPs.

Поток
  1. Start with multiple --named-server args
    mcp-proxy --sse-port 3333 --named-server gh 'uvx mcp-server-github' --named-server fs 'uvx mcp-server-filesystem ~/src'✓ Скопировано
    → Endpoints /gh/sse and /fs/sse
  2. Connect each in your client
    Add each as a separate server in your MCP client.✓ Скопировано
    → Tools from both appear

Итог: One process, many MCPs.

Подводные камни
  • Named servers share the proxy's resource budget — Don't put heavyweight MCPs in the same proxy as lightweight ones
Сочетать с: mcphub

Комбинации

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

proxy + mcphub

Use mcp-proxy to expose stdio MCPs that MCPHub can then aggregate over HTTP

Bridge my local github stdio MCP to HTTP with mcp-proxy, then register it in MCPHub's 'dev' group.✓ Скопировано
proxy + unla

Use Unla's public-facing gateway on top of mcp-proxy's last-mile stdio bridge

Bridge stdio MCPs with mcp-proxy and put Unla in front for OAuth + multi-tenancy.✓ Скопировано

Инструменты

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

ИнструментВходные данныеКогда вызыватьСтоимость
(proxy) stdio-to-sse remote_url, headers?, bearer? Connect stdio client to remote SSE server free
(proxy) sse-to-stdio named_server spec Expose a stdio MCP over HTTP free

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

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

Квота API
None
Токенов на вызов
No measurable overhead
Деньги
Free (MIT)
Совет
Skip proxy when your client natively supports the other transport — fewer moving parts.

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

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

Минимальные скоупы: Network egress to the remote URL (outbound mode) Inbound port binding (inbound mode)
Хранение учётных данных: Headers/tokens passed via CLI args or env
Исходящий трафик: Whatever the bridged MCP does; proxy itself is transparent
Никогда не давайте: Don't expose inbound mode on 0.0.0.0 without auth Don't log tokens in shell history — use env vars

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

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

Connection closed immediately

The remote URL path is wrong — SSE endpoints typically end in /sse.

Проверить: curl -N <url>
CORS error in browser client

Start mcp-proxy with --allow-origin or put it behind a reverse proxy with CORS headers.

401 even with --bearer-token

The remote expects the token on a different header (e.g., X-API-Key). Use --headers to customize.

SSE drops after 60s

Load balancer idle timeout. Raise it or use Streamable HTTP.

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

mcp-proxy в сравнении

АльтернативаКогда использоватьКомпромисс
MCPHubYou need multi-server aggregation + routing, not just a bridgeHeavier — UI, DB, OAuth all bundled
UnlaYou want REST-to-MCP conversion + gatewayDifferent problem space
supergatewayYou prefer a JavaScript stdio-to-SSE bridgeNode dependency

Ещё

Ресурсы

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

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

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