Python MCP workflow tools for host-controlled planning workflows
Project description
Ymcp
Trae MCP工具包 提供工作流以及mempalace的长记忆存储
安装与更新
pip install ymcp
pip install -U ymcp
本地开发安装:
python -m pip install -e .[dev]
安装后建议检查:
ymcp doctor
ymcp --version
ymcp inspect-tools --json
ymcp inspect-resources --json
ymcp inspect-prompts --json
ymcp inspect-capabilities --json
一键初始化 Trae 与默认记忆库:
ymcp init-trae
init-trae 会检查 ~/.yjj。如果该目录不存在,会自动初始化 MemPalace,并把 ~/.yjj 配置为 Ymcp 的默认记忆库目录。
FastMCP 第一原则
Ymcp 的第一原则是:所有能力优先按 FastMCP / MCP 官方三原语组织,而不是只提供 tools-only 接口:
- Tools:执行动作、查询外部系统、产生结构化结果。
- Resources:暴露可读取上下文、项目原则、规则模板、工具参考、记忆协议。
- Prompts:暴露可复用调用模板和标准工作流提示;Prompt 不直接执行工具,也不伪造工具结果。
- Elicitation:当 Tool 执行中需要用户输入/选择时,优先使用 MCP 官方 Elicitation;不支持时返回标准
needs_input/blocked结构化降级结果。
标准 Resources:
resource://ymcp/principlesresource://ymcp/tool-referenceresource://ymcp/memory-protocolresource://ymcp/project-rule-templateresource://ymcp/host-integration
标准 Prompts:
deep_interview_clarifyplan_directralplan_consensusralplan_planner_passralplan_architect_passralplan_critic_passralph_verifymemory_store_after_completion
禁止用自定义宿主协议替代 MCP 原语;禁止把文档型上下文只放在 Markdown 中而不暴露为 Resource;禁止把可复用提示只写在文档中而不暴露为 Prompt。
记忆工具
Ymcp 依赖 mempalace 提供长期记忆能力,默认使用 ~/.yjj 作为 MemPalace 记忆库目录,并写入全局个人记忆空间:wing="personal"、room="ymcp"。
当前实现已统一为单一路径:
- Ymcp 只通过
python -m mempalace.mcp_server调用 MemPalace - Ymcp 不再直接导入或调用 MemPalace 的进程内 Python 实现
- 所有记忆读写、检索、图谱与 diary 能力都统一经过这条 MCP 调用链
Memory Protocol:回答人物、项目、历史事件或过往决策前先查 mempalace_search / mempalace_get_drawer,不要凭印象猜;任务结束后把稳定偏好、项目约定、重要决策和踩坑结论写入 mempalace_add_drawer 或 mempalace_diary_write;事实变化时用更新、删除或 KG 失效工具维护旧记忆。
常用工具:
mempalace_add_drawer:保存一条长期记忆mempalace_search:搜索长期记忆mempalace_get_drawer/mempalace_update_drawer/mempalace_delete_drawer:读取、更新、删除指定记忆mempalace_status/mempalace_list_wings/mempalace_list_rooms/mempalace_get_taxonomy:查看记忆空间状态mempalace_kg_*、mempalace_graph_*、mempalace_*tunnel*、mempalace_diary_*:通过 MemPalace MCP 服务暴露图谱、关系和日记能力
记忆写入是持久化副作用。请不要保存密钥、隐私或未经确认的敏感信息。
Trae 中常用记忆 prompt
调用 Ymcp 的 mempalace_search,搜索:“当前项目的发布流程”。请只总结与当前任务相关的记忆。
调用 Ymcp 的 mempalace_add_drawer,保存这条长期项目约定:“Ymcp 的文档和用户回复都使用中文,代码接口名保持英文。”
更多示例见 docs/trae-integration.md。
Trae Workflow 最佳调用链
推荐链路:deep_interview → ralplan → ralph → mempalace_add_drawer。
- 需求不清晰:先调用
deep_interview,按next_question多轮澄清。 - 需要共识规划:调用
ralplan,按planner_draft → architect_review → critic_review推进。 - 执行验证:调用
ralph,根据stop_continue_judgement继续、修复或完成。 - 完成沉淀:调用
mempalace_search查重,再用mempalace_add_drawer保存稳定经验。
完整 prompt 模板见 docs/trae-integration.md。
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.2.2.tar.gz.
File metadata
- Download URL: ymcp-0.2.2.tar.gz
- Upload date:
- Size: 52.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c8192719e5ac2ed8d1e0e7e217fe0c38257114afed4acd0585b58c9c6694d4c
|
|
| MD5 |
c7f477f92b2b8fa696db55152d79f2a6
|
|
| BLAKE2b-256 |
b774fe850fbc2db81585013aef6e53baa75b1cc202476fc8d276550f60beb3e7
|
Provenance
The following attestation bundles were made for ymcp-0.2.2.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.2.2.tar.gz -
Subject digest:
3c8192719e5ac2ed8d1e0e7e217fe0c38257114afed4acd0585b58c9c6694d4c - Sigstore transparency entry: 1367643412
- Sigstore integration time:
-
Permalink:
CodeyLife/Ymcp@0eeb53873224877f50a860aa0a71e673022c3c23 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/CodeyLife
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0eeb53873224877f50a860aa0a71e673022c3c23 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ymcp-0.2.2-py3-none-any.whl.
File metadata
- Download URL: ymcp-0.2.2-py3-none-any.whl
- Upload date:
- Size: 48.3 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 |
94071ec57f96c6c7f8d341498cce5221a2a7d1a564ec15201109e7a07fac1187
|
|
| MD5 |
07653e1d89be2a093ac62ad41a4fb844
|
|
| BLAKE2b-256 |
94f1ba7ed66097c835b84800a1997749516f0b13d961744a4d560301d7a8bf59
|
Provenance
The following attestation bundles were made for ymcp-0.2.2-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.2.2-py3-none-any.whl -
Subject digest:
94071ec57f96c6c7f8d341498cce5221a2a7d1a564ec15201109e7a07fac1187 - Sigstore transparency entry: 1367643439
- Sigstore integration time:
-
Permalink:
CodeyLife/Ymcp@0eeb53873224877f50a860aa0a71e673022c3c23 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/CodeyLife
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0eeb53873224877f50a860aa0a71e673022c3c23 -
Trigger Event:
release
-
Statement type: