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.
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:
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:
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:
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Este servidor MCP basado en SSE permite a los usuarios conectarse e interactuar con las API del Servicio Meteorológico Nacional para recuperar alertas y pronósticos meteorológicos.
Related Resources
Related MCP Servers
- -securityFlicense-qualityThis is a Model Context Protocol (MCP) server that provides weather information using the National Weather Service (NWS) API. Features Get weather alerts for a US state Get weather forecast for a specific location (using latitude and longitude)Last updated 5 months agoPython
- -securityFlicense-qualityAn MCP server that provides weather information like forecasts and alerts for US locations using the National Weather Service API.Last updated a month ago2JavaScript
- AsecurityFlicenseAqualityAn MCP server that provides weather information and alerts for US locations using the National Weather Service API, enabling retrieval of weather forecasts and active weather alerts.Last updated 2 months ago2Python
- -securityAlicense-qualityA Python-based MCP server that provides real-time weather information using the National Weather Service API, supporting both synchronous and asynchronous HTTP requests.Last updated 2 months agoPythonMIT License