Skip to main content

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 本地测试连接

待用户定的事(点头后才做)

  1. 内容就是天气 + 黄历(已按 2026-11-21 14:26 的建议定);热搜放第二步。
  2. 用 qiyuhudong@muse.ai 注册魔塔(验证码发到该邮箱,Muse 自己收)。
  3. 代码发 PyPI → 魔塔广场创建 MCP → 平台托管出一条 SSE 地址 → CanPhone 设置 → 外部工具(MCP)里填地址实测。
  4. 名字、要不要开源到 GitHub,做到那一步再问。

注意:托管地址是每人专属的,不能写进笔记公开,用户得各自在魔塔点「连接」拿自己的地址。

Metadata

Release files for canphone-weather-almanac 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for canphone-weather-almanac 0.1.1
File Size Uploaded Provenance Actions
canphone_weather_almanac-0.1.1.tar.gz 5.1 kB Without provenance Details for canphone_weather_almanac-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for canphone-weather-almanac 0.1.1
File Interpreter ABI Platform Actions
canphone_weather_almanac-0.1.1-py3-none-any.whl Python 3 none any Details for canphone_weather_almanac-0.1.1-py3-none-any.whl

Total release size: 10.7 kB

Release files / canphone_weather_almanac-0.1.1.tar.gz

Download URL canphone_weather_almanac-0.1.1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
608a8c335348b34181b03fa322b87c2b396291f7504b69e61786a9351acff560
BLAKE2b-256 checksum
How to use checksums
78d0e19cda270eb1ed43822d5e596dc660b7b84a599068b8a625eaa566b222ba
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.1-py3-none-any.whl

Download URL canphone_weather_almanac-0.1.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd6b15c22819a07fa5dea048a287d04e98c1cacd8c68856a2860f4646da6183c
BLAKE2b-256 checksum
How to use checksums
626c569b940ff40e849911f79006ab8b31db657a08812f9136c9e3b2742f00f3
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.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page