weather-mcp
Click on "Deploy 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-mcpwhat's the weather in Tokyo?"
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-mcp
An MCP server built on AgentBack that exposes weather data from the free Open-Meteo API β no API key required. Decorator-driven tools with Zod input/output schemas, served over stdio, Streamable HTTP, or a dev console from one set of DI wiring.
π Live demo: agentback-demo.vercel.app β the AgentBack dev console (Context Β· API Β· MCP Β· Schema panels), deployed serverless on Vercel.
npm install
npm run build && npm start # stdio MCP server (for Claude Desktop / Cursor)
npm run serve:http # remote MCP server over HTTP at /mcp
npm test # in-memory MCP session, no process spawn
npm run console # dev web UI at http://localhost:3000/consoleArchitecture
Five layers, dependencies flowing strictly downward (Transports β Composition β Adapter β Domain β Contracts). Three transports share one DI wiring.

See docs/architecture.md for the layer-by-layer
breakdown and runtime flow (with an editable Mermaid source). The diagram is
also available as an interactive, exportable page β
docs/architecture-diagram.html.
Related MCP server: wetter-mcp-server
Transports
The same tools and DI wiring (src/wiring.ts) are served three ways:
Entry | Command | Transport | Use |
|
| stdio | Local β wire into Claude Desktop / Cursor. |
|
| Streamable HTTP at | Remote clients over the network. |
|
| HTTP web UI | Development inspector (see below). |
HTTP transport
npm run serve:http exposes the server at http://localhost:3000/mcp
(PORT=3939 npm run serve:http to change the port). Point any Streamable-HTTP
MCP client at that URL.
Auth: every request needs a valid API key in the x-api-key header (or
?apiKey=). Keys come from MCP_API_KEYS (comma-separated); if unset, a
dev-local-key is generated and printed to stderr so local runs still work.
MCP_API_KEYS=key1,key2 PORT=3939 npm run serve:http
# client must send: x-api-key: key1Rate limiting: tools/call is throttled per (caller, tool) β 60/min by
default, with get_forecast capped tighter at 20/min. Over the limit returns a
JSON-RPC 429 with Retry-After. Both are configured in src/serve-http.ts.
For public deployment also set
allowedHosts/allowedOriginsoninstallMcpHttp(DNS-rebinding protection), and consider a Redisstorefor the rate limiter so buckets are shared across instances.
Dev console
npm run console starts the AgentBack console β a web
UI that composes the MCP inspector (list and invoke your tools from a form),
the OpenAPI/Swagger explorer, and a DI context explorer. Override the
port with PORT=3737 npm run console.
The console serves over HTTP, so it runs a RestApplication (src/console.ts)
that reuses the exact same tool wiring as the stdio server (src/wiring.ts).
It's a development tool β the stdio entry point (src/main.ts) is what you wire
into Claude Desktop / Cursor.
A hosted instance is live at agentback-demo.vercel.app.
The same buildConsoleApp() runs there serverless: src/console.ts exposes it
with listen: false (mounts every route, binds no port) and api/index.ts
hands the Express app to Vercel. See vercel.json for the deploy config.
Tools
Tool | Purpose |
| Resolve a place name (e.g. "Tokyo") to candidate latitude/longitude. |
| Current conditions by |
| Daily forecast (1β16 days) by |
Each tool accepts temperature_unit (celsius/fahrenheit) and
wind_speed_unit (kmh/ms/mph/kn). When you pass a city, it is
geocoded automatically; pass coordinates directly to skip that step.
How it's wired
src/schemas.tsβ the single source of truth. Each Zod schema is simultaneously the runtime validator, thez.infertype, and the agent-visible MCP input/output schema.src/keys.tsβ typed DI keys.WEATHER_SERVICE = BindingKey.create<WeatherService>('services.weather')ties the key to its type, so the binding and every@inject(WEATHER_SERVICE)are type-checked.src/weather-service.tsβWeatherService, a stateless Open-Meteo client.@injectabledeclares its own binding: theWEATHER_SERVICEkey (ContextTags.KEY) and singleton scope β it's pure I/O, so one shared instance is reused.src/tools/weather.tools.tsβ the@mcpServer()tool class.@mcpServeris built on@injectable: it makes the class an extension of theMCP_SERVERSextension point (singleton by default). Each@toolcarries its Zod schemas and delegates to the injectedWeatherService.src/component.tsβWeatherComponentpackages the static DI contributions in one manifest:MCPComponentplus bothservices(WeatherTools,WeatherService). A tool class is a plain service β the MCP server discovers it as anMCP_SERVERSextension and resolves it through its binding, so constructor@injectis honored (nocontrollerneeded).src/wiring.tsβregisterWeatherMcp(app, stdio)addsWeatherComponentand applies the per-entry transport config (stdio on/off). Shared by all three entry points, so they stay in lockstep.src/serve-http.tsβ exportsbuildHttpApp()(builds, doesn't start) so tests can drive the api-key auth + rate-limit gate; the CLI run is guarded byisMain(import.meta).
Claude Desktop / Cursor config
{
"mcpServers": {
"weather-mcp": {
"command": "node",
"args": ["/absolute/path/to/weather-mcp/dist/main.js"]
}
}
}This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
Open-Meteo MCP β weather forecast + historical reanalysis + sister APIs
OpenWeather MCP β wraps the OpenWeatherMap API (openweathermap.org)
Open-Meteo tabanlΔ± anahtarsΔ±z hava durumu tahmin MCP sunucusu.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides weather forecasts and active alerts for US locations using the National Weather Service API. It supports both local stdio and remote HTTP/SSE transport modes for flexible integration with MCP clients.55 npmGPL 3.0
- AlicenseAqualityBmaintenanceMCP server for weather forecasts via Open-Meteo (no API key needed), providing current weather, hourly, and daily forecasts with geocoding support.3MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server providing worldwide weather via the free Open-Meteo APIs (no API key needed). Runs fully self-contained in Docker as a streamable-HTTP MCP service.-
- AlicenseNot gradedqualityBmaintenanceMCP server that provides tools to retrieve weather information from a weather API, supporting both local stdio and remote Streamable HTTP transports.205 npm1MIT