weather-mcp

weather-mcp

Provides US weather alerts by state and forecasts by coordinates using the National Weather Service API.

Category
Visit Server

README

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

工具

工具 参数 说明
get_alerts state: string 查询美国州的天气警报(两字母州代码,如 CA)
get_forecast latitude: float, longitude: float 查询经纬度处的天气预报

运行

uv run weather.py

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 对象,字段:

字段 说明
ts UTC 时间戳
dir META(元信息)/ REQUEST >>(请求)/ RESPONSE <<(响应)
msg 完整的 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured