
天气查询服务
test mcp
Installation
Installing for Claude Desktop
Manual Configuration Required
This MCP server requires manual configuration. Run the command below to open your configuration file:
npx mcpbar@latest edit -c claude
This will open your configuration file where you can add the 天气查询服务 MCP server manually.
天气查询 MCP 服务
这是一个简单的天气查询MCP(Model Completion Plugin)服务,可以让你通过Cursor AI助手查询全球城市的天气状况。
准备工作
-
注册并获取OpenWeatherMap API密钥:
- 访问 OpenWeatherMap 网站
- 注册一个免费账户
- 获取API密钥
-
配置环境变量:
- 在项目根目录中找到
.env
文件 - 将你的API密钥填入
OPENWEATHER_API_KEY=your_api_key_here
- 在项目根目录中找到
本地运行
- 安装依赖:
npm install
- 启动服务:
npm start
或者使用开发模式(自动重启):
npm run dev
- 服务将在 http://localhost:3001 上运行
- MCP清单: http://localhost:3001/mcp-manifest.json
- OpenAPI规范: http://localhost:3001/openapi.json
部署到公网
为了让Cursor能够使用这个MCP服务,你需要将其部署到公网可访问的地址。以下是几种简单的方法:
使用ngrok进行临时公开(开发测试用)
-
安装ngrok:
- 访问 ngrok.com 注册并下载
- 按照官方指南设置ngrok
-
在本地启动你的服务:
npm start
- 在另一个终端窗口启动ngrok:
ngrok http 3001
- ngrok会提供一个公开URL(例如
https://abc123.ngrok.io
)- 使用这个URL来配置Cursor中的MCP服务
部署到Render.com(免费方案)
-
注册 Render.com 账户
-
创建新的Web服务:
- 连接你的GitHub仓库
- 设置构建命令:
npm install
- 设置启动命令:
npm start
- 添加环境变量:
OPENWEATHER_API_KEY
-
部署完成后,Render会提供一个类似于
https://your-service-name.onrender.com
的URL- 使用这个URL来配置Cursor中的MCP服务
在Cursor中配置MCP服务
- 打开Cursor编辑器
- 点击设置图标
- 选择"MCP服务"
- 点击"添加MCP服务"
- 输入你的MCP清单URL(例如
https://your-service.onrender.com/mcp-manifest.json
) - 保存设置
现在你可以通过Cursor AI助手查询天气了,例如:
- "北京今天的天气怎么样?"
- "查询上海的气温"
- "纽约现在的天气状况"
API使用
如果你想直接调用API,可以使用以下端点:
GET /weather?city={城市名}
示例响应:
{
"city": "北京",
"temperature": 25.6,
"description": "晴",
"humidity": 45,
"wind_speed": 5.7
}
许可证
MIT
Details:
Stars
1Forks
0Last commit
3 months agoRepository age
3 months
Auto-fetched from GitHub .
MCP servers similar to 天气查询服务:

Stars
Forks
Last commit

Stars
Forks
Last commit

Stars
Forks
Last commit