pymcp-sse: Python MCP over SSE Library
About
Asynchronous Python library for building Model Context Protocol (MCP) servers and clients over HTTP/SSE, ideal for AI agents, tool integrations, and chatbot ecosystems.
Details
- Author
- rvirgilli
- GitHub stars
- 3
- Downloads
- 169
- Categories
- Developer Tools
Jump to
Install the library in editable mode with pip install -e . from the directory containing pyproject.toml (once published, pip install pymcp-sse will be available). Create a server by subclassing BaseMCPServer, register tools with the @server.register_tool() decorator, and run it with server.run() or server.run_with_tasks(). Clients use BaseMCPClient or MultiMCPClient to connect, initialize, and call tools.
pymcp-sse: Python MCP over SSE Library
A lightweight, flexible implementation of the Model Context Protocol (MCP) for Python applications, specializing in robust HTTP/SSE transport.
Features
- Modular Framework: Clean implementation of BaseMCPServer, BaseMCPClient, and MultiMCPClient.
- HTTP/SSE Transport: Robust HTTP/SSE implementation with automatic session management, configurable timeouts, and reconnection handling.
- Concurrent Task Execution: BaseMCPServer.run_with_tasks() method for easily running servers with persistent background asynchronous tasks.
- Tool Registration & Discovery: Simple decorator-based tool registration (@server.register_tool()) and a standard describe_tools endpoint for clients to dynamically query detailed tool capabilities (parameters, descriptions).
- Server Push: Built-in support for server-initiated push notifications to clients and periodic keep-alive pings. Includes NotificationScheduler helper class.
- LLM Integration: Includes BaseLLMClient abstraction for easy integration with various LLM providers (an Anthropic Claude example is provided).
- Flexible Logging: Configurable logging via pymcp_sse.utils.
Installation
To install the library locally for development:
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





