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 forecast near 40.7, -74.0?"
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 + MCP Log Proxy
两个 MCP (Model Context Protocol) 工具,通过 stdio 协议与 MCP 客户端(如 Claude Code、Cline、VS Code 等)交互。
weather-mcp/
├── weather.py # Weather MCP 服务器 — 查美国天气
├── main.py # 占位入口
├── pyproject.toml # 项目依赖
├── README.md
└── mcpLog/
├── mcp_log.py # MCP Log Proxy — 透明代理记录请求/响应
└── pyproject.toml # proxy 依赖1. Weather MCP Server
提供两个工具,数据来源 weather.gov API。
安装
# 安装 uv(如果还没有)
pip install uv
# 同步依赖
uv sync工具
工具 | 参数 | 说明 |
|
| 查询美国州的天气警报(两字母州代码,如 CA) |
|
| 查询经纬度处的天气预报 |
运行
uv run weather.pyRelated MCP server: MCP Weather Server
2. MCP Log Proxy
透明 stdio 代理,记录 MCP 客户端与目标服务器之间的所有 JSON-RPC 流量。
Client ≤stdin/stdout≥ mcp_log.py ≤stdio≥ Target Server
│
logs/<timestamp>_<pid>.jsonl安装
cd mcpLog
uv sync命令行用法
python mcp_log.py <target_command> [target_args...] [--log-dir <dir>]示例 — 代理 weather 服务器:
python mcp_log.py python ../weather.py --log-dir ./logs日志格式
每行一个 JSON 对象,字段:
字段 | 说明 |
| UTC 时间戳 |
|
|
| 完整的 JSON-RPC 消息体 |
示例:
{"ts":"2026-06-13T15:17:31","dir":"REQUEST >>","msg":{"method":"tools/call","params":{"name":"get_alerts","arguments":{"state":"CA"}},"jsonrpc":"2.0","id":5}}
{"ts":"2026-06-13T15:17:38","dir":"RESPONSE <<","msg":{"jsonrpc":"2.0","id":5,"result":{"content":[{"type":"text","text":"..."}]}}}3. 配置 Cline(VS Code 插件)
编辑 %APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json:
直连 weather(不打日志)
{
"mcpServers": {
"weather": {
"autoApprove": ["get_forecast", "get_alerts"],
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"C:\\code\\python\\weather",
"run",
"weather.py"
]
}
}
}通过 proxy 连接(记录所有请求日志)
{
"mcpServers": {
"weather": {
"autoApprove": ["get_forecast", "get_alerts"],
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "C:\\code\\python\\weather\\mcpLog\\.venv\\Scripts\\python.exe",
"args": [
"C:\\code\\python\\weather\\mcpLog\\mcp_log.py",
"C:\\code\\python\\weather\\.venv\\Scripts\\python.exe",
"C:\\code\\python\\weather\\weather.py",
"--log-dir",
"C:\\code\\python\\weather\\mcpLog\\logs"
]
}
}
}注意:路径里的
.venv\Scripts\python.exe是 Windows 的 venv 路径,macOS/Linux 改为.venv/bin/python。
配置后 reload Cline(或重启 VS Code)即可生效,日志输出到 mcpLog/logs/ 目录。
4. 配置 Claude Code
在项目根目录创建 .mcp.json:
{
"mcpServers": {
"weather": {
"type": "stdio",
"command": "python",
"args": [
"mcpLog/mcp_log.py",
"python",
"weather.py",
"--log-dir",
"mcpLog/logs"
]
}
}
}依赖
Python ≥ 3.13
MCP SDK ≥ 1.27
httpx
anyio
This server cannot be deployed
Maintenance
Related MCP Connectors
Get US weather forecasts, active alerts, and current observations.
US weather alerts (NWS): warnings, watches. $0.01/query. Register in-session — free testnet funds.
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.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides access to US National Weather Service data including active alerts by state and short-term forecasts for specific coordinates.2MIT
- AlicenseNot gradedqualityDmaintenanceProvides weather alerts and forecasts for US locations using the National Weather Service API.55 npmGPL 3.0
- AlicenseNot gradedqualityDmaintenanceProvides US weather alerts and forecasts via the National Weather Service API.55 npmGPL 3.0
- AlicenseNot gradedqualityDmaintenanceProvides weather alerts and forecasts for US locations using the National Weather Service API.GPL 3.0