使用说明
天气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服务器应该显示可用的工具