关于 mcp-gateway-go
mcp-gateway-go 是一个 Go 网关,可将基于 stdio 的 MCP 服务转换为 SSE 端点,供 HTTP 客户端使用,适用于需要通过 HTTP 连接浏览器或 AI Agent 的场景。
主要功能
- 01将 stdio MCP 服务转换为 SSE
- 02配置端口和端点路径
- 03支持可选的 Bearer 令牌
适用场景
- 01通过 HTTP 向浏览器开放 stdio 服务
- 02让 AI Agent 连接 stdio MCP 服务
MCP 相关
它通过 SSE 端点向 MCP 客户端提供基于 stdio 的 MCP 服务。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
服务地址
http://localhost:7979/sse一键复制安装命令
Claude CodeTerminal
claude mcp add --transport http gateway-go http://localhost:7979/sseCursor.cursor/mcp.json
{"mcpServers":{"gateway-go":{"type":"http","url":"http://localhost:7979/sse"}}}在 Cursor 中打开VS Code.vscode/mcp.json
{"servers":{"gateway-go":{"type":"http","url":"http://localhost:7979/sse"}}}在 VS Code 中打开Claude Desktopclaude_desktop_config.json
{"mcpServers":{"gateway-go":{"type":"http","url":"http://localhost:7979/sse"}}}Windsurf~/.codeium/windsurf/mcp_config.json
{"mcpServers":{"gateway-go":{"serverUrl":"http://localhost:7979/sse"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
mcp-gateway-go
mcp-gateway-go 是一个轻量级的 Go 网关,可将标准输入/输出(stdio)Model Context Protocol(MCP)服务转换为 Server-Sent Events(SSE)端点。这样,客户端就可以通过 HTTP 与其进行实时通信,例如 Web 浏览器或 AI Agent。
安装与使用
go install github.com/zhengkunwang223/mcp-gateway-go@latest
mcp-gateway-go --port 7979 --baseUrl http://127.0.0.1:7979 --command "npx -y @modelcontextprotocol/server-filesystem /tmp"
--port 7979:监听端口(默认值:7979)--baseUrl "http://localhost:7979":SSE 的基础 URL--ssePath "/sse":SSE 订阅路径(默认值:/sse)--messagePath "/message":消息路径(stdio→SSE 默认值:/message)--oauth2Bearer "some-access-token":添加包含所提供 Bearer 令牌的Authorization标头
📚 其他资源
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。