weather-mcp-server
A weather query MCP server based on FastMCP, supporting Chinese city names and fetching real-time weather data from wttr.in.
README
Weather MCP Server
一个基于官方 MCP Python SDK FastMCP 的天气查询 MCP 服务器。服务通过 wttr.in 获取实时天气数据,支持中文城市名映射,也支持直接传入英文城市名。
功能
get_weather(city: str): 查询指定城市当前天气。list_supported_cities(): 列出内置支持的中文城市。get_server_info(): 查看服务器名称、版本、工具列表和数据来源。
环境要求
- 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.