mcp-streamable-http
by invariantlabs-ai·★ 129·综合分 42
Python 和 TypeScript MCP 服务器示例,实现 Streamable HTTP 协议进行跨语言通信。
developer-toolsai-llmcommunication
35
Forks
4
活跃 Issue
12 个月前
最近提交
2 天前
收录于
概述
此仓库提供了 Python 和 TypeScript 中 MCP Streamable HTTP 客户端和服务器的完整示例实现。它展示了跨语言兼容性,Python 客户端可以与 TypeScript 服务器通信,反之亦然。该实现遵循官方 MCP Streamable HTTP 规范,并包含一个实际示例,如通过 MCP 协议与 Anthropic Claude API 集成的天气服务器。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
你:构建跨语言 MCP 服务器实现
你:创建基于 HTTP 的 MCP 传输层
你:开发天气信息 MCP 服务
你:什么是 MCP Streamable HTTP?
你:Python 和 TypeScript 实现可以互相通信吗?
什么时候选它
当你需要使用 Streamable HTTP 传输协议构建 MCP 服务器或客户端,特别是处理跨语言实现时,选择这个参考实现。
什么时候不要选它
如果你需要具有强大错误处理、安全功能或认证的生产级解决方案,不要选择这个 - 它主要是一个示例实现。
此 server 暴露的工具
从 README 抽取出 1 个工具get_weatherGet current weather information for a location
可对比工具
mcp-server-nodemcp-pythonmcp-http-bridge
安装
安装
Python 示例
git clone https://github.com/invariantlabs-ai/mcp-streamable-http.git
cd python-example/server
pip install .
python weather.pyTypeScript 示例
cd typescript-example/server
npm install && npm run build
node build/index.jsClaude Desktop 集成
添加到 Claude Desktop config.json:
"mcpServers": {
"streamable-http": {
"command": "node",
"args": ["/path/to/build/index.js"],
"env": {
"PORT": "8123"
}
}
}FAQ
- 什么是 MCP Streamable HTTP?
- 它是模型上下文协议(MCP)的一个传输层实现,使用 HTTP 进行 MCP 客户端和服务器之间的通信。
- Python 和 TypeScript 实现可以互相通信吗?
- 是的,该仓库展示了跨语言兼容性,Python 客户端可以与 TypeScript 服务器通信,反之亦然。
Hacker News 讨论
开发者社区最近的相关讨论。
- 帖子 by lbeurerkellner · 2025-05-20
- 帖子 by bishopsmother · 2025-05-30
mcp-streamable-http 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。