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., "@weather_mcpWhat's the current weather in New York?"
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.
项目预览
mcp_weather_demo — 基于 uv 管理环境的 MCP (Model Context Protocol) 天气服务端,提供三种运行方式:
纯 stdio / JSON-RPC 2.0 实现(
main.py)FastMCP 官方库实现(
weather_mcp_fastmcp.py)FastMCP Streamable HTTP 传输(
weather_mcp_http.py)
通过免费天气 API 查询实时天气,以 MCP Tool 形式暴露 get_current_weather 接口。
Related MCP server: ai-mcp
项目结构
mcp-weather-demo/
├── src/
│ └── mcp_weather_demo/
│ ├── __init__.py # 包入口
│ ├── main.py # 纯 JSON-RPC / stdio 实现
│ ├── weather_mcp_fastmcp.py # FastMCP 官方库实现(stdio)
│ └── weather_mcp_http.py # FastMCP Streamable HTTP 实现
├── pyproject.toml # uv 项目元信息与依赖声明(Python >= 3.13, fastmcp, httpx)
├── uv.lock # uv 依赖锁定
├── requirements.txt # pip 依赖(可选,兼容其他环境)
├── logs/ # main.py 运行日志
└── .venv/ # uv 管理的虚拟环境技术栈
语言: Python >= 3.13(使用
dict | None联合类型语法)依赖管理: uv
HTTP 客户端: httpx
MCP 框架: fastmcp(官方库)
协议: MCP (JSON-RPC 2.0) over stdio / Streamable HTTP
Setup & Development
使用 uv 管理项目环境:
# 安装依赖并同步环境(首次运行,会自动创建 .venv)
uv sync运行方式
项目在 pyproject.toml 中声明了多个脚本入口:
# 纯 JSON-RPC / stdio 服务端(等待 stdin 的 JSON-RPC 消息)
uv run mcp-weather-stdio
# FastMCP 官方库,stdio 传输
uv run fastmcp-stdio
# FastMCP Streamable HTTP 传输,默认 http://0.0.0.0:8000/mcp
uv run fastmcp-httpMCP 协议支持
方法 | 说明 |
| 握手,返回 server capabilities |
| 客户端初始化完成通知 |
| 心跳检测 |
| 列出可用工具(get_current_weather) |
| 调用天气查询工具 |
测试方式
使用任意 MCP 客户端连接,或通过 echo/管道发送 JSON-RPC 消息测试:
# stdio 服务
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | uv run mcp-weather-stdio
# HTTP 服务
uv run fastmcp-http # 然后连接 http://0.0.0.0:8000/mcpAvailable Tools
1 toolget_current_weatherGet Current WeatherA
查询指定城市的当前天气。支持英文城市名,返回中文天气信息。
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes | 城市英文名,例如 Nanhai(南海)、Foshan(佛山) | |
| state | No | 省/州英文名,例如 Guangdong(广东) | |
| country | No | 国家英文名,例如 China |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It adds useful behavioral facts — '支持英文城市名' (English city names supported) and '返回中文天气信息' (Chinese weather output) — and '查询' implies a read-only operation. However, it does not disclose potential error conditions, units, data-source limitations, or response details beyond the existence of an output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two short sentences with zero filler: the core action comes first, followed by the two most actionable operational facts (input language and output language). Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple weather-query tool with only one required parameter, a terse description is adequate because the schema documents all parameters and an output schema exists. The only missing context is optional details like units or failure behavior, which are not essential for selecting and invoking the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and each parameter (city, state, country) is already described with examples and defaults. The tool description adds no parameter-specific semantics beyond what the schema already provides, so the baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description begins with '查询指定城市的当前天气' — a specific verb ('query') and resource ('current weather for specified city') — and adds concrete constraints (English city names, Chinese output). With no sibling tools present, there is no differentiation burden, and an agent can identify the tool's function immediately.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states a clear use context: retrieving the current weather for a specified city, with input language and output language expectations. There are no siblings or alternatives to exclude, so the lack of explicit 'when not to use' is not a meaningful gap.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.1.0- First observed
get_current_weather
TDQS
With only a single tool, there is no possibility of confusion or overlap. The purpose of get_current_weather is unambiguous.
The tool name follows a clear verb_noun pattern (get_current_weather). Even as a lone tool, it is consistent and predictable.
A weather server with only one tool is too sparse. Users would reasonably expect at least forecasts or additional conditions, so the count feels insufficient for the apparent scope.
The server only provides current weather, leaving out forecasts, historical data, or other typical weather queries. This creates a significant gap for any practical weather-related workflow.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
1Open-Meteo MCP — weather forecast + historical reanalysis + sister APIs
OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)
Hosted MCP runtime where the agent is the operator: sign up by tool call, publish your own tools.
171
Related MCP Servers
- FlicenseBqualityDmaintenanceA simple MCP server that provides a tool to fetch current weather information for cities using the Open-Meteo API, communicating through stdin/stdout.12-
- FlicenseAqualityDmaintenanceLightweight MCP server that exposes tools for system information and weather lookup, designed for agent integration via stdio.1-
- AlicenseNot gradedqualityBmaintenanceExposes weather data from the free Open-Meteo API via decorator-driven MCP tools with Zod schemas, supporting stdio and HTTP transports.28MIT
- AlicenseAqualityBmaintenanceMCP server that provides current weather for any city using Open-Meteo APIs. It exposes a single tool 'get_weather' returning temperature, humidity, wind, and other weather data.116MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/X-JS/mcp-weather-demo'
If you have feedback or need assistance with the MCP directory API, please join our Discord server