SM

sparfenyuk/mcp-proxy

开发工具

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

2812 stars 275 forks 质量 88 趋势 47MIT

可流式HTTP与标准MCP传输之间的桥接

概览

mcp-proxy 是一种工具,允许你在服务器传输之间切换。支持两种模式: 1. stdio 转 SSE/StreamableHTTP 2.SSE 转 stdio 从stdio运行一个代理服务器,连接到远程SSE服务器。 该模式允许像 Claude Desktop 这样的客户端通过 SSE 与远程服务器通信,尽管原生不支持。 该模式要求将MCP服务器SSE端点的URL作为程序的第一个参数。如果服务器使用可流式HTTP传输,务必通过传递--transport=streamablehttp在mcp代理端强制执行。 mcp-proxy应由MCP客户端启动,因此配置必须相应完成。 对于 Claude Desktop,配置条目可以是这样的: 运行一个代理服务器,暴露一个连接到本地 stdio 服务器的 SSE 服务器。

概述(AI 翻译)

  • MCP-代理
  • 关于
  • 1.stdio 到 SSE/StreamableHTTP
  • 1.1 配置
  • 1.2 示例用法
  • 2.SSE到stdio
  • 2.1 配置
  • 2.2 示例用法
  • 命名服务器
  • 安装
  • 通过 PyPI 安装
  • 通过Github仓库安装(最新版本)
  • 作为容器安装
  • 故障排除
  • 扩展容器镜像
  • Docker Compose 设置
  • 命令行参数
  • 示例配置文件
  • 测试

关于

mcp-proxy 是一个工具,允许你在服务器传输之间切换。支持两种模式:

  1. stdio to SSE/StreamableHTTP
  2. SSE到标准节点

1.stdio 到 SSE/StreamableHTTP

从stdio运行一个代理服务器,连接到远程SSE服务器。

该模式允许像 Claude Desktop 这样的客户端通过 SSE 与远程服务器通信,尽管不支持 SSE 是本地的。

1.1 配置

该模式要求将MCP服务器SSE端点的URL作为程序的第一个参数。如果服务器使用可流式HTTP传输,务必通过传递--transport=streamablehttp来强制执行该传输。

论点

|姓名 |必需品 |描述 |示例 |

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

README

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

mcp-proxy

About

The mcp-proxy is a tool that lets you switch between server transports. There are two supported modes:

  1. stdio to SSE/StreamableHTTP
  2. SSE to stdio

1. stdio to SSE/StreamableHTTP

Run a proxy server from stdio that connects to a remote SSE server.

This mode allows clients like Claude Desktop to communicate to a remote server over SSE even though it is not supported natively.

graph LR
    A["Claude Desktop"]  |stdio| B["mcp-proxy"]
    B  |SSE| C["External MCP Server"]

    style A fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px
    style B fill:#e6e6ff,stroke:#333,color:black,stroke-width:2px
    style C fill:#e6ffe6,stroke:#333,color:black,stroke-width:2px

1.1 Configuration

This mode requires providing the URL of the MCP Server’s SSE endpoint as the program’s first argument. If the server uses Streamable HTTP transport, make sure to enforce it on the mcp-proxy side by passing --transport=streamablehttp.

Arguments

Name Required Description Example
command_or_url Yes The MCP server SSE endpoint to connect to http://example.io/sse
在 GitHub 查看完整 README

安装

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

配置

{ "mcpServers": { "mcp-proxy": { "command": "mcp-proxy", "args": [ "http://example.io/sse" ], "env": { "API_ACCESS_TOKEN": "access-token" } } } }