Skip to main content
Glama
EternityG2

weather-mcp-server

by EternityG2

Weather MCP Server

一个基于官方 MCP Python SDK FastMCP 的天气查询 MCP 服务器。服务通过 wttr.in 获取实时天气数据,支持中文城市名映射,也支持直接传入英文城市名。

功能

  • get_weather(city: str): 查询指定城市当前天气。

  • list_supported_cities(): 列出内置支持的中文城市。

  • get_server_info(): 查看服务器名称、版本、工具列表和数据来源。

Related MCP server: AMap Weather MCP

环境要求

  • Python 3.10+

  • 可访问 https://wttr.in

本地运行

pip install -r requirements.txt
python server.py

服务器默认使用 stdio transport,适合由支持 MCP 的客户端以子进程方式启动。容器环境默认使用 streamable-http transport,监听 0.0.0.0:8000

MCP 客户端配置示例

{
  "mcpServers": {
    "weather": {
      "command": "python",
      "args": ["/absolute/path/to/weather_mcp_server/server.py"]
    }
  }
}

Docker 运行

docker build -t weather-mcp-server .
docker run --rm -i weather-mcp-server

如需在本地用 HTTP transport 运行:

MCP_TRANSPORT=streamable-http MCP_HOST=0.0.0.0 PORT=8000 python server.py

发布到 Smithery

本目录已经包含 Smithery 所需的 smithery.yaml 和推荐的 Dockerfile。如果你的 GitHub 仓库根目录不是本目录,请在 Smithery 的 GitHub integration 设置里将 base directory 配置为:

weather_mcp_server

然后在 Smithery 中触发部署即可。

数据来源

天气数据来自 wttr.in。请注意第三方服务的可用性、限流策略和数据准确性可能会变化。

License

MIT

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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/EternityG2/weather-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server