Token导航 LogoToken导航TokenDH.com
Weather AI System logo
地图位置未说明官方级别未说明来源级核验

Weather AI System

MCP Server

一个集成了Claude AI的天气系统,提供REST API、MCP服务器和React UI,支持自然语言天气查询和AI驱动的响应。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
位置天气自然语言处理JavaScriptClaudeAPI集成Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

thomasdegan

提供方

thomasdegan

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

天气人工智能系统 - 完整安装指南

一个集Claude AI于一体的综合天气系统,具备REST API、MCP服务器和美观的React用户界面。您可以使用自然语言询问天气问题,并获得格式丰富的AI驱动回复。

🌟 系统概述

这个项目由四个相互关联的服务组成:

  1. 🌤️ 天气API - 用于连接Open-Meteo获取天气数据的REST API
  2. 🔗 天气MCP服务器 - 具有多个接口的模型上下文协议服务器
  3. Claude AI 集成 - 用于天气查询的自然语言处理
  4. 🎨 BlockNote 用户界面 - 精美的React界面,支持富文本编辑

🚀 快速入门(所有服务)

先决条件

  • Node.js 18及以上版本 已安装
  • Anthropic API密钥 为Claude AI(在这里获取一个)
  • Git 用于克隆仓库

1. 克隆并设置

git clone https://github.com/thomasdegan/weather-ai-system.git
cd weather-ai-system

2. 安装依赖项

# Install Weather API dependencies
cd weather-api
npm install

# Install Weather MCP dependencies
cd ../weather-mcp
npm install

# Install BlockNote UI dependencies
cd ../blocknoteUI
npm install

3. 配置环境变量

天气API (可选 - 开箱即用):

cd weather-api
cp env.example .env
# Edit .env if needed (defaults work fine)

天气MCP服务器:

cd weather-mcp
cp env.example .env
# Edit .env to match your setup

配备Claude AI的BlockNote用户界面:

cd blocknoteUI
cp env.example .env
# Edit .env with your Anthropic API key

blocknoteUI 需要的 .env 配置:

# Claude AI Configuration
VITE_ANTHROPIC_API_KEY=your_anthropic_api_key_here
VITE_CLAUDE_PROXY_URL=http://localhost:3003

# Server Environment Variables (for proxy server)
ANTHROPIC_API_KEY=your_anthropic_api_key_here
WEATHER_API_URL=http://localhost:3001
CLAUDE_PROXY_PORT=3003

4. 启动所有服务

打开4个终端窗口/标签页:

1号航站楼 - 天气API:

cd weather-api
npm start

✅ 天气API正在运行于 http://localhost:3000

2号航站楼 - 天气MCP HTTP服务器:

cd weather-mcp
npm run http

✅ Weather MCP HTTP 服务器正在运行于 http://localhost:3001

3号航站楼 - Claude 代理服务器:

cd blocknoteUI
npm run proxy

✅ Claude 代理服务器正在运行于 http://localhost:3003

4号航站楼 - BlockNote 用户界面:

cd blocknoteUI
npm run dev

✅ BlockNote UI 运行于 http://localhost:3002

5. 访问系统

打开您的浏览器: http://localhost:3002

尝试这些自然语言查询:

  • “纽约的天气怎么样?”
  • “给我一份伦敦的5天天气预报”
  • “10001地区的天气怎么样?”
  • “比较纽约和洛杉矶的天气”
  • “迈阿密有天气预警吗?”
  • “纽约目前有哪些生效的天气预警?”
  • “给我显示英国伦敦的天气预警”

📊 服务架构

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   BlockNote UI  │    │  Claude Proxy   │    │   Weather API   │
│   (Port 3002)   │◄──►│   (Port 3003)   │◄──►│   (Port 3000)   │
└─────────────────┘    └─────────────────┘    └─────────────────┘
         │                       │                       │
         │                       │                       │
         ▼                       ▼                       ▼
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│  User Interface │    │   Claude AI     │    │   Open-Meteo    │
│  Natural Lang   │    │   Processing    │    │   Weather Data   │
└─────────────────┘    └─────────────────┘    └─────────────────┘

🔧 个性化服务设置

天气API设置

目的: REST API 提供来自 Open-Meteo 的天气数据

快速入门:

cd weather-api
npm install
npm start

特点:

  • 当前天气及预报
  • 无需API密钥
  • Swagger 文档位于 http://localhost:3000/docs

见: weather-api/README.md(文件说明) 以获取详细文档

天气MCP服务器设置

目的: 具有多个接口的模型上下文协议服务器

快速入门:

cd weather-mcp
npm install
npm run http  # HTTP API
# OR
npm start  # MCP server for Claude Desktop
# OR
npm run cli  # CLI tool

特点:

  • HTTP API接口
  • 用于命令行使用的CLI工具
  • 为Claude Desktop进行MCP集成

见: weather-mcp/README.md(可译为:天气-MCP/README.md文件,或根据上下文简化为“天气模块/README.md”) 用于详细文档说明

BlockNote 用户界面设置

目的: 集成Claude AI的React用户界面,支持自然语言天气查询

快速入门:

cd blocknoteUI
npm install
# Configure .env with your Anthropic API key
npm run proxy  # Start Claude proxy server
npm run dev    # Start React UI

特点:

  • 自然语言天气查询
  • Claude AI集成
  • 带有BlockNote的富文本编辑器
  • 漂亮的天气格式

见: blocknoteUI/README.md(注:此文件名通常表示一个名为“blocknoteUI”的项目中的“README”文件,其内容为说明或指南,但文件名本身在中文中不直接翻译,保持原样) 用于详细文档说明

🎯 使用示例

自然语言查询

当前天气:

  • “华盛顿特区的天气怎么样?”
  • “邮编10001那里的天气怎么样?”
  • “伦敦的温度是多少?”

预测:

  • “给我东京接下来5天的天气预报”
  • “本周纽约的天气预报怎么样?”
  • “给我看看巴黎接下来3天的天气”

比较:

  • “比较纽约和洛杉矶的天气”
  • “迈阿密和西雅图哪个城市更暖和?”

API终端节点

天气API:

# Current weather
curl "http://localhost:3000/api/weather/current?city=New York&units=metric"

# Forecast
curl "http://localhost:3000/api/weather/forecast?city=London&days=5&units=metric"

# Weather alerts
curl "http://localhost:3000/api/weather/alerts?city=Miami"

天气MCP HTTP API:

# Current weather
curl "http://localhost:3001/api/current?location=New York&units=metric"

# Forecast
curl "http://localhost:3001/api/forecast?location=London&days=5&units=metric"

# Weather alerts
curl "http://localhost:3001/api/alerts?location=Miami"

🔍 故障排除

常见问题

无法连接到天气API

  • 确保天气API在3000端口上运行
  • 检查所有服务是否按正确的顺序启动
  • 验证环境变量是否设置正确

2. “Claude AI无响应”

  • 请检查您的Anthropic API密钥是否有效
  • 确保Claude代理服务器正在端口3003上运行
  • 检查浏览器控制台中的CORS错误

3. “未找到位置”

  • 尝试不同的位置格式(城市名、邮政编码、坐标)
  • 对于国际位置,请尝试添加国家代码
  • 确保位置存在且拼写正确

4. 端口冲突

  • 天气API:端口3000
  • 天气MCP HTTP:端口3001
  • Claude 代理:端口 3003
  • BlockNote UI:端口 3002(Vite 开发服务器)

服务健康检查

检查所有服务是否正在运行:

# Weather API
curl http://localhost:3000/api/weather/health

# Weather MCP HTTP Server
curl http://localhost:3001/api/weather-health

# Claude Proxy Server
curl http://localhost:3003/health

🛠️ 开发

项目结构

weather/
├── weather-api/           # REST API for weather data
│   ├── src/
│   │   ├── services/     # Weather service implementation
│   │   ├── routes/       # API route handlers
│   │   └── index.js      # Main application
│   ├── package.json
│   └── README.md
├── weather-mcp/          # MCP server with multiple interfaces
│   ├── src/
│   │   ├── services/     # Weather API client
│   │   ├── index.js      # MCP server
│   │   ├── http-server.js # HTTP API server
│   │   └── cli.js        # Command line interface
│   ├── package.json
│   └── README.md
├── blocknoteUI/          # React UI with Claude AI
│   ├── src/
│   │   ├── services/     # API integration services
│   │   ├── components/   # React components
│   │   ├── AppClaude.jsx # Main Claude AI app
│   │   └── claude-proxy-server.js # Claude proxy server
│   ├── package.json
│   └── README.md
└── README.md             # This file

开发脚本

天气API:

cd weather-api
npm run dev  # Development with auto-restart
npm test     # Run tests

天气管理面板(或天气控制面板,根据具体上下文可能有所不同)

cd weather-mcp
npm run http-dev   # HTTP API with auto-restart

BlockNote 用户界面:

cd blocknoteUI
npm run dev        # React dev server
npm run proxy-dev  # Claude proxy with auto-restart
npm run build      # Production build

📝 配置

环境变量摘要

天气API (weather-api/.env):

WEATHER_BASE_URL=https://api.open-meteo.com/v1
PORT=3000
NODE_ENV=development

天气气象控制面板(Weather MCP) (weather-mcp/.env):

WEATHER_API_URL=http://localhost:3000
WEATHER_API_TIMEOUT=10000
HTTP_PORT=3002
MCP_SERVER_NAME=weather-mcp
MCP_SERVER_VERSION=1.0.0

BlockNote 用户界面 (blocknoteUI/.env):

# Frontend
VITE_WEATHER_API_URL=http://localhost:3002
VITE_ANTHROPIC_API_KEY=your_anthropic_api_key
VITE_CLAUDE_PROXY_URL=http://localhost:3003
VITE_DEV_MODE=true

# Backend (Claude Proxy)
ANTHROPIC_API_KEY=your_anthropic_api_key
WEATHER_API_URL=http://localhost:3001
CLAUDE_PROXY_PORT=3003

🚀 部署

生产构建

天气API:

cd weather-api
npm start

天气监控面板(或天气管理控制面板,具体根据上下文确定MCP的含义)

cd weather-mcp
npm run http  # HTTP API mode

BlockNote 用户界面:

cd blocknoteUI
npm run build
npm run preview

Docker 支持(可选)

每个服务都可以容器化:

# Example Dockerfile for Weather API
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

📊 API文档

天气API端点

  • 当前天气: GET /api/weather/current
  • 天气预报: GET /api/weather/forecast
  • 天气预警: GET /api/weather/alerts
  • 健康检查: GET /api/weather/health
  • API文档: http://localhost:3000/docs

天气MCP HTTP终端点

  • 当前天气: GET /api/current
  • 天气预报: GET /api/forecast
  • 天气预警: GET /api/alerts
  • 健康检查: GET /api/weather-health

Claude AI集成

  • 天气查询: POST /api/claude/weather
  • 自然语言处理: Claude AI能够理解天气相关问题
  • 工具集成: 天气API工具,Claude可使用

🤝 贡献

  1. 为仓库创建分支(或“克隆仓库”)
  2. 创建一个特性分支
  3. 进行你的更改
  4. 与所有服务进行全面测试
  5. 提交一个拉取请求

📞 支持

对于问题和疑问:

  1. 查看上面的故障排除部分
  2. 查看各个服务的README文件
  3. 确保所有服务均正常运行
  4. 检查浏览器控制台中的错误
  5. 验证环境变量是否设置正确

特定服务的文档:

📄 许可证

麻省理工学院许可证

🔗 仓库

注: 替换 YOUR_USERNAME 使用您实际的GitHub用户名。

🎯 快速参考

启动所有服务:

# Terminal 1
cd weather-api && npm start

# Terminal 2  
cd weather-mcp && npm run http

# Terminal 3
cd blocknoteUI && npm run proxy

# Terminal 4
cd blocknoteUI && npm run dev

接入点:

  • BlockNote 用户界面: http://localhost:3002
  • 天气API文档: http://localhost:3000/docs
  • 天气MCP HTTP: http://localhost:3001

测试查询:

  • “纽约的天气怎么样?”
  • “给我一份伦敦5天的天气预报”
  • “比较迈阿密和西雅图的天气”

目录标签

目录标签

位置天气自然语言处理JavaScriptClaudeAPI集成天气查询本地部署AI集成RESTAPIReactUI

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明api-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP