该项目与官方 MCP 示例(STDIO 版)有何不同?
原版使用 STDIO 通信且依赖 Anthropic LLM;本版本改用 SSE 通信,使服务器和客户端可解耦运行,同时将 LLM 调用切换为 OpenRouter.ai。
@jayliangdl
Basic information
MCP Client 与 MCP Server基于SSE方式的样例实现(Python版本)
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"py-mcp-sse": {
"command": "uv",
"args": [
"venv"
]
}
}
}Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Jay-py-mcp-sse 是一个 MCP(Model Context Protocol)客户端和服务器的样例实现(Python 版本),采用 SSE(Server‑Sent Events)通信模式。它集成了古腾堡计划 API 的图书搜索工具,并使用 OpenRouter.ai 作为 LLM 调用平台(替换了原版的 Anthropic LLM)。该项目面向希望学习或搭建 MCP SSE 模式的开发者。
使用 uv 或 pip 安装依赖,复制 .env.sample 为 .env 并填入 OpenRouter API 密钥。先运行 mcp_server.py 启动服务器(可选 --host 和 --port 参数),再运行 client.py 并传入服务器的 SSE URL(如 http://localhost:8080/sse)连接并使用工具。
原版使用 STDIO 通信且依赖 Anthropic LLM;本版本改用 SSE 通信,使服务器和客户端可解耦运行,同时将 LLM 调用切换为 OpenRouter.ai。
需要 Python 3.13 或更高版本,以及 uv 或 pip 包管理器。还需在 `.env` 文件中配置有效的 OpenRouter API 密钥。
先运行 `uv run mcp_server.py`(可添加 `--host` 和 `--port` 指定地址),然后运行 `uv run client.py http://<host>:<port>/sse` 连接。
主要文件:`mcp_server.py`(SSE 服务器)、`client.py`(MCP 客户端)、`.env.sample`(环境变量示例)、`pyproject.toml`(依赖管理)。
确认 Python 版本 ≥ 3.13、环境变量 `OPENROUTER_API_KEY` 已正确填写、所有依赖已安装、端口未被占用(可用 `--port` 更换端口)。
Painless E2E Automation for Mobile and Web

Health by Dr Brad works out a health plan from your own results: which screening is due at your age, and evidence-based suggestions, each with the reason and the published guideline or study behind it. Your record is one

Model Context Protocol Servers

Yuppsy MCP: build and publish real estate websites from your AI assistant. Yuppsy lets your AI assistant create live websites for real estate agents and individual property listings. You don't need a designer or any code
🔥 MaxKB is an open-source platform for building enterprise-grade agents. 强大易用的开源企业级智能体平台。
Comments