天气查询工具

一个通过GitHub Copilot集成在VSCode中使用的天气查询工具,可获取任何城市的天气信息。

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

使用说明

主控程序

安装依赖项:

bun i

在本地运行检查器:

bunx -y @modelcontextprotocol/inspector bunx -y tsx index.ts

您还可以在VSCode聊天中使用GitHub Copilot。要设置它,请将以下配置添加到您的 .vscode/settings.json 文件:

{
  "mcp": {
    "servers": {
      "weather": {
        "command": "bunx",
        "args": [
          "-y",
          "tsx",
          "<PATH_TO_YOUR_INDEX.TS_FILE>"
        ]
      }
    }
  }
}

在聊天面板中,将模式设置为 Agent 并选择 weather 从工具下拉菜单中选择服务器。

一旦完成,您就可以使用 fetch-weather 该工具可向GitHub Copilot查询任何城市的天气。