天气数据服务

一个基于MCP协议的天气数据获取服务,通过Open Weather API提供实时天气信息。

  • by ryands17
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 ryands17/weather-mcp

使用说明

天气mcp

要安装依赖项,请执行以下操作:

bun install

要运行:

bun run index.ts

这是一个 主控程序 用于使用 开放天气API这是一个学习如何配置和使用MCP服务器的简单示例。

要为Claude Code或Gemini CLI配置此功能,请在其配置中添加以下内容:

{
  "mcpServers": {
    "weather": {
      "command": "bun",
      "args": ["run", "<path-before-this>/weather-mcp/index.ts"],
      "env": {
        "WEATHER_API_KEY": "<your-api-key>"
      }
    }
  }
}

然后列出mcp服务器应该显示可用的工具