MCP Servers logo

MCP Servers

by devsapp

MCP Servers on Serverless provides templates and a proxy to enable existing MCP servers using STDIO to work with SSE, allowing them to be used in web applications. The mcp-proxy facilitates the transition of MCP Server code to SSE mode without requiring any code changes.

View on GitHub

Last updated: N/A

MCP Servers on Serverless

MCP 协议中有 STDIO 与 SSE 两种传输机制,大致如下:

STDIO模式架构

[客户端] → stdin请求 → [MCP服务器] → stdout响应 → [客户端]

SSE模式架构

                HTTP POST请求
              ↗---------------→
[Web客户端]                            [MCP服务器]
              ↖-----------------↙
                 SSE事件流推送

当前市场中存量 MCP Server 绝大部分采用 STDIO 传输机制实现,为了能够实现存量的 MCP Server 代码无需任何改变即可转为 SSE 模式,我们设计了 mcp-proxy,工作原理如下图:

mcp-proxy + stdio 模版

其中有 hello-world 示例:

SSE 模版