Weather MCP Server
Provides weather forecasts and alerts for US locations using the National Weather Service API. Supports getting detailed forecasts by coordinates and active weather alerts by state code.
README
Weather MCP Server
A Model Context Protocol (MCP) server that provides weather data using the National Weather Service API. This server supports both stdio (local) and HTTP (remote) transports.
Features
- get_forecast: Get weather forecast for any US location using latitude/longitude
- get_alerts: Get active weather alerts for any US state using 2-letter state code
Quick Start
Local Development
- Install dependencies:
npm install
- Build the project:
npm run build
- Start the HTTP server:
npm run start:http
The server will run on http://localhost:3001
Testing the Server
Test the health endpoint:
curl http://localhost:3001/health
Test the forecast tool:
curl -X POST http://localhost:3001/mcp/call \
-H "Content-Type: application/json" \
-d '{"tool":"get_forecast","params":{"latitude":40.7128,"longitude":-74.0060}}'
Test the alerts tool:
curl -X POST http://localhost:3001/mcp/call \
-H "Content-Type: application/json" \
-d '{"tool":"get_alerts","params":{"state":"CA"}}'
Connecting to thesys.dev
To connect this MCP server to thesys.dev:
-
Deploy the server to a publicly accessible URL (e.g., Railway, Render, Vercel, etc.)
-
Add to thesys.dev using these settings:
- Name:
Weather MCP Server - URL:
https://your-deployed-server.com(your actual deployment URL) - Transport Type:
Streamable HTTP(not SSE) - Bearer Token: Leave empty (optional)
- Description:
Weather data from National Weather Service API
- Name:
-
Available endpoints your deployed server will provide:
GET /health- Health checkGET /mcp/info- Server informationGET /mcp/tools- Available tools listPOST /mcp/call- Execute tools
Deployment Options
Option 1: Railway
- Connect your GitHub repository to Railway
- Railway will auto-detect the Node.js project
- Set environment variable
PORT(Railway provides this automatically) - Deploy and use the provided URL
Option 2: Render (Recommended)
- Create a new Web Service on Render
- Connect your GitHub repository:
https://github.com/x8yuv/MCPServer.git - Use these exact settings:
- Build Command:
npm install && npm run build - Start Command:
npm start(this now runs the HTTP server) - Environment: Add
NODE_ENV=production
- Build Command:
- Deploy and use the provided
.onrender.comURL
Important: The default npm start now runs the HTTP server (build/index.http.js), not the stdio server.
Option 3: Vercel
- Install Vercel CLI:
npm i -g vercel - Run
vercelin your project directory - Follow the prompts to deploy
- Use the provided URL
API Reference
Tools
get_forecast
Get weather forecast for a location.
Parameters:
latitude(number): Latitude (-90 to 90)longitude(number): Longitude (-180 to 180)
Example:
{
"tool": "get_forecast",
"params": {
"latitude": 40.7128,
"longitude": -74.0060
}
}
get_alerts
Get weather alerts for a state.
Parameters:
state(string): Two-letter state code (e.g., "CA", "NY")
Example:
{
"tool": "get_alerts",
"params": {
"state": "CA"
}
}
Error Handling
The server includes comprehensive error handling:
- Parameter validation using Zod schemas
- HTTP error responses with appropriate status codes
- Detailed error messages for debugging
CORS Configuration
The server is configured with permissive CORS settings to work with thesys.dev:
- Origin:
*(all origins allowed) - Methods:
GET,POST,OPTIONS - Headers:
Content-Type,Authorization,X-Requested-With
Data Source
This server uses the National Weather Service API, which:
- Provides free weather data for US locations
- Requires no API key
- Updates regularly with official weather information
- Only supports US locations (territories included)
Troubleshooting
Render Deployment Issues
"Application exited early" Error
This happens when Render runs the wrong entry point. Solution:
- Ensure
package.jsonhas"start": "node build/index.http.js" - In Render settings, use Start Command:
npm start - Never use
node build/index.js(that's the stdio server)
Server Logs Show "running on stdio"
This means the wrong server is running. Fix:
- Check Render Start Command is
npm start - Verify
package.jsonmain field is"build/index.http.js" - Redeploy after making changes
MAX_RETRIES_EXCEEDED Error
This error typically occurs when:
- The server URL is incorrect or not accessible
- The server is not running (check Render logs)
- Using wrong transport type (must be
Streamable HTTP) - Network connectivity issues
Solutions:
- Verify your deployed server is accessible:
https://your-app.onrender.com/health - Check Render service logs for errors
- Ensure the server is running and responding
- Test endpoints manually before connecting to thesys.dev
Connection Issues
- Make sure you're using
Streamable HTTPtransport type in thesys.dev - Verify the server URL is correct and publicly accessible
- Test the server endpoints manually before connecting to thesys.dev
- Check that Render service is "Live" (not sleeping)
License
ISC
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。