mcpField
W
weather

weather

Local
github.com/dingw1982Maps & Travel0Updated 7w ago

About weather

weather is a minimal MCP weather server example from the MCP Quickstart Resources repository, with versions in five languages. It is for developers learning to build MCP servers and expose National Weather Service forecasts and alerts as tools.

Key features

  1. 01Examples in Python, TypeScript, Go, Rust, and Ruby
  2. 02Forecast lookup tool
  3. 03Weather alerts tool
  4. 04Communication over stdio
  5. 05Smoke tests for server and tool responses

Use cases

  1. 01Learn to implement a weather MCP server
  2. 02Try forecast and alert tool calls
  3. 03Compare server examples across languages

MCP support

Exposes two MCP tools, get_forecast and get_alerts (named get-forecast and get-alerts in TypeScript), backed by the US National Weather Service API.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"dingw1982-weather": {
"command": "npx",
"args": [
"-y",
"@dingw1982/mcp-quickstart-ts"
],
"env": {
"YOUR_API_KEY": "<YOUR_API_KEY>"
}
}
}
}
Run commandnpx -y @dingw1982/mcp-quickstart-ts
Environment variables to set
YOUR_API_KEYSecretYour API key for the service

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@dingw1982/mcp-quickstart-ts1.0.1

Tools

2

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
statestringYesTwo-letter state code (e.g. CA, NY)

Details

From the project README

MCP Quickstart Resources

Example servers and clients for the Model Context Protocol (MCP), in five languages. These are companion examples for two official tutorials:

  • Build an MCP server – a simple MCP weather server exposing two tools backed by the US National Weather Service API
  • Build an MCP client – an LLM-powered chatbot MCP client that connects to any stdio server and lets Claude call its tools

What's in this repository

Each example lives in its own directory with its own README covering prerequisites, setup, and how to run it:

LanguageWeather server (MCP server)Chatbot (MCP client)
Pythonweather-server-pythonmcp-client-python
TypeScriptweather-server-typescriptmcp-client-typescript
Goweather-server-gomcp-client-go
Rustweather-server-rustmcp-client-rust
Rubyweather-server-rubymcp-client-ruby

All servers communicate over stdio and expose the same two tools: get_forecast and get_alerts (or get-forecast and get-alerts in TypeScript).

All clients launch a server, list its tools, and start an interactive chat loop in which Claude can call those tools. The Python, TypeScript, and Ruby clients take a path to a server script; the Go and Rust clients take the command to run, plus any arguments.

Note: These example clients need an ANTHROPIC_API_KEY to operate. Without a key, each client still connects and lists the server's tools before exiting, so you can verify the MCP wiring without credentials.

You can mix and match across languages: for example, the Python client can drive the TypeScript server. Each client's README lists which server launch forms it supports.

The tests directory contains the smoke tests that run in CI against these examples. See tests/README.md for how they work.

Prerequisites

Each example only needs its own language toolchain. To work across the whole repository (for example, to run the smoke tests) you need:

  • Node.js 24+ and npm
  • Python 3.10+ and uv
  • Go 1.25+
  • Rust 1.88+ and Cargo
  • Ruby 3.4+ and Bundler

Running the tests

./tests/smoke-test.sh

The smoke tests verify that every server starts and answers MCP requests (including validating structured tool results against the schemas each tool advertises), and that the Python, TypeScript, and Ruby clients can connect to a mock server and list tools. They run automatically on every pull request via GitHub Actions.

Contributing

Contributions are welcome. To submit a change:

  1. Fork the repository and create a branch from main.
  2. Make your change. Keep the examples minimal - they exist to teach the protocol, not to be production services.
  3. If you change an example's behavior, setup, or dependencies, update that example's README to match.
  4. Run ./tests/smoke-test.sh and make sure it passes.
  5. Open a pull request against main describing what changed and why.

A few conventions to follow, in line with the broader Model Context Protocol contributing guidelines:

  • Keep documentation clear, concise, and technically accurate. Include code examples where appropriate, and test the commands and links you add.
  • Disclose AI assistance. If you used any kind of AI assistance to prepare your contribution, say so in the pull request or issue. See AI_POLICY.md for what the disclosure should cover.
  • Be respectful. This project follows the MCP community's Code of Conduct. Concerns can be reported to [email protected].

Security note

These examples are intentionally minimal. If you expose an MCP server over a network (HTTP/SSE/WebSocket), add authentication and basic hardening (CORS allowlist, request size limits, timeouts, rate limits, and log redaction). See SECURITY.md.

License

The MCP project is transitioning from the MIT License to Apache-2.0. New code contributions are licensed under Apache-2.0, and documentation (excluding specifications) under CC-BY-4.0. Earlier contributions whose authors have not consented to relicensing remain under the MIT License. See LICENSE for the full terms.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.