This repository demonstrates an SSE-based Model Context Protocol (MCP) server and client pattern, enabling decoupled processes for cloud-native agent interactions with tools like weather forecasting. It uses tools from the
This project demonstrates a Server-Sent Events (SSE) based implementation of the Model Context Protocol (MCP) for both the server and client sides. It allows standalone MCP clients to interact with MCP servers, addressing a discussion initiated here.
Note: Ensure ANTHROPIC_API_KEY
is set in .env
or as an environment variable.
uv run weather.py
uv run client.py http://0.0.0.0:8080/sse
The SSE-based architecture enables decoupled processes for MCP servers and clients, allowing them to connect, utilize tools, and disconnect independently, even on separate nodes. This "cloud-native" approach contrasts with the STDIO pattern where the client spawns the server as a subprocess.
To install automatically via Smithery:
npx -y @smithery/cli install @sidharthrajaram/mcp-sse --client claude
weather.py
is an SSE-based MCP server offering tools based on the National Weather Service APIs, adapted from the MCP documentation's example STDIO server implementation. It runs on 0.0.0.0:8080 by default, configurable via command-line arguments.
client.py
is an MCP client that connects to and uses tools from the SSE-based MCP server, adapted from the MCP documentation's example STDIO client implementation. It connects to the SSE endpoint specified in the command-line argument.
sidharthrajaram/mcp-sse
January 27, 2025
March 28, 2025
Python