mcp-sse
A working pattern for SSE-based MCP clients and servers Python-based implementation.
Documentation
SSE-based Server and Client for MCP
This demonstrates a working pattern for SSE-based MCP servers and standalone MCP clients that use tools from them. Based on an original discussion here.
Usage
Note: Make sure to supply `ANTHROPIC_API_KEY` in `.env` or as an environment variable.
uv run weather.py
uv run client.py http://0.0.0.0:8080/sseInitialized SSE client...
Listing tools...
Connected to server with tools: ['get_alerts', 'get_forecast']
MCP Client Started!
Type your queries or 'quit' to exit.
Query: whats the weather like in Spokane?
I can help you check the weather forecast for Spokane, Washington. I'll use the get_forecast function, but I'll need to use Spokane's latitude and longitude coordinates.
Spokane, WA is located at approximately 47.6587° N, 117.4260° W.
[Calling tool get_forecast with args {'latitude': 47.6587, 'longitude': -117.426}]
Based on the current forecast for Spokane:
Right now it's sunny and cold with a temperature of 37°F and ...Why?
This means the MCP server can now be some running process that agents (clients) connect to, use, and disconnect from whenever and wherever they want. In other words, an SSE-based server and clients can be decoupled processes (potentially even, on decoupled nodes). This is different and better fits "cloud-native" use-cases compared to the STDIO-based pattern where the client itself spawns the server as a subprocess.
Installing via Smithery
To install SSE-based Server and Client for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @sidharthrajaram/mcp-sse --client claudeServer
`weather.py` is a SSE-based MCP server that presents some tools based on the National Weather Service APIs. Adapted from the MCP docs' example STDIO server implementation.
By default, server runs on 0.0.0.0:8080, but is configurable with command line arguments like:
uv run weather.py --host --portClient
`client.py` is a MCP Client that connects to and uses tools from the SSE-based MCP server. Adapted from the MCP docs' example STDIO client implementation.
By default, client connects to SSE endpoint provided in the command line argument like:
uv run client.py http://0.0.0.0:8080/sseFrequently asked questions
What is mcp-sse?
mcp-sse is A working pattern for SSE-based MCP clients and servers Python-based implementation.
How do I install mcp-sse?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-sse open source?
Yes — it is hosted on GitHub at https://github.com/sidharthrajaram/mcp-sse and has 299 stars.
Related MCP tools
Build effective agents using Model Context Protocol and simple workflow patterns Python-based implementation. Trusted by 7600+ developers.
ACI.dev is the open source tool-calling platform that hooks up 600+ tools into any agentic IDE or custom AI agent through direct function calling or a unifie...
Vibetest MCP - automated QA testing using Browser-Use agents Python-based implementation. Trusted by 500+ developers. Trusted by 500+ developers.
🌐Web Agent Protocol (WAP) - Record and replay user interactions in the browser with MCP support Python-based implementation.
A MCP (Model Context Protocol) server for interacting with dbt. Python-based implementation.
开盒即用的优雅管理mcp服务 | 结合Agent框架 | 作者听劝 | 已发布pypi | Vue页面demo Python-based implementation.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP