Borrowing it
Nothing to install: this file belongs to nana7chi/CubismExternalEditMCP. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/nana7chi/CubismExternalEditMCP/master/CLAUDE.mdgit clone --depth 1 https://github.com/nana7chi/CubismExternalEditMCPWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/nana7chi/cubismexternaleditmcp/claude-md)<a href="https://agentmods.dev/instructions/nana7chi/cubismexternaleditmcp/claude-md"><img src="https://agentmods.dev/badge/instructions/nana7chi/cubismexternaleditmcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/nana7chi/cubismexternaleditmcp/claude-md"><img src="https://agentmods.dev/badge/instructions/nana7chi/cubismexternaleditmcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02150 | $0.02150 |
| Opus 5 | $0.01075 | $0.01075 |
| Sonnet 5 | $0.00430 | $0.00430 |
| Haiku 4.5 | $0.00215 | $0.00215 |
Grade A, and why
CubismExternalEditMCP CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
AI 助手项目指南 — 在修改此项目的任何代码前,请先阅读本文件。
构建 / 运行 / 测试
# 安装开发依赖(在项目根目录)
python3 -m venv .venv
.venv/bin/pip install -e .
# 语法检查
.venv/bin/python3 -c "import py_compile; py_compile.compile('cubism_mcp.py', doraise=True)"
# 导入检查
.venv/bin/python3 -c "import cubism_mcp"
# Lint 检查(CI 同等)
.venv/bin/pip install ruff
.venv/bin/ruff check cubism_mcp.py --ignore E501,BLE001,ASYNC230
# 本地开发时 MCP 配置(直接跑脚本,不用 uvx)
# command: /Users/linjiashen/CubismExternalEditMCP/.venv/bin/python3
# args: ["/Users/linjiashen/CubismExternalEditMCP/cubism_mcp.py"]
# 注意:修改工具列表后需"先禁用 → 再启用"连接器才能强制重连
项目架构
单文件 Python 项目,将 Live2D Cubism Editor(5.4 Alpha)的外部应用集成 API 封装为 MCP 服务器。
AI Agent (WorkBuddy/Claude) ←→ stdio/MCP ←→ cubism_mcp.py ←→ WebSocket ←→ Cubism Editor (ws://localhost:22033)
核心文件
| 文件 | 用途 |
|---|---|
cubism_mcp.py |
唯一源码文件(~1400 行)。包含 42 个 MCP 工具 + WebSocket 客户端 |
pyproject.toml |
项目元数据,依赖 mcp>=1.0.0 + websockets>=12.0 |
README.md |
中文主文档 |
i18n/README_{EN,JA,KO}.md |
英/日/韩翻译文档 |
核心类:CEPluginClient
WebSocket 连接管理,负责:
- 与 Editor 建立/重连 WebSocket(端口 22033,可通过
CUBISM_PORT环境变量覆盖) RegisterPlugin注册 + token 持久化到~/.cubism-mcp/token.txt- 请求/响应匹配(
asyncio.Future机制,超时 15 秒) - 权限分级:
ensureReady()(Allow 权限)/ensureEditReady()(Allow + Edit 权限)
编辑工具架构
所有 21 个编辑 Action 均有独立 Tool(cubism_add_parameter 等),带完整类型签名和 JSON Schema。
内部通过 _run_edit(action, params, silent, model_uid) 辅助函数统一处理:
- 校验
model_uid与 Editor 当前模型一致(不一致则报错) - 自动包裹
EditBegin/EditEnd事务 - 异常时自动
Cancel回滚
cubism_edit 和 cubism_edit_batch 保留用于向后兼容和批量操作。
权限模型
| 权限 | 说明 | 适用操作 |
|---|---|---|
| Allow | 只读 | Get/Set/ClearParameterValues、GetDocuments、结构查询 |
| Edit | 可写 | EditBegin/EditEnd 事务内所有编辑 API |
cubism_edit 和 cubism_edit_batch 自动管理 EditBegin/EditEnd 事务,异常时自动 Cancel 回滚。
代码规范
README 维护规则(强制执行)
- 修改
README.md时,必须同步更新i18n/README_EN.md、i18n/README_JA.md、i18n/README_KO.md - 专业术语必须与 Live2D 官方文档一致:
- 英文:External API Integration、Allow、Edit、ModelingDocuments、PhysicsDocuments、AnimationDocuments
- 日文:外部連携 API、許可、編集
- 韩文:외부 연동 API、허용
- 5.4 Alpha 专属接口在章节标题标注"5.4 Alpha 新增",不在每行加标记
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 158 lines · 2,150 tokens per session scan A bc3c62be7f44
CubismExternalEditMCP CLAUDE.md is an instructions file published in the GitHub repository nana7chi/CubismExternalEditMCP (25 stars, last pushed 1mo ago), licensed MIT. It adds 2,150 tokens to every session, about $0.0107 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.