MCP Boilterplate Service

MCP Boilterplate Service

site icon
2025.03.15 0
Python天气服务AI 集成其它
MCP-Boilerplate 是一个基于 MCP(Model Context Protocol)的现代 AI 天气应用,通过 OpenRouter 实现与大型语言模型的无缝工具集成。该项目展示了客户端-服务器架构,包括 MCP 客户端和天气服务。
View on GitHub

Overview

基本能力

产品定位

MCP-Boilerplate 是一个基于 MCP 的现代 AI 天气应用,通过 OpenRouter 实现与大型语言模型的无缝工具集成。

核心功能

  • 通过 OpenRouter 连接 Claude 3 与外部天气数据工具
  • 通过国家气象服务 API 提供实时美国天气警报和预报
  • 工具增强模式,包含完整的对话上下文
  • 轻松集成任何 OpenAI 兼容的 API

适用场景

  • 需要实时天气数据的 AI 应用
  • 需要与大型语言模型集成的天气服务
  • 需要工具增强模式的对话系统

工具列表

  • MCP Client: 通过 OpenRouter 连接 LLMs,处理对话流和工具执行
  • Weather Service: 暴露天气数据工具的 MCP 服务器,可被任何 AI 模型调用

常见问题解答

  • 无具体常见问题解答内容

使用教程

使用依赖

  • Python 3.11+
  • OpenRouter API key

安装教程

  1. 克隆仓库
  2. 设置环境(每个组件都有自己的环境)
# For the MCP client
cd mcp-client
cp example.env .env  # Edit to add your OpenRouter API key
uv venv
uv pip install -e .

# For the weather service
cd ../weather
uv venv
uv pip install -e .

调试方式

  1. 启动与 MCP 客户端的对话,指向天气服务
cd mcp-client
python client.py ../weather/weather.py
  1. 询问天气预报或警报
  2. "What's the weather forecast for New York City? Lat/Long is 40.7128, -74.0060"
  3. "Are there any weather alerts in California? The state code is CA"

许可证

该项目遵循 MIT 开源许可条款。