Weather MCP Server
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 MCP ServerWhat's the weather forecast for San Francisco?"
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 - Usage Guide
A Model Context Protocol (MCP) server that provides weather information using the National Weather Service API. Supports both local (stdio) and remote (HTTP/SSE) access.
Features
Dual Transport Support: Run locally via stdio or remotely via HTTP/SSE
Weather Alerts: Get active weather alerts by state
Weather Forecasts: Get detailed forecasts by coordinates (US locations only)
Session Management: Automatic session handling for remote connections
Related MCP server: MCP Weather Server
Installation
npm install
npm run buildUsage
Local Mode (Stdio Transport)
For local use with MCP clients like Claude Desktop:
# Default mode - no environment variable needed
node build/index.js
# Or explicitly set stdio mode
TRANSPORT=stdio node build/index.jsConfiguration for Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["/path/to/weather/build/index.js"]
}
}
}Remote Mode (HTTP/SSE Transport)
For remote access via HTTP:
# Start HTTP server on default port 3000
TRANSPORT=http node build/index.js
# Or specify a custom port
TRANSPORT=http PORT=8080 node build/index.jsThe server will start on http://localhost:3000/mcp (or your specified port).
Remote Access Examples
1. Initialize Session
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "my-client",
"version": "1.0.0"
}
}
}'Response: Returns session ID in mcp-session-id header. Save this for subsequent requests.
2. Get Weather Forecast
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: YOUR_SESSION_ID" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "get_forecast",
"arguments": {
"latitude": 37.7749,
"longitude": -122.4194
}
}
}'3. Get Weather Alerts
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: YOUR_SESSION_ID" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "get_alerts",
"arguments": {
"state": "CA"
}
}
}'4. Open SSE Stream (Optional)
For receiving server-initiated messages:
curl -N http://localhost:3000/mcp \
-H "Accept: text/event-stream" \
-H "mcp-session-id: YOUR_SESSION_ID"5. Terminate Session
curl -X DELETE http://localhost:3000/mcp \
-H "mcp-session-id: YOUR_SESSION_ID"Available Tools
get_forecast
Get weather forecast for a location.
Parameters:
latitude(number): Latitude of the location (-90 to 90)longitude(number): Longitude of the location (-180 to 180)
Note: Only US locations are supported by the National Weather Service API.
get_alerts
Get active weather alerts for a US state.
Parameters:
state(string): Two-letter state code (e.g., "CA", "NY")
Environment Variables
Variable | Description | Default | Example |
| Transport mode: |
|
|
| HTTP server port (HTTP mode only) |
|
|
Architecture
Stdio Mode
Single server instance
Communicates via stdin/stdout
Ideal for local MCP clients
HTTP Mode
Express-based HTTP server
Session-based architecture
Multiple concurrent sessions supported
Automatic session cleanup on disconnect
SSE streaming for real-time updates
Deployment
Local Development
TRANSPORT=http PORT=3000 node build/index.jsProduction (with PM2)
pm2 start build/index.js --name weather-mcp -- TRANSPORT=http PORT=3000Docker
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY build ./build
ENV TRANSPORT=http
ENV PORT=3000
EXPOSE 3000
CMD ["node", "build/index.js"]Troubleshooting
"Failed to retrieve grid point data"
Ensure coordinates are within the United States
NWS API only supports US locations
"Invalid or missing session ID"
Initialize a session first using the
initializemethodInclude the
mcp-session-idheader in all subsequent requests
Server not starting in HTTP mode
Check if port is already in use
Verify
TRANSPORT=httpenvironment variable is set
License
ISC
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceThis is a Model Context Protocol (MCP) server that provides weather information using the National Weather Service (NWS) API. Features Get weather alerts for a US state Get weather forecast for a specific location (using latitude and longitude)Last updated
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides tools to fetch weather alerts for US states and forecasts based on latitude/longitude coordinates using the US National Weather Service API.Last updated21031MIT
- Flicense-qualityDmaintenanceProvides weather information tools based on the National Weather Service APIs through an SSE-based MCP server that can run as a standalone process or Docker container.Last updated
- FlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that provides US weather forecasts and active alerts using the National Weather Service API.Last updated2
Related MCP Connectors
Get US weather forecasts, active alerts, and current observations.
OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)
Visual Crossing Weather MCP — wraps the Visual Crossing Weather Timeline API
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/ajayamal/mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server