CanPhone 天气 + 黄历 MCP(本地原型)
状态:代码已写好、本地实测通过;未注册魔塔、未部署、未上架。 等用户点头后才走注册 → 发 PyPI → 魔塔广场上架 → 连进 CanPhone 实测。
工具(2 个,全部免 Key)
| 工具 | 作用 | 数据源 |
|---|---|---|
get_weather(city, days=3) |
查某城市现在 + 未来 1~7 天天气(温度、湿度、风速、降水概率) | Open-Meteo 天气 + 自带中文地名编码 |
get_almanac(date?) |
查某天黄历:农历、生肖、宜、忌、财神/喜神方位、冲煞 | lunar-python 本地历法库,无网络请求 |
实测记录(2026-11-21 17:2x,上海现场)
- 直接调用:上海 晴 11.1°C / 2026-11-21 4.7~13.3°C 降水 0%;北京 晴 4.4°C。
- 黄历:2026-11-21 = 农历二〇二六年十月十三,马年;宜 解除、出行;忌 开市、嫁娶;财神 正北,喜神 东北;冲巳、煞西。
- 真实 MCP stdio 协议端到端:
list_tools返回get_weather、get_almanac,两次call_tool均isError=False。 - 一个坑已定位:测试脚本不传环境变量时,MCP stdio 子进程拿不到代理环境变量,天气请求会报 SSL 错误;直连调用和传了环境变量的 stdio 调用都正常。魔塔托管环境是直连网络,不受此影响;代码里另加了 3 次重试。
文件
server.py— 服务端(FastMCP,mcp>=1,<2,stdio 传输)requirements.txt—mcp>=1,<2、lunar-python.venv/— 已装好依赖的虚拟环境
运行
cd ~/workspace/canphone/mcp-weather-almanac
.venv/bin/python server.py # stdio,供 MCP 客户端 / CanPhone 本地测试连接
待用户定的事(点头后才做)
- 内容就是天气 + 黄历(已按 2026-11-21 14:26 的建议定);热搜放第二步。
- 用
qiyuhudong@muse.ai注册魔塔(验证码发到该邮箱,Muse 自己收)。 - 代码发 PyPI → 魔塔广场创建 MCP → 平台托管出一条 SSE 地址 → CanPhone 设置 → 外部工具(MCP)里填地址实测。
- 名字、要不要开源到 GitHub,做到那一步再问。
注意:托管地址是每人专属的,不能写进笔记公开,用户得各自在魔塔点「连接」拿自己的地址。
Metadata
Release files for canphone-weather-almanac 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| canphone_weather_almanac-0.1.0.tar.gz | 5.0 kB | Without provenance | Details for canphone_weather_almanac-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| canphone_weather_almanac-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for canphone_weather_almanac-0.1.0-py3-none-any.whl |
Total release size: 10.5 kB
Release files / canphone_weather_almanac-0.1.0.tar.gz
| Download URL | canphone_weather_almanac-0.1.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a719b4406baac58c654210773a4173f6309ac0c4910ecd8413e04dc52a040a4
|
|
BLAKE2b-256 checksum How to use checksums |
b6db0ed07a59a1ea7b22b01fbcf531ebacd54a1da91a7f608b9cc67728375d70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / canphone_weather_almanac-0.1.0-py3-none-any.whl
| Download URL | canphone_weather_almanac-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08667debb2f54f38572cad262c4c2d2ac67344b4acce0bd359a973cc353ab0eb
|
|
BLAKE2b-256 checksum How to use checksums |
6526af7800ac0a47ee0033e882ddeba6fff0a8434b1a2146da9889af0ccad816
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for canphone-weather-almanac 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.