About weather
weather is a minimal TypeScript MCP server for developers following an MCP server tutorial. It provides US National Weather Service forecasts and active state alerts through two tools.
Key features
- 01Fetch forecasts by latitude and longitude
- 02Retrieve active alerts by US state
- 03Return structured tool output
Use cases
- 01Check a location's weather forecast
- 02Look up active alerts for a state
MCP support
Exposes `get-forecast` and `get-alerts` as MCP tools over stdio. Both declare output schemas and return structured content.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
2Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| state | string | Yes | Two-letter state code (e.g. CA, NY) |
Details
From the project READMEA Simple MCP Weather Server written in TypeScript
A minimal MCP server that exposes US weather data from the National Weather Service API as two tools:
get-forecast– get the forecast for a location (takeslatitudeandlongitude)get-alerts– get active weather alerts for a US state (takes a two-letter state code)
This example accompanies the Build an MCP server tutorial.
Prerequisites
- Node.js 24+
- npm
Build and run
npm install
npm run build
node build/index.js
The server communicates over stdio, so running it directly just waits for a client on stdin. To see it in action, launch it from one of the client examples in this repository, for example:
cd ../mcp-client-typescript
npm install && npm run build
node build/index.js ../weather-server-typescript/build/index.js
Structured content
Both tools declare an outputSchema and return structuredContent. get-forecast returns an object; get-alerts returns a top-level JSON array, which protocol revision 2026-07-28 is the first to allow — see Structured Content in the spec.
serveStdio serves both protocol eras from one factory, and the SDK projects the array-rooted schema down to the {"result": [...]} form for a 2025-11-25 client, so adopting it costs older clients nothing. See the SDK documentation.
Comments
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.