mcp-weather
mcp-weather
A minimal MCP (Model Context Protocol) server exposing weather tools, backed by the free Open-Meteo API. Built as a practice project for MCP + Claude Code.
Tools
get_current_weather({ city })— current temperature, windspeed, and conditions for a city.get_forecast({ city, days? })— daily max/min temperature and conditions fordaysdays (1-7, default 3).
No API key is required.
Setup
npm install
npm run buildTest
Runs the unit tests for the pure formatting/mapping logic in src/weatherFormat.ts:
npm testDebug with MCP Inspector
Launches an interactive web UI to call tools directly, without Claude Code:
npm run inspectorUse with Claude Code
This project's .mcp.json registers the server as weather, running node dist/index.js over stdio. Open this project in Claude Code (or restart it here), confirm weather shows as connected (/mcp), and ask a weather-related question — Claude Code will invoke the tools as needed.
Project layout
src/weatherFormat.ts— pure formatting/mapping logic (weather codes, day clamping, text formatting), unit tested.src/openMeteo.ts— thinfetchwrappers around Open-Meteo's geocoding and forecast APIs.src/index.ts— MCP server entrypoint: registersget_current_weatherandget_forecast, connects over stdio.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/DaniBencz/mcp-weather'
If you have feedback or need assistance with the MCP directory API, please join our Discord server