SA

supercorp-ai/supergateway

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

2932 stars 262 forks 质量 87 趋势 47MIT

通过SSE运行MCP标准服务器,通过标准传输运行SSE。AI网关。

概览

运行于一个命令之上或使用。这对远程访问、调试或连接客户端非常有用,尤其是当你的 MCP 服务器只支持 stdio 时。 - : 在 stdio 上运行 MCP 服务器的命令 - : 用于连接的 SSE URL(SSE→stdio 模式)- : 可连接的可流式 HTTP URL(StreamableHttp→stdio 模式)- : 输出 MCP 传输(默认:带 --stdio 的 sse,带 --sse 或 --streamableHttp 的 stdio)- : 用于监听的端口(stdio→SSE 或 stdio→WS 模式,默认:8000) - : SSE 或 WS 客户端的基础 URL(stdio→SSE 模式;可选) - : SSE 订阅的路径(stdio→SSE 模式, 默认:/sse) - :消息路径(stdio→SSE或stdio→WS模式,默认:/message) - :可流式HTTP路径(stdio→可流式HTTP模式,默认:/mcp)- :在有状态模式下运行stdio→可流式HTTP——:会话超时单位(毫秒级)(有状态stdio→仅限可流式HTTP模式)- :添加一个或多个头部(stdio→SSE、SSE→stdio或可流式HTTP→stdio模式;可多次使用)- :添加一个带有......

概述(AI 翻译)

Supergateway 通过 SSE(服务器发送事件) 或 WebSockets (WS) 运行基于 MCP 的服务器,只需一个命令。这对于远程访问、调试或连接客户端非常有用,当你的 MCP 服务器只支持 stdio。

有问题、想法还是只是想聊聊?加入Discord社区吧。

支持单位:

  • Supercov — 为编码代理和软件工厂🌙提供覆盖
  • 超级接口
  • 超级企业

安装与使用

通过 npx 运行超级网关:

  • --stdio "command":在 stdio 上运行 MCP 服务器的命令
  • --sse "https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app":连接SSE的URL(SSE→标准模式)
  • --streamableHttp "https://mcp-server.example.com/mcp":用于连接的可流式HTTP URL(StreamableHttp→stdio模式)
  • --outputTransport stdio | sse | ws | streamableHttp:输出MCP传输(默认:sse与--stdio,stdio与--sse或--streamableHttp)。通过--sse或--streamableHttp提供的远程服务器也可以通过sse、ws或streamableHttp提供;参见SSE、WS或可流式HTTP →远程服务器

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Supergateway runs MCP stdio-based servers over SSE (Server-Sent Events) or WebSockets (WS) with one command. This is useful for remote access, debugging, or connecting to clients when your MCP server only supports stdio.

Questions, ideas or just want to chat? Join the community on Discord.

Supported by:

Installation & Usage

Run Supergateway via npx:

npx -y supergateway --stdio "uvx mcp-server-git"
  • --stdio "command": Command that runs an MCP server over stdio
  • --sse "https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app": SSE URL to connect to (SSE→stdio mode)
  • --streamableHttp "https://mcp-server.example.com/mcp": Streamable HTTP URL to connect to (StreamableHttp→stdio mode)
  • --outputTransport stdio | sse | ws | streamableHttp: Output MCP transport (default: sse with --stdio, stdio with --sse or --streamableHttp). A remote server given with --sse or --streamableHttp can be served over sse, ws or streamableHttp too; see Remote server → SSE, WS or Streamable HTTP
  • --port 8000: Port to listen on (stdio→SSE, stdio→WS or stdio→Streamable HTTP mode, default: 8000)
  • --host 127.0.0.1: Address to listen on, e.g. 127.0.0.1 or ::1 ([::1] also works) (stdio→SSE, stdio→WS or stdio→Streamable HTTP mode, default: every interface). --baseUrl does not control binding: only --host limits which addresses accept connections. Refused in SSE→stdio and Streamable HTTP→stdio mode, which listen on nothing
  • --baseUrl "http://localhost:8000": Base URL for SSE clients (stdio→SSE mode; optional)
  • --ssePath "/sse": Path for SSE subscriptions (stdio→SSE mode, default: /sse)
  • --messagePath "/message": Path for messages (stdio→SSE or stdio→WS mode, default: /message)
  • --streamableHttpPath "/mcp": Path for Streamable HTTP (stdio→Streamable HTTP mode, default: /mcp)
  • --stateful: Run stdio→Streamable HTTP in stateful mode
  • --sessionTimeout 60000: Session timeout in milliseconds (stateful stdio→Streamable HTTP mode only)
  • --protocolVersion "2025-06-18": Protocol version the gateway uses when it initializes the server itself and the client’s request doesn’t name one (stateless stdio→Streamable HTTP mode, default: 2024-11-05)
在 GitHub 查看完整 README

安装

uvx mcp-server-git
新手?先看 mcpskill.org 教程 →

配置

{ "port": 8000, "mcpServers": { "git": { "command": "uvx", "args": ["mcp-server-git"] }, "files": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "./my-folder"], "outputTransport": "streamableHttp", "apiKey": "${FILES_KEY}", }, }, }