py-mcp-sse

MCP.Pizza Chef: jayliangdl

py-mcp-sse is a Python-based MCP client implementing Server-Sent Events (SSE) for real-time communication with MCP servers. It enables seamless interaction with MCP servers providing tools like book search via the Gutenberg API. This client is optimized from an earlier project and supports Python 3.13+, facilitating efficient LLM calls through OpenRouter.ai. It serves as a practical example of MCP client-server integration using SSE.

Unmaintained · No commits in 17 months.

Use This MCP client To

Connect to MCP servers using SSE for live tool data exchange Interact with book search tools via MCP server integration Implement real-time LLM-driven workflows in Python environments Test and develop MCP client-server communication patterns Use OpenRouter.ai as an LLM intermediary in MCP workflows

README

本项目建于2025-03-30,是一个MCP Client 与 MCP Server的样例实现(Python版本)

原版本是使用ANTHROPIC LLM实现,本版本调整使用OpenRouter.ai的LLM中转调用平台实现。

基于SSE的 MCP 服务器和客户端

mcp_server.py 是一个基于SSE的MCP服务器,提供了基于古腾堡计划API的图书搜索工具。改编自MCP文

档中的示例STDIO服务器实现

py-mcp-sse FAQ

How do I install py-mcp-sse?
Clone the repository, then use uv or pip to create a virtual environment and install dependencies.
What Python version is required?
Python 3.13 or higher is required to run py-mcp-sse.
What is the communication protocol used?
py-mcp-sse uses Server-Sent Events (SSE) for real-time communication with MCP servers.
Can py-mcp-sse work with different LLM providers?
Yes, it supports OpenRouter.ai and can be adapted for other providers like Anthropic and Claude.
Is py-mcp-sse a standalone MCP client?
Yes, it is a standalone Python MCP client designed to connect to SSE-based MCP servers.
What tools does the MCP server provide in this example?
The example MCP server provides a book search tool based on the Gutenberg Project API.
How is py-mcp-sse related to the original MCP SSE project?
It is an optimized Python version based on the original MCP SSE project with enhancements for LLM routing.
What platforms are supported?
It supports Linux, MacOS, and Windows with Python 3.13+ and standard virtual environment tools.