Weather Pro
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Weather Prowhat's the weather in New York?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Weather Pro — a production-grade MCP server
A Model Context Protocol server that exposes real-time weather, built to demonstrate the full MCP surface — not just tools — and to run like a real service (dual transport, auth, caching, retries, tests, Docker, CI).
It is the "after" to a deliberately minimal "before"
(../mcp-real-weather-api), which exposes a single
get_weather tool over stdio and nothing else.
Targets the current stable spec, MCP 2025-11-25, via
@modelcontextprotocol/sdk.
What it demonstrates
MCP concept | Where to see it | What it proves |
Structured output |
| Tool results are typed & machine-readable, not opaque text |
Tool annotations |
| Server signals to the host that a tool is safe to auto-run |
Input validation | Zod | Bad arguments are rejected before our code runs |
Elicitation |
| Server pauses to ask the user a structured question |
Sampling |
| Server asks the client's LLM for advice — ships no LLM SDK itself |
Progress |
| Long-running tool streams incremental progress + supports cancel |
Resources (direct) |
| Fixed, read-only context (WMO code table) |
Resource templates |
| Parameterised, discoverable data (RFC 6570 URIs) |
Completions |
| Suggests valid argument values as you type |
Prompts |
| Reusable, user-invoked workflow (slash command) |
Logging |
| Structured observability over the protocol |
See DEMO.md for the guided walkthrough / talking points.
Related MCP server: mcp-weather
Quick start
npm install
npm test # unit tests (offline, deterministic)
npm run inspect # open the MCP Inspector against the stdio serverRun it
# Local (stdio) — for Claude Desktop, IDEs
npm start
# Remote (HTTP) — for multi-client / deployment
MCP_TRANSPORT=http PORT=3000 MCP_AUTH_TOKEN=changeme npm run start:httpEnd-to-end smoke tests (hit the live Open-Meteo API):
npm run smoke # spawns + drives the stdio server
# In one terminal: MCP_TRANSPORT=http PORT=3030 MCP_AUTH_TOKEN=demo-secret npm start
npm run smoke:http # drives the running HTTP serverConnect a client
Claude Desktop / IDE (stdio)
Add to your MCP client config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"weather-pro": {
"command": "node",
"args": ["/absolute/path/to/mcp-weather-pro/src/index.js"]
}
}
}Remote (Streamable HTTP)
{
"mcpServers": {
"weather-pro": {
"type": "http",
"url": "http://localhost:3000/mcp",
"headers": { "Authorization": "Bearer changeme" }
}
}
}Architecture
src/
index.js entrypoint — selects transport from MCP_TRANSPORT
config.js env-driven config (one source of truth)
logger.js structured JSON logs → stderr (stdout is the protocol!)
cache.js bounded TTL cache (hit/miss stats)
httpClient.js axios + timeout + retry/backoff for upstream calls
schemas.js Zod input/output schemas (validation + structured output)
server.js builds the McpServer and registers every primitive
services/
geo.js geocoding + ambiguity detection (powers elicitation)
weather.js current + forecast + WMO code mapping + units
cities.js static list for completions
features/
tools.js get_weather, compare_weather
resources.js direct resource + two templates
prompts.js plan-my-day
transports/
stdio.js local transport + graceful shutdown
http.js Streamable HTTP + Bearer auth + sessions + /healthProduction concerns covered
Dual transport (stdio + Streamable HTTP) from one codebase.
Auth — Bearer token on every HTTP
/mcpcall;/healthleft open.Resilience — per-call timeouts, bounded exponential backoff with jitter.
Caching — geocoding (24h) and weather (5m) with bounded size + eviction.
Validation — Zod on all tool inputs; SDK validates structured output.
Graceful degradation — elicitation/sampling are used only if the client supports them; otherwise the tool still returns a correct result.
Observability — structured stderr logs + protocol-level logging.
Tests & CI — unit tests on Node 18/20/22 + a Docker build in GitHub Actions.
Containerised — multi-stage-friendly Dockerfile with a healthcheck.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/swwayam/mcp-weather'
If you have feedback or need assistance with the MCP directory API, please join our Discord server