MCP Client 与 MCP Server基于SSE方式的样例实现(Python版本)
Overview
What is py-mcp-sse?
py-mcp-sse is a sample implementation of an MCP Client and MCP Server using Server-Sent Events (SSE) in Python. It is based on the original project and optimized for better performance.
How to use py-mcp-sse?
To use py-mcp-sse, clone the repository, set up the environment, configure the necessary API keys, and run the server and client scripts.
Key features of py-mcp-sse?
- Implements an MCP server and client using SSE for real-time communication.
- Provides a book search tool based on the Gutenberg Project API.
- Supports easy setup and configuration with environment variables.
Use cases of py-mcp-sse?
- Real-time book search and retrieval using the MCP server.
- Connecting multiple clients to a single server for collaborative tasks.
- Demonstrating the use of SSE in client-server applications.
FAQ from py-mcp-sse?
- What are the system requirements?
Python 3.13 or higher and uv package manager (recommended).
- How do I configure the environment?
Copy the sample environment file and fill in your OpenRouter API key.
- Can I run the server and client on different machines?
Yes, as long as they can communicate over the network.