CubismExternalEditMCP: Instructions file for Claude Code

CLAUDE.md

CubismExternalEditMCP CLAUDE.md is an instructions file for Claude Code from nana7chi/CubismExternalEditMCP. It costs 2,150 tokens per session, scanned A, original, MIT.

Project instructions for a Python bridge that connects an AI coding assistant to Live2D Cubism Editor, a tool for making animated 2D characters. They describe how to install, run, check, and test the bridge.

In plain words
What is it for?
Use them when developing or debugging this Python project, including installing dependencies, checking syntax, testing imports, running lint checks, and reconnecting the editor integration.
Why use it?
They give contributors a common way to change the project and check that it still works. They also explain how the assistant communicates with the editor.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is nana7chi/CubismExternalEditMCP's own configuration. It tells Claude Code how to work on CubismExternalEditMCP itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything CubismExternalEditMCP configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/linjiashen/CubismExternalEditMCP/.venv/bin/python3.

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/nana7chi/CubismExternalEditMCP/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/nana7chi/CubismExternalEditMCP

Made for: Claude Code.

Wrote 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.

agentmods badge for CubismExternalEditMCP CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nana7chi/cubismexternaleditmcp/claude-md/github.svg)](https://agentmods.dev/instructions/nana7chi/cubismexternaleditmcp/claude-md)
Your own site
<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.

agentmods 80×15 button for CubismExternalEditMCP CLAUDE.md

Your own site · 80×15
<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>
Per session 2,150 This file is loaded in full into every session.
When invoked 2,150 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 11d ago against content hash bc3c62be7f44, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

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.

CLAUDE.md · 158 lines

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_editcubism_edit_batch 保留用于向后兼容和批量操作。

权限模型

权限 说明 适用操作
Allow 只读 Get/Set/ClearParameterValues、GetDocuments、结构查询
Edit 可写 EditBegin/EditEnd 事务内所有编辑 API

cubism_editcubism_edit_batch 自动管理 EditBegin/EditEnd 事务,异常时自动 Cancel 回滚。

代码规范

README 维护规则(强制执行)

  1. 修改 README.md 时,必须同步更新 i18n/README_EN.mdi18n/README_JA.mdi18n/README_KO.md
  2. 专业术语必须与 Live2D 官方文档一致
    • 英文:External API Integration、Allow、Edit、ModelingDocuments、PhysicsDocuments、AnimationDocuments
    • 日文:外部連携 API、許可、編集
    • 韩文:외부 연동 API、허용
  3. 5.4 Alpha 专属接口在章节标题标注"5.4 Alpha 新增",不在每行加标记

Read the full file on GitHub · 158 lines

Changes

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.

  1. 11d ago First seen · 158 lines · 2,150 tokens per session scan A bc3c62be7f44

Subscribe to this mod's changes

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.

Related

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.

vercel/next.js · 7,296 tokens

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.

openai/codex · 5,153 tokens

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).

microsoft/vscode · 6,785 tokens

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.

github/spec-kit · 7,104 tokens

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).

microsoft/vscode · 5,001 tokens

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.

langchain-ai/langchain · 4,469 tokens