Python 实现的天气 MCP 服务器

Python 实现的天气 MCP 服务器

一个使用 Python 编写的示例天气 MCP 服务器,通过 NWS API 提供天气信息服务。

快速入门

安装

  1. 克隆仓库: git clone https://github.com/jalateras/weather.git cd weather
  2. 使用 uv 安装依赖: make install
  3. 开发环境安装额外依赖: make dev

启动服务

运行以下命令启动服务器: make run 或 uv run python -m main

测试工具

使用 MCP CLI 工具测试功能: mcp call-tool http://localhost:8000 get_weather_alerts --args '{"state": "CA"}'

开发模式

开发时启用自动重载: make dev-server 访问 Inspector 界面:http://localhost:5173

停止服务器: make stop-server