mcp-weather -example
Claude Model Context Protocol Weather Server Example
claude mcp add --transport stdio duan-li-mcp-weather-server-example uv --directory /Users/<you-user-name>/Codes/GitHub/weather_service run weather-service \ --env UV_DEBUG="optional debugging flag" \ --env UV_PUBLISH_TOKEN="token for publishing (if needed)"
How to use
This MCP server implements a lightweight weather service that stores simple notes and exposes a custom note:// resource scheme. It provides a single tool named add-note for adding new notes to the server, where each note has a name and textual content. A note resource carries a name, a short description, and a text/plain payload. For querying or summarizing stored notes, there is a prompt named summarize-notes that can generate a summary by combining all current notes, with an optional style parameter to control detail level (brief or detailed). Clients can subscribe to resource changes so they are notified when notes are added or updated. The server is designed to be run in MCP environments via UV/uvx tooling; during development you’ll typically run the server with uv (development) and for deployment you can use uvx to package and run the server.
How to install
Prerequisites:
- Python environment and the uv tooling (via uvx for publishing or uv for development)
- Access to the repository containing the weather service MCP server code
Step-by-step:
- Install UV tooling (if not already installed):
- For development Run: install uv (via your preferred package manager) and ensure it is on your PATH.
- Clone the weather service repository:
- Navigate to the project directory:
- cd weather_service
- Install project dependencies (if any):
- uv sync
- Run in development mode (as shown in the README):
- uv run weather-service Note: The exact command may vary based on your environment; the README shows using the directory and running the weather-service target.
- (Optional) Build and publish (if you are preparing a distribution):
- uv build
- uv publish You may need PyPI credentials or UV_PUBLISH_TOKEN depending on your setup.
Additional notes
Tips and notes:
- The server exposes a note storage mechanism with a custom note:// URI scheme for accessing individual notes. Each note has a name, description, and a text/plain body.
- The summarize-notes prompt combines all stored notes into a single summary; you can pass a style parameter to influence detail level (brief or detailed).
- The add-note tool requires name and content arguments and updates the server state, notifying connected clients of changes.
- Debugging MCP servers over stdio can be challenging; using the MCP Inspector is highly recommended for debugging and inspecting the protocol communication. The README includes a command example to launch the inspector against a development server.
- If you publish the server, consider using uvx with the published configuration and provide any necessary environment variables (e.g., tokens or credentials) via your deployment environment.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP