opentoonz-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@opentoonz-mcp Find the levels used in scenes/MyScene.tnz and validate their paths"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenToonz MCP
opentoonz-mcp is a local, safety-first Model Context Protocol server for OpenToonz workspaces. It gives an MCP client useful, structured access to project and scene metadata, resource validation, level discovery, rendering, and level conversion without exposing a general-purpose shell.
The server is intentionally a sidecar. It does not patch or embed OpenToonz. Instead, it reads OpenToonz's XML-like project and scene files directly for fast inspection and invokes the existing tcomposer and tconverter command-line programs for operations that require OpenToonz's native runtime.
Status
This repository contains the first usable read-mostly release:
Read-only project, scene, level, and artifact discovery.
Scene header inspection and serialized level/scanned-path extraction.
Alias-aware resource validation for
+drawings,+scenes,$scenefolder,$scenepath, and$scenenamepaths.Preview rendering and scene rendering through
tcomposer.Level conversion through
tconverter.Stdio transport for local MCP clients.
One static resource, one scene resource template, and a reusable scene-health prompt.
Tests for path sandboxing, symlink escape rejection, project discovery, and scene resource validation.
The server does not expose arbitrary command execution, arbitrary .toonzscript execution, tcleanup, render-farm administration, or direct scene mutation.
Related MCP server: Spiritmarch Aseprite MCP
Requirements
Node.js 20 or newer.
A built OpenToonz checkout if rendering or conversion is needed.
An MCP client that supports stdio servers.
The OpenToonz source checkout used while designing this server is expected to have a layout similar to:
workspace/
├── toonz/ # OpenToonz source checkout
│ └── build/bin/
│ ├── tcomposer
│ └── tconverter
└── opentoonz_mcp/ # this repositoryThe MCP server can inspect an unbuilt workspace. Only the rendering and conversion tools require the corresponding binaries.
Install and build
cd opentoonz_mcp
npm install
npm run typecheck
npm test
npm run buildThe executable is written to dist/index.js and is also exposed as the opentoonz-mcp npm bin entry.
Configure an MCP client
Build the server first, then add a stdio server entry to the client. The exact settings file varies by client; the following is the portable shape:
{
"mcpServers": {
"opentoonz": {
"command": "node",
"args": ["/absolute/path/to/opentoonz_mcp/dist/index.js"],
"env": {
"OPENTOONZ_WORKSPACE": "/absolute/path/to/opentoonz_project_and_mcp/opentoonz",
"OPENTOONZ_BUILD_DIR": "/absolute/path/to/opentoonz_project_and_mcp/opentoonz/toonz/build",
"OPENTOONZ_ROOT": "/absolute/path/to/opentoonz_project_and_mcp/opentoonz"
}
}
}
}OPENTOONZ_WORKSPACE is the important setting. If it is omitted, the current working directory is used. When the server is started from a directory named opentoonz_mcp with a sibling opentoonz directory, the sibling is selected as a convenience fallback.
Configuration variables
Variable | Default | Purpose |
| current directory, or sibling | Root directory that all paths must remain inside |
| workspace root | OpenToonz runtime root; the server seeds isolated |
|
| Directory containing |
| discovered build binary | Explicit |
| discovered build binary | Explicit |
|
| Default output directory for generated artifacts |
|
| Isolated |
|
| Optional native library path for build-tree binaries |
|
| Default subprocess timeout |
|
| Captured stdout/stderr limit per subprocess |
|
| Filesystem discovery limit |
|
| Maximum project, scene, and |
|
| Maximum concurrent metadata inspections |
Capabilities
Tools
Tool | Writes files? | Description |
| No | Workspace roots, discovered counts, and available binaries |
| No | Finds project descriptors and parses folder aliases |
| No | Inspects one project descriptor |
| No | Finds |
| No | Reads scene header and serialized resource references |
| No | Resolves aliases and reports missing/external resources |
| No | Lists recognized level and image files |
| No | Lists files produced by this server |
| Yes, artifact only | Renders one frame with |
| Yes, artifact/output | Renders a frame or frame range with |
| Yes, new output only | Converts a level with |
All generated outputs must be new paths inside the configured workspace. Existing files are rejected before OpenToonz starts, which prevents tconverter from blocking on its interactive overwrite prompt.
Rendering is stricter than inspection: render_preview and render_scene first validate that all discovered scene resources are present and resolve inside the configured workspace. Scenes that intentionally depend on external media must be copied into the workspace or handled outside this MCP server.
Resources and prompt
opentoonz://workspace/manifest— live JSON workspace manifest.opentoonz://scene/{+path}— read-only scene summary resource template. The reserved URI expansion allows nested workspace-relative paths.review-scene-health— prompt that directs an MCP client to inspect a scene and validate its resources before discussing changes.
Safety model
Workspace sandbox: relative and absolute inputs are canonicalized and checked against
OPENTOONZ_WORKSPACE.Symlink escape protection: existing paths are resolved through the filesystem before the containment check.
No shell: subprocesses use
spawn()with an argument array andshell: false.Bounded execution: render and conversion calls have a timeout and bounded captured output.
No accidental overwrite: generated outputs must not exist before an operation starts.
No arbitrary scripts:
.toonzscriptexecution is intentionally not exposed.Read-only first: the initial API focuses on inspection and artifact-producing operations; it does not save scenes or levels in place.
See docs/architecture.md for the rationale and extension rules.
Development
Useful commands:
npm run dev # start the stdio server with tsx
npm run typecheck # TypeScript validation, including tests
npm test # node:test suite through tsx
npm run build # production JavaScript in dist/Do not print diagnostics to stdout while the server is running: stdout is the MCP JSON-RPC channel. Operational diagnostics belong on stderr.
OpenToonz integration notes
OpenToonz scene files are not a stable public JSON format. The server therefore limits direct parsing to stable, low-risk metadata patterns: the scene header and <path> / <scannedPath> values used by serialized level records. Rendering and conversion are delegated to OpenToonz's own binaries so codec and scene behavior remain native to the installed build.
The source repository contains upstream and origin remotes for OpenToonz. This MCP implementation remains in its own repository so it can evolve independently and avoid mixing MCP changes with the OpenToonz application history.
License
This MCP server is released under the MIT License. OpenToonz itself remains under its own license; see the OpenToonz checkout for its licensing terms and third-party notices.
Available Tools
11 toolsconvert_levelConvert an OpenToonz levelC
Convert a level with tconverter into a new destination. Existing files are refused to avoid interactive overwrite prompts and accidental data loss.
Inputs: sourcePath (required), destinationPath (required), width, frameEnd, +3 more.
inspect_projectInspect an OpenToonz projectA
Parse one OpenToonz project descriptor and report its version, logical folder aliases, resolved in-workspace paths, and warnings.
Inputs: projectPath (required).
inspect_sceneInspect an OpenToonz sceneA
Read scene header metadata and extract serialized level/scanned-path references without loading or mutating scene resources.
Inputs: scenePath (required).
list_artifactsList MCP artifactsA
List files produced by MCP render and conversion operations in the configured artifact directory.
Inputs: no named parameters.
list_level_filesList OpenToonz level filesB
List recognized OpenToonz drawing, vector, raster, palette-adjacent, and image level files under an optional workspace-relative directory.
Inputs: limit, directory.
list_projectsList OpenToonz projectsB
Discover OpenToonz project descriptors inside the workspace. Results are read-only and include project folders and parser warnings.
Inputs: limit.
list_scenesList OpenToonz scenesC
Discover .tnz and legacy .tab scenes. Optionally scope results to a project directory or descriptor.
Inputs: limit, projectPath.
render_previewRender a preview frameB
Render one scene frame with tcomposer into a new .mcp-artifacts file. Existing files are never overwritten. Requires a built tcomposer executable.
Inputs: scenePath (required), frame, shrink, threads, +2 more.
render_sceneRender an OpenToonz sceneB
Render an image sequence or output file with tcomposer. The destination must be new and inside the configured workspace; no arbitrary shell commands are exposed.
Inputs: scenePath (required), outputPath (required), step, frame, +5 more.
validate_scene_resourcesValidate scene resourcesA
Resolve scene path aliases and report missing or workspace-external level and scanned-image references. This is read-only.
Inputs: scenePath (required).
workspace_manifestInspect OpenToonz workspaceB
Return a live manifest of the configured workspace, discovered projects/scenes/levels, runtime paths, and available OpenToonz command-line capabilities.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools target clearly distinct resources or actions: listing projects, scenes, levels, and artifacts is separate from inspecting and validating them. The main potential confusion is between render_preview and render_scene, and somewhat between workspace_manifest and the various list/inspect tools, though the descriptions clarify the intended boundaries.
The set is mostly consistent snake_case with verb_noun patterns such as list_projects, inspect_scene, render_scene, and convert_level. The notable deviation is workspace_manifest, which is noun-based rather than following the verb_noun convention.
Eleven tools is well within a reasonable range and each tool appears to earn its place by covering discovery, inspection, validation, rendering, conversion, or artifact listing. The surface is broad enough for the OpenToonz workflow without feeling excessive.
The server covers the core inspection and production lifecycle: discovering projects/scenes/levels, inspecting metadata, validating resources, rendering previews and sequences, converting levels, and listing artifacts. Minor gaps remain, such as direct inspection of individual level files or artifact management beyond listing, but agents can work around these.
Maintenance
Related MCP Connectors
Control Unreal Engine to browse assets, import content, and manage levels and sequences. Automate…
Give every project one workspace for its files, its team, and its AI agents.
Build and publish pages, manage collections, records and files in a Markerloop workspace.
Fast multi-format CAD previews, geometry checks and conversion; measure and share in the workspace.
Related MCP Servers
- FlicenseBqualityBmaintenanceEnables safe, observable Blender research by exposing structured tools for viewport capture, object and material edits, semantic scene creation, and managed .blend project lifecycles with transactional rollback and validation.42-
- AlicenseAqualityCmaintenanceEnables CLI-first Aseprite automation with staging workspaces, supporting sprite inspection, patching, export, preview, and atomic file commits via file_commit.6MIT
- AlicenseNot gradedqualityCmaintenanceEnables clients to create, query and edit QGIS projects and vector data in an isolated, new headless PyQGIS process, exporting GeoJSON/GeoPackage, saving and reopening editable QGZ bundles, and rendering PNG maps through typed MCP tools. All operations are workspace-relative with strict path and geometry validation, and never attach to or modify a running QGIS desktop session.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to drive OpenToonz headlessly through MCP tools for creating workspaces and scenes, drawing or importing frames as levels, placing cells on the xsheet, and rendering frames, PNG sequences, or MP4 videos. Also exposes a generic script escape hatch for the rest of the OpenToonz JS API.231MIT