PM

pyroprompts/mcp-stdio-to-streamable-http-adapter

开发工具

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

26 stars 11 forks 质量 66 趋势 11MIT

通过STDIO MCP服务器代理与可流式HTTP MCP服务器交互

概览

将任何支持 STDIO MCP 服务器的 MCP 客户端(大多数都支持)集成到 Streamable HTTP MCP 服务器 如果你有一个可流式的HTTP MCP服务器,分支它,硬编码URI并发布,就能给你一个仓库,你可以指向它,添加到目录,并通过STDIO让人们使用。 注意:这与mcp-remote包有相似之处 MCP的新增可流式HTTP传输规范于2025年3月底发布,截至4月底,尚无客户端支持。typescript-sdk已合并代码,但尚未发布。Python SDK仍在开发中支持。Inspector支持,仅此而已。 这让开发者处于尴尬的境地。用STDIO或SSE(已弃用)开发MCP服务器,这样它能支持客户端,或者用可流式HTTP传输开发,但没人能用。 我(ferrants)想开始集成可流式 HTTP MCP 服务器,而不仅仅是检查器,所以我需要一种能立即将它们连接到客户端和大型语言模型(LLM)的方法!

概述(AI 翻译)

将任何支持 STDIO MCP 服务器的 MCP 客户端(大多数都支持)集成到 Streamable HTTP MCP 服务器

如果你有一个可流式的HTTP MCP服务器,分支它,硬编码URI并发布,就能给你一个仓库,你可以指向它,添加到目录,并通过STDIO让人们使用。

注:这与mcp-remote包有相似之处

为什么?

MCP的新增可流式HTTP传输规范于2025年3月底发布,截至4月底,尚无客户端支持。typescript-sdk已合并代码,但尚未发布。Python SDK仍在开发中支持。Inspector支持,仅此而已。

这让开发者处于尴尬的境地。用STDIO或SSE(已弃用)开发MCP服务器,这样它能支持客户端,或者用可流式HTTP传输开发,但没人能用。

我(ferrants)想开始集成可流式 HTTP MCP 服务器,而不仅仅是检查器,所以我需要一种能立即将它们连接到客户端和大型语言模型(LLM)的方法!

该软件包旨在通过成为STDIO MCP服务器,中继到你的可流式HTTP MCP服务器,来弥合这一限制。这使得所有MCP客户端都能立即支持流式HTTP。

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

README

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

mcp-stdio-to-streamable-http-adapter MCP Server

Integrate any MCP Client that has STDIO MCP Server Support (most do) with the Streamable HTTP MCP Servers

If you have a Streamable HTTP MCP Server, forking this, hardcoding the URI and publishing will give you a repo that you can point to, add to directories and let people use via STDIO.

Note: This has similarities to the mcp-remote package

Why?

The MCP Spec to add a Streamable HTTP Transport landed end of March 2025 and as of the end of April, no clients have adopted support. The typescript-sdk has merged the code, but not released. The Python SDK is still in development to support it. The Inspector supports it, but that’s it.

This leaves developers in an awkward position. Develop the MCP Server using STDIO or SSE (deprecated) so it works with clients or develop with Streamable HTTP transport, but nobody can use it.

I (ferrants) want to start integrating the Streamable HTTP MCP Servers beyond just the inspector, so I need a way to connect them to clients and LLMs right away!

This package aims to bridge the cap by being a STDIO MCP Server that relays to your Streamable HTTP MCP Server. This makes all MCP Clients support Streamable HTTP right away. And now developers can develop the Streamable HTTP MCP Servers and provide an installation method.

Installation

To add OpenAI to Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

On Windows: %APPDATA%/Claude/claude_desktop_config.json

Env Vars

  • URI: The URL of the Streamable HTTP MCP Server. This is required.
  • MCP_NAME: The name of the MCP Server. This is optional. If you configure multiple, this is required so they do not have the same names.
  • BEARER_TOKEN: The Bearer token for the Streamable HTTP MCP Server. This is optional. If specified, this will be sent along in the Authorization header.

Configuration

You can use it via npx in your Claude Desktop configuration like this:

{
  "mcpServers": {
    "my-saas-app-development": {
      "command": "npx",
      "args": [
        "@pyroprompts/mcp-stdio-to-streamable-http-adapter"
      ],
      "env": {
        "URI": "http://localhost:3002/mcp",
        "MCP_NAME": "local-custom-streamable-http-adapter"
      }
    }
  }
}

Or, if you clone the repo, you can build and use in your Claude Desktop configuration like this:


{
  "mcpServers": {
    "my-saas-app-development": {
      "command": "node",
      "args": [
        "/path/to/mcp-stdio-to-streamable-http-adapter/build/index.js"
      ],
      "env": {
        "URI": "http://localhost:3002/mcp",
        "MCP_NAME": "local-custom-streamable-http-adapter"
      }
    }
  }
}
在 GitHub 查看完整 README

安装

npx @pyroprompts/mcp-stdio-to-streamable-http-adapter
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "my-saas-app-development": { "command": "npx", "args": [ "@pyroprompts/mcp-stdio-to-streamable-http-adapter" ], "env": { "URI": "http://localhost:3002/mcp", "MCP_NAME": "local-custom-streamable-http-adapter" } } } }