SSE pattern for MCP clients/servers
Top 91.2% on sourcepulse
This repository provides a working pattern for Server-Sent Events (SSE)-based Message Communication Protocol (MCP) clients and servers. It enables decoupled processes for agents to connect to, use, and disconnect from tools, fitting cloud-native use cases better than traditional STDIO-based patterns.
How It Works
The project leverages SSE for communication, allowing MCP servers and clients to be independent, potentially distributed processes. This contrasts with STDIO-based MCP where the client spawns the server as a subprocess. The weather.py
script acts as an SSE-based MCP server, exposing tools like get_alerts
and get_forecast
powered by National Weather Service APIs. The client.py
script demonstrates an MCP client connecting to this SSE endpoint to utilize the provided tools.
Quick Start & Requirements
npx -y @smithery/cli install @sidharthrajaram/mcp-sse --client claude
uv run weather.py
uv run client.py http://0.0.0.0:8080/sse
ANTHROPIC_API_KEY
environment variable.uv
(ASGI server), Python.Highlighted Details
Maintenance & Community
No specific community links or maintenance details are provided in the README.
Licensing & Compatibility
The README does not explicitly state a license.
Limitations & Caveats
The project is presented as a "working pattern" and example, implying it may not be production-ready without further development. No specific limitations or caveats are mentioned.
4 months ago
Inactive