@xjt-demo/xjt-weather-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@xjt-demo/xjt-weather-mcpwhat's the live weather in Beijing?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@xjt-demo/xjt-weather-mcp
基于 MCP 官方 Weather Server Quickstart 实现的天气 MCP Server,数据源为高德地图天气查询 API,可通过 npx 直接运行,无需本地安装。
前置条件
在 高德开放平台 注册并创建应用
申请 Web 服务 类型的 API Key
在 MCP 配置中通过环境变量
AMAP_API_KEY传入 Key
城市编码(adcode)可参考高德城市编码表,例如:
城市 | adcode |
北京东城 |
|
上海 |
|
广州 |
|
深圳 |
|
Related MCP server: amap-weather-mcp-server
MCP Tools
Tool | 说明 |
| 查询指定城市的实况天气 |
| 查询指定城市的天气预报(当天 + 未来 3 天) |
两个工具均接受 city 参数:6 位数字 adcode。
Cursor / Claude 配置
发布到 npm 后,使用者无需手动安装依赖。npx 会自动下载包及其 dependencies,然后启动 MCP Server。
{
"mcpServers": {
"xjtWeather": {
"command": "npx",
"args": ["-y", "@xjt-demo/xjt-weather-mcp"],
"env": {
"AMAP_API_KEY": "你的高德 Web 服务 Key"
}
}
}
}预发布通道:
{
"mcpServers": {
"xjtWeatherAlpha": {
"command": "npx",
"args": ["-y", "@xjt-demo/xjt-weather-mcp@alpha"],
"env": {
"AMAP_API_KEY": "你的高德 Web 服务 Key"
}
}
}
}本地开发
npm install
npm run build
AMAP_API_KEY=你的Key npm run dev本地调试配置:
{
"mcpServers": {
"xjtWeatherLocal": {
"command": "node",
"args": ["/path/to/xjt-weather-mcp/dist/server.js"],
"env": {
"AMAP_API_KEY": "你的高德 Web 服务 Key"
}
}
}
}运行集成测试前, 在.env 文件中填入 Key(.env 已被 git 忽略):
使用 MCP Inspector 调试:
AMAP_API_KEY=你的Key npx @modelcontextprotocol/inspector node dist/server.js发布到 npm
npm login
npm run build
npm publish --tag alpha # 预发布
# 或
npm publish # 稳定版prepublishOnly 会在发布前自动执行 npm run build。
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheHexaflux/xjt-weather-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server