Python MCP workflow tools for host-controlled planning workflows
Project description
Ymcp
Trae / 通用 LLM 宿主可用的 MCP 工具包,提供 ydeep、yplan、ydo 等 workflow tools,以及基于 MemPalace 的长期记忆能力。
核心模型
- tool 负责轻 gate:阶段入口、统一 handoff、Elicitation 选项、必要时产出最终交接 artifact
- skill 负责思考:具体推理过程由 LLM 自主完成
- LLM 自主循环:Ymcp 不维护重型服务端状态机,只提供关键流转约束
- 规划阶段显式回灌总结:
yplan通过 phase 参数记录 planner / architect / critic 的可审计总结,不暴露内部思考 - handoff.options 更接近菜单项:重点是
value、title、description、recommended
当前 workflow tools
ydeep- 对应 prompt:
deep-interview - 输入核心:
brief - 输出核心:
skill_content、统一handoff - 完成澄清并输出总结后调用统一
menu
- 对应 prompt:
yplan- 对应 prompt:
plan/planner - 输入核心:
task、可选phase、planner_summary、architect_summary、critic_verdict、critic_summary - 输出核心:
skill_content、统一handoff - planner / architect / critic 是
yplan内部阶段,不再作为公开 MCP tools 暴露 phase=start返回完整planskill;后续阶段必须显式回传对应总结,Critic 只接受APPROVE/ITERATE/REJECT- 完成规划、架构审视、critic 验收并输出总结后调用统一
menu
- 对应 prompt:
ydo- 对应 prompt:
ralph - 输入核心:无业务输入(依赖当前调用链上下文)
- 输出核心:
skill_content、统一handoff - 完成执行与验证并输出总结后调用统一
menu
- 对应 prompt:
menu- 唯一公开流程菜单 tool
- 输入核心:
source_workflow、summary、options、可选selected_option - 优先使用 MCP Elicitation;失败时提供本地 WebUI fallback 交互选择
Handoff contract
handoff.options是下一步动作的唯一权威源- tool 只声明“有哪些下一步选项”,不声明自动参数映射协议
- 推荐宿主按固定约定串联阶段,而不是让 LLM 或 tool 维护复杂路由协议
menu的options由当前 workflow skill 在完成任务并输出总结后作为参数传入recommended_next_action只是推荐,不代表授权自动执行;必须先完成用户选择
设计边界
- MCP tool 提供结构化阶段边界与下一步选项
- LLM 先完整思考与输出,再调用统一
menu进入 next-step 选择 menu必须优先通过 Elicitation 向用户展示菜单- 若当前宿主不支持 MCP Elicitation,或 Elicitation 调用失败、取消、拒绝或返回非法选项,
menu返回blocked并提供meta.ui_request.webui_url,由本地 WebUI 渲染真实可交互选项 - WebUI fallback 默认绑定
127.0.0.1,使用随机 token;只允许查看当前 menu session 与提交合法 option value,不提供命令执行能力 - 宿主菜单不要求逐字多行还原 description,但必须保留每个选项的
value/title/recommended;description可作为详情、tooltip 或辅助文本呈现 host_controls仅表达当前返回实际依赖的宿主能力status表示当前 tool 调用结果;meta.required_host_action只表达宿主当前是“继续思考”还是“展示并收口”handoff.options是下一步动作的唯一权威源;allowed_next_actions仅为派生兼容视图handoff.options应被视为服务端给出的菜单,而不是让 LLM 自己构造的路由对象menu的workflow_state会显式表达 handoff 状态流转,例如ready_for_handoff、elicitation_requested、awaiting_user_selection、selection_confirmed
安装
pip install ymcp
更新
pip install -U ymcp
一键初始化 Trae 与默认记忆库
ymcp init-trae
本地图像 / 视频帧工具
安装可选 Pillow 支持后可使用本地帧处理命令;视频抽帧还需要系统可执行的 ffmpeg / ffprobe。
pip install "ymcp[imagegen]"
ymcp v2f 12 input.mp4 --seconds 1-2 --size 256 --out output/frames
ymcp v2f 8 input.mp4 --seconds 2 --size full
ymcp v2f 12 input.mp4 --columns 6
--seconds 2 表示使用 0-2 秒,--seconds 1-2 表示使用 1-2 秒;--size 默认 256,full 保留原视频分辨率,也支持 320x180。该命令不会保留中间采样 PNG,默认在当前目录下的 video_frames 输出目录生成 framesheet.png 和 animation.webp。framesheet 默认尽量接近方形,例如 24 帧为 4x6、20 帧为 4x5,可用 --columns 覆盖列数。默认会用第一帧中出现最多的颜色作为背景色,并在所有帧中复用该颜色扣除背景;如需保留背景可传 --keep-bg。v2f 默认还会从画面中心按半径添加透明淡出,减少边缘裁剪截断感;--fade 80 表示中心 80% 半径保持不透明后线性淡出,--fade 80-2 可调整衰减速度。
本地 v2f 网页编辑器
ymcp v2f-ui 会启动一个本机单用户网页编辑器,默认只监听 127.0.0.1,用于反复调参预览,而不是多用户服务、批量任务或云端部署。
ymcp v2f-ui
ymcp v2f-ui --port 8765 --no-open
编辑器把流程拆成两层:视频抽帧只在视频来源、采样时间段、帧数或解码尺寸变化时执行;背景扣除、透明淡出、裁剪/缩放、Timing Map 节奏曲线、预览和导出会复用当前 session 中缓存的帧。除了视频输入,编辑器也支持从已有 framesheet + grid 创建 session,再进入同一套视觉处理、节奏编辑和 framesheet.png / animation.webp 导出流程。
Timing Map 使用单调关键点曲线把输出动画进度映射到源帧进度,可用于“蓄力趋静止 → 爆发加速 → 回落”的节奏。v1 导出采用确定性的 nearest-frame 选择,不做光流或中间帧合成。
记忆
回答历史事实前先查 mempalace_search / mempalace_get_drawer;任务完成后把稳定偏好、项目约定、重要决策和踩坑结论写入 mempalace_add_drawer 或 mempalace_diary_write。
Project details
Release history Release notifications | RSS feed
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 ymcp-0.4.3.tar.gz.
File metadata
- Download URL: ymcp-0.4.3.tar.gz
- Upload date:
- Size: 118.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
529acdae5b79be62d65ce8995da0b8fcd7bc3b3fda29a67db5124efcd071f052
|
|
| MD5 |
edada778e9685205929e623915384a10
|
|
| BLAKE2b-256 |
05c83f6058ccc8ea993f612614d9e21f54523f0b69d88550aabf466cee542f02
|
Provenance
The following attestation bundles were made for ymcp-0.4.3.tar.gz:
Publisher:
release.yml on CodeyLife/Ymcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ymcp-0.4.3.tar.gz -
Subject digest:
529acdae5b79be62d65ce8995da0b8fcd7bc3b3fda29a67db5124efcd071f052 - Sigstore transparency entry: 1417375479
- Sigstore integration time:
-
Permalink:
CodeyLife/Ymcp@ad4f952015f87c49cb7e13a6391221f6addd951a -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/CodeyLife
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ad4f952015f87c49cb7e13a6391221f6addd951a -
Trigger Event:
release
-
Statement type:
File details
Details for the file ymcp-0.4.3-py3-none-any.whl.
File metadata
- Download URL: ymcp-0.4.3-py3-none-any.whl
- Upload date:
- Size: 120.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4b5b42b751ade9abaff60735097053c5fd36b33c248ac28920a4cbf92132c2d
|
|
| MD5 |
454f652e272efc27870587696a21f030
|
|
| BLAKE2b-256 |
8ac2e871075f6526e82de768016506b44467c428b8d4d89b0c1e0af33e1128b2
|
Provenance
The following attestation bundles were made for ymcp-0.4.3-py3-none-any.whl:
Publisher:
release.yml on CodeyLife/Ymcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ymcp-0.4.3-py3-none-any.whl -
Subject digest:
a4b5b42b751ade9abaff60735097053c5fd36b33c248ac28920a4cbf92132c2d - Sigstore transparency entry: 1417375494
- Sigstore integration time:
-
Permalink:
CodeyLife/Ymcp@ad4f952015f87c49cb7e13a6391221f6addd951a -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/CodeyLife
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ad4f952015f87c49cb7e13a6391221f6addd951a -
Trigger Event:
release
-
Statement type: