WeatherXM PRO MCP 服务器实现了 WeatherXM PRO API 作为 MCP 工具,允许客户端通过 MCP 协议访问天气站数据、观测和预报,为用户提供便捷的天气信息服务。
将仓库克隆到本地机器:
git clone https://github.com/WeatherXM/weatherxm-pro-mcp.git
克隆仓库后,需要安装依赖项并构建项目才能运行 MCP 服务器:
npm install
npm run build
这是 MCP 客户端(如 Claude Desktop、Cursor、Windsurf Editor、VSCode 以及 RooCode 和 Cline 等插件)常用的配置:
{
"mcpServers": {
"weatherxm-pro": {
"command": "npx",
"args": [
"-y",
"path to mcp"
],
"env": {
"WEATHERXMPRO_API_KEY": "your-api-key"
}
}
}
}
将"path to mcp"替换为实际的 MCP 服务器路径或包名称,将"your-api-key"替换为您自己的 WeatherXM PRO API 密钥。
⚠️ 重要提示
如果您已经在使用其他 MCP 服务器,则可以在现有的
mcpServers对象中添加。
按照以下步骤在 Claude Desktop MCP 客户端中使用 WeatherXM PRO MCP 服务器:
~/Library/Application Support/Claude/claude_desktop.json的配置文件。mcpServers部分添加或修改weatherxm-pro条目,参考上述 JSON 配置。在 Cursor 中进行如下设置:
npm install weatherxm-pro-mcp --save-dev
package.json中的脚本部分,添加启动命令:"scripts": {
"mcp-server": "weatherxm-pro-mcp start"
}
npm run mcp-server
按照以下步骤配置 Windsurf Editor:
weatherxm-proMCP Serverhttp://localhost:3000(假设端口为 3000)在 VSCode 中进行以下配置:
mcp.servers,找到相关设置项。weatherxm-proMCP Serverhttp://localhost:3000要使用 Docker 运行 MCP 服务器,执行以下命令:
docker build -t weatherxm-pro-mcp .
docker run -p 3000:3000 --env WEATHERXMPRO_API_KEY=your_api_key weatherxm-pro-mcp
WEATHERXMPRO_API_KEY已正确设置。npm install。MIT License
Copyright (c) 2023 WeatherXM PRO
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.