Weather MCP Server
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 MCP Serverwhat's the forecast for 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 MCP Server
https://modelcontextprotocol.io/docs/develop/build-server#typescript
Professional TypeScript MCP server that exposes weather tools backed by the US National Weather Service API.
Features
MCP server over stdio
TypeScript strict mode
No required API key
Safe
.envhandlingCLI client for manual testing
Automated MCP smoke tests using a local mock NWS server
Tools:
get-alertsget-forecast
Important:
api.weather.govonly supports locations in the United States and US territories. Forecasts for Italy or other non-US locations will not work with this data source.
Related MCP server: weather-mcp
Requirements
Node.js 20 or newer
npm
Check your versions:
node -v
npm -vInstallation
From the project folder:
npm installBuild
npm run buildThis creates compiled JavaScript in build/.
Run the MCP server
npm startThe server communicates over stdio, so when started directly it waits for an MCP client.
Manual CLI testing
First build the project:
npm run buildThen run the included client:
npm run clientExample commands inside the client prompt:
get-alerts { "state": "CA" }
get-forecast { "latitude": 34.05, "longitude": -118.25 }
quitAutomated tests
npm testThe tests do not depend on the live National Weather Service API. They start a local mock weather server and verify that the MCP server lists and executes its tools correctly.
Configuration
No configuration is required for normal use.
Optional environment variables:
NWS_API_BASE=https://api.weather.gov
NWS_USER_AGENT=weather-mcp-server/2.0 your-email@example.comDo not commit .env files. Use .env.example as a template only.
Claude Desktop configuration example
After running npm run build, add something like this to Claude Desktop's MCP configuration, adjusting the path to your local project folder:
{
"mcpServers": {
"weather": {
"command": "node",
"args": [
"C:/Users/torre/Desktop/myWeather/build/server.js"
]
}
}
}Project structure
src/
cli.ts Manual MCP client
nws.ts NWS API helpers and formatting
server.ts MCP server entry point
tests/
mcp-smoke.test.jsAvailable npm scripts
npm run build Compile TypeScript
npm start Start the MCP server
npm run dev Start the server with tsx
npm run client Start the manual CLI client
npm test Build and run automated tests
npm run clean Remove build outputSecurity note
The original project contained a .env file. This version removes it from the distributable project and ignores all .env files by default. If the previous .env contained a real API key, revoke or rotate that key.
This server cannot be deployed
Maintenance
Related MCP Connectors
Get US weather forecasts, active alerts, and current observations.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
US weather alerts (NWS): warnings, watches. $0.01/query. Register in-session — free testnet funds.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides weather alerts and forecasts for US locations using the National Weather Service API.95 npmGPL 3.0
- AlicenseNot gradedqualityDmaintenanceProvides US weather alerts and forecasts via the National Weather Service API.95 npmGPL 3.0
- AlicenseNot gradedqualityDmaintenanceProvides weather alerts and forecasts for US locations using the National Weather Service API.GPL 3.0
- FlicenseBqualityDmaintenanceProvides weather forecasts and active alerts from the US National Weather Service API for US locations.2-