镜像地球气象数据的官方 MCP Python 服务。
Project description
Mirror Earth MCP
mirror-earth-mcp 是镜像地球气象数据的 Python Model Context Protocol(MCP)服务,基于官方 MCP SDK 实现,提供天气查询、模型与要素目录、地名解析、本地 Markdown 参考资料和批量导出任务管理能力。
使用要求
- Python 3.10 或更高版本
- uv
- 使用需要认证的天气查询和批量导出工具时,需提供 Mirror Earth API Key。请前往镜像地球开放平台个人中心获取。
geocode 和 reverse_geocode 使用公开地名服务,不需要 API Key。
安装与启动
通过 uvx 直接运行 PyPI 中发布的包:
uvx --from mirror-earth-mcp mirror-earth-mcp
在 MCP 客户端的环境变量中设置 MIRROR_EARTH_API_KEY。API Key 可在镜像地球开放平台个人中心获取。服务使用 stdio 传输,只会向标准输出写入 JSON-RPC 响应。
MCP 配置
{
"mcpServers": {
"mirror-earth": {
"command": "uvx",
"args": ["--from", "mirror-earth-mcp", "mirror-earth-mcp"],
"env": {
"MIRROR_EARTH_API_KEY": "YOUR_MIRROR_EARTH_API_KEY"
}
}
}
}
在 Codex CLI 中添加服务:
codex mcp add mirror-earth --env MIRROR_EARTH_API_KEY=YOUR_MIRROR_EARTH_API_KEY -- uvx --from mirror-earth-mcp mirror-earth-mcp
MCP 工具
| 工具 | 用途 |
|---|---|
list_models |
列出实时预报、历史再分析和历史预报模型。 |
get_model_details |
查询模型元数据、支持的要素与等压面。 |
list_variables |
列出逐小时、逐日或逐月要素。 |
get_forecast |
按经纬度查询天气预报。 |
get_historical_weather |
查询 ERA5 历史天气数据。 |
get_archive_forecast |
查询历史模型起报的预报数据。 |
get_seamless_weather |
查询连续的 ERA5 与 ECMWF 天气数据。 |
geocode / reverse_geocode |
解析地名与经纬度。 |
get_batch_usage |
查询批量导出配额和使用情况。 |
estimate_batch_export / create_batch_export |
预估并创建批量导出任务。 |
get_batch_task / list_batch_tasks / cancel_batch_task |
管理批量导出任务。 |
服务还通过 mirror-earth://references/... MCP 资源公开内置的 API 和模型说明文档。
本地开发
uv sync
uv run pytest
uv build
构建产物输出到 dist/。发布新版本时,将 PyPI token 配置到 UV_PUBLISH_TOKEN 环境变量后执行:
uv publish
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mirror_earth_mcp-0.3.0.tar.gz.
File metadata
- Download URL: mirror_earth_mcp-0.3.0.tar.gz
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
562255acd3cdc33c10991c1c40c51c74096170e75eeb002b268d99d8520785a6
|
|
| MD5 |
0bc4ffe46471c747ea3a9fb12ef8a8a5
|
|
| BLAKE2b-256 |
d66d0a8b394bab0939979edbd7179f139295cd9888a503aebfe43c1835e404b3
|
File details
Details for the file mirror_earth_mcp-0.3.0-py3-none-any.whl.
File metadata
- Download URL: mirror_earth_mcp-0.3.0-py3-none-any.whl
- Upload date:
- Size: 71.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7eb2a4602ce748a7ba997c8c82a27ea1dde2296ca812af87e1316a3d7c4a798e
|
|
| MD5 |
29e6c88e7e5f0e177f4ee8d75671c84c
|
|
| BLAKE2b-256 |
77bbdd6aeee9d4e3ac17baea7b294ab65850ada85ab774b41c00004ffb8840a3
|