Github

Github

By sidharthrajaram GitHub

-

sse mcp
Overview

what is the SSE-based Server and Client for MCP?

The SSE-based Server and Client for MCP is a demonstration of a working pattern for Server-Sent Events (SSE) based Model Context Protocol (MCP) servers and standalone clients that utilize various tools for weather forecasting.

how to use the project?

To use the project, ensure you have the ANTHROPIC_API_KEY set in your environment. Run the server using uv run weather.py and the client with uv run client.py http://0.0.0.0:8080/sse. You can then type queries to get weather information.

key features of the project?

  • SSE-based communication between server and client.
  • Utilizes National Weather Service APIs for real-time weather data.
  • Decoupled processes for cloud-native applications.

use cases of the project?

  1. Real-time weather forecasting for specific locations.
  2. Integration with other tools for enhanced data retrieval.
  3. Demonstrating cloud-native architecture with decoupled server-client interactions.

FAQ from the project?

  • What is the purpose of the SSE-based server?

The SSE-based server allows clients to connect and retrieve data without needing to spawn a server process, making it more efficient for cloud-native applications.

  • How do I install the project?

You can install it via Smithery using the command: npx -y @smithery/cli install @sidharthrajaram/mcp-sse --client claude.

  • Can I customize the server's host and port?

Yes, you can configure the server's host and port using command line arguments.

Content

SSE-based Server and Client for MCP

smithery badge

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/sse
Initialized 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 claude

Server

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 <your host> --port <your port>

Client

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/sse
No tools information available.
School MCP
School MCP by 54yyyu

A Model Context Protocol (MCP) server for academic tools, integrating with Canvas and Gradescope platforms.

canvas mcp
View Details
repo-template
repo-template by loonghao

A Model Context Protocol (MCP) server for Python package intelligence, providing structured queries for PyPI packages and GitHub repositories. Features include dependency analysis, version tracking, and package metadata retrieval for LLM interactions.

-

google-calendar mcp
View Details
strava-mcp
strava-mcp by jeremysilva1098

MCP server for strava

strava mcp
View Details

Model Context Protocol (MCP) server implementation for Rhinoceros/Grasshopper integration, enabling AI models to interact with parametric design tools

grasshopper mcp
View Details

MCP configuration to connect AI agent to a Linux machine.

security mcp
View Details

AI assistant built with Streamlit, NVIDIA NIM (LLaMa 3.3:70B) / Ollama, and Model Control Protocol (MCP).

python mcp
View Details