Remote MCP · OAuth 2.1

Connect ToonLab to your AI coding agent

The ToonLab MCP server gives any MCP-compatible tool — Claude Code, Claude, Cursor, Codex, and others — direct access to asset search, AI generation, stored characters, and your cloud library. It keeps anime-game style, provenance, sourcing policy, and custom-gap decisions explicit instead of silently generating replacements. Included with Pro and Team plans.

Endpoint
https://toonlab.io/mcp

Setup by client

Claude Code

claude mcp add --transport http toonlab https://toonlab.io/mcp

Then run /mcp inside Claude Code to authenticate — your browser opens the ToonLab authorization screen once.

Claude (claude.ai and desktop)

  1. Open Settings → Connectors → Add custom connector.
  2. Enter https://toonlab.io/mcp and confirm.
  3. Sign in to ToonLab in the browser window and choose Authorize.

Cursor

Add the server to .cursor/mcp.json in your project (or the global ~/.cursor/mcp.json):

.cursor/mcp.json
{
  "mcpServers": {
    "toonlab": {
      "url": "https://toonlab.io/mcp"
    }
  }
}

Everything else

Any client that supports remote MCP servers with OAuth works the same way: add https://toonlab.io/mcp as a remote server — most clients accept the JSON shape above — and approve access in the browser when prompted. Manage or revoke authorized clients any time in Settings → MCP.

Working offline or without an account? The open-source package bundles a local stdio MCP server that searches the procedural catalog and public CC0 sources and keeps everything in an on-disk workspace. It requires neither GitHub nor a ToonLab account and composes cleanly with the remote server:
Local OSS server
{
  "mcpServers": {
    "toonlab-local": {
      "command": "npx",
      "args": ["-y", "@call-me-sensei/toonlab@latest", "--workspace", "/absolute/path/to/your-game/.toonlab"],
      "env": { "TOONLAB_LEGACY_WORKSPACE": "1" }
    }
  }
}

Tool reference

Anime style and sourcing policy

Load this contract before choosing shaders, models, textures, or custom work.

ToolWhat it does
get_anime_game_profileCanonical Call Me Sensei v2 bundle, anime art direction, shader routes, discovery order, and strict tree/rock policy.
get_runtime_guideRuntime entry points, shader/procedural separation rules, workflows, lab links, and runnable examples by topic.
validate_asset_candidateEvaluate normalized source, provenance, license, and anime-fit metadata against strict, advisory, or open policy.
record_asset_gapCreate the JSON and Markdown entry required before custom models, textures, shaders, adapters, or generation.

Live labs and features

Discover the complete authoring contract instead of asking a user to understand every configuration field.

ToolWhat it does
list_live_labsEvery public Beta Lab going live, its creation type, runtime package, management operations, and editable feature count.
get_lab_featuresComplete field and document schemas, source/output capabilities, preview boundaries, and semantic operations for one live Lab.
create_lab_documentCreate a valid starter for any Lab; a Rock template becomes the editable starting mesh for a template-based procedural project.

Discover assets

Read-only. Search every ToonLab Pro collection before policy-permitted custom work.

ToolWhat it does
search_assetsSearch indexed external CC0. Returns normalized source class, stable ID, provenance, license, anime-fit review status, and policy decision.
get_assetComplete normalized metadata, source page, preview, and download URL for one indexed asset.
search_public_galleryUnified search across community creations, all published first-party rock/tree assets, and indexed external open assets. First-party rock results include exact width/height/depth in meters, family/profile, and geological taxonomy so agents can shortlist without rendering.
get_toonlab_assetComplete recipe, taxonomy, provenance, previews, artifact downloads, runtime guidance, and a source-GLB Lab starter for one first-party rock.

Your library

Full CRUD for the signed-in user's creations. IDs never grant access to another user's work.

ToolWhat it does
list_my_creationsSearch your saved presets and projects by text, exact tags, and type; paginate with nextOffset.
get_my_creationOpen one creation by id, including its portable JSON document.
save_creationSave or update a portable preset/project document in your private library.
update_creationReplace or merge-patch an owned portable document and edit its label, description, tags, or private/team visibility.
mutate_lab_creationApply a validated feature or structural Lab operation to an owned creation.
delete_creationDelete an owned, unpublished creation with explicit confirmation. Published sources remain for the audit trail.
save_generated_assetSave a ready generated 3D model or grouped PBR material into your library.

Generate

Generation is custom work: policy approval and a recorded gap are required before credits can be spent. Fal Patina materials keep their preview, variants, maps, and manifest together as one asset. Choose Meshy or Tripo deliberately for 3D; their capabilities are not interchangeable.

ToolWhat it does
get_generation_capabilitiesPlan, credit balance, enabled image/material/3D providers, supported kinds/resolutions, default credit costs, and Patina controls. Call this first.
generate_assetStart images, one grouped Fal Patina PBR material, or 3D with an explicit model_provider. Meshy 7 accepts PNG/JPEG image or 2–4-image multiview input; Text + Meshy creates a concept through image_model first. Tripo supports direct text/image/multiview and model segmentation.
get_generation_jobPoll one job: progress, suggested polling interval, temporary download URL when ready.
get_generation_jobsPoll up to 20 jobs in one call — preferred when tracking a batch.

Characters

Stored character profiles keep generations consistent across sessions.

ToolWhat it does
list_charactersYour characters with tags and available option names (outfits, hairstyles, poses, …). Call before generating a character.
get_characterFull structured profile plus the reference-image inventory.
save_characterCreate or update a character: identity, personality, appearance, art style, and option lists.
add_character_imageAttach a reference image (from a ready generation job or uploaded bytes) as identity, style, or per-option ground truth.

Protocol and result envelope

The endpoint implements remote Streamable HTTP MCP and OAuth 2.1. Tool arguments are JSON objects. Successful calls return the value in structuredContent plus a compact JSON text fallback in content[0].text. Validation, authorization, policy, quota, and missing-target failures return a tool result with isError: true; malformed JSON-RPC requests use normal JSON-RPC errors. Responses containing account data are sent with Cache-Control: private, no-store.

Lab management API

Start with list_live_labs, then call get_lab_features for the chosen Lab. This is the contract an agent should use when it needs to author a creation without making the user translate dozens of controls by hand.

Lab idCreation typeOwns
shadertoon-presetToon shader settings
tree-shadervegetation-shader-presetTree material profile
grass-shadervegetation-shader-presetGrass material profile
flower-shadervegetation-shader-presetFlower material profile
rock-shaderrock-shader-presetRock and geology material
terrain-shaderground-shader-presetTerrain and ground material
manufactured-materialmanufactured-surface-profileManufactured surfaces
waterwater-presetWater and liquid
skysky-paramsSky-owned parameters
cloud-shadersky-paramsCloud-owned parameters
sky-cloudsky-paramsIntegrated sky and cloud
rockrock-projectProcedural and source-GLB rock geometry
treetree-recipeProcedural tree and shrub
grassgrass-presetGrass and groundcover
texturetexture-recipeProcedural material maps

get_lab_features response

{
  "lab": {
    "id": "rock-shader",
    "creationTypes": ["rock-shader-preset"],
    "management": { "creationCrud": ["create", "read", "update", "delete"] }
  },
  "capabilities": {
    "authoring": { "featureMutation": "set_feature", "structuralOperations": [] },
    "outputs": ["portable-preset", "runtime-style-bundle"],
    "preview": { "clientOwned": true, "persisted": false }
  },
  "featureCount": 68,
  "schema": { "material": { "tint": { "type": "color" } } },
  "documentContract": {
    "creationType": "rock-shader-preset",
    "discriminator": { "path": "schema", "value": "toonlab/rock-shader-preset" },
    "schemaVersion": 1,
    "versionPath": "version",
    "idPath": "id",
    "labelPath": "label",
    "featureRoot": "settings",
    "featureApplication": "direct",
    "docKey": { "path": "id", "requiredSeparately": false },
    "jsonSchema": {},
    "starterDocument": {}
  }
}

The response includes every field descriptor, a structural JSON Schema, source/output capabilities, and a populated schema-valid starterDocument. Prefercreate_lab_document for new documents and mutate_lab_creation for validated edits. featureRoot identifies where direct settings live. Tree recipes report compiled-authoring-state because their UI controls compile into recipeoptions. Rock projects have no internal id, so their document key must be supplied separately.

Rock source-mesh edits use compact base64-f32le-v1 float32 storage, with a portable-project budget of 200 operations and 10,000 vertex deltas. The editor restores the normal editable arrays on load. Adaptive meadow grass, camera, lighting, and viewport state remain preview-only. First-party Rock details include a ready labStart document that retains the selected released GLB and its Call Me Sensei material.

Creation CRUD API

ToolRequiredOptional / limits
list_my_creationsnonequery, exact-AND tags, types, offset, limit 1–100; follow nextOffset.
get_my_creationid UUIDReturns the complete owned row and portable document.
save_creationtype, doc_key, label, documentOptional description and up to 10 tags (32 characters each); document at most 256 KiB UTF-8.
update_creationid UUIDExactly one of replacement document or RFC 7396 patch; metadata may include label, description, up to 10 tags, and private/team visibility.
mutate_lab_creationid UUID, lab, operationValidated set_feature for all 15 Labs plus advertised structural operations.
delete_creationid UUID, confirm: trueIdempotent. Published source creations are retained for their publication audit trail.

doc_key is portable identity within a creation type. The returned creation UUID is the management identity for subsequent reads, edits, deletes, and Open in Lab. Supplying another account's UUID returns the same not-found result as an absent creation. Team visibility requires current team membership. A merge-patch null removes the addressed property; clients should preserve the discriminator and schema version.

The private Library is a first-class discovery source, not a list-only fallback. Human developers use the same name/type/tag filters on the Library page; coding agents uselist_my_creations. Tags are normalized lowercase slugs and persist across save, update, Lab sync, and later publication, where Gallery search uses them too.

save_creation arguments
{
  "type": "rock-shader-preset",
  "doc_key": "harbor-cliffs",
  "label": "Harbor cliffs",
  "description": "Reusable cliffs for the harbor district",
  "tags": ["harbor", "cliff", "outdoor"],
  "document": { "...": "copy and edit documentContract.starterDocument" }
}
update_creation arguments
{
  "id": "8a6e6bf7-693a-4a4d-9da5-a7c64bc3c842",
  "patch": { "settings": { "material": { "tint": "#d9cba4" } } },
  "label": "Warm quay rock",
  "tags": ["harbor", "quay", "warm-stone"],
  "visibility": "private"
}

Hosted Lab synchronization

Every Lab in the table round-trips its named portable documents to the signed-in library. Browser drafts remain local and are not silently promoted into creations. Opening an owned, team-visible, unlisted, or public creation injects that exact document into its native Lab store before boot and selects it through the Lab's URL contract. Sky, Cloud, and Sky & Cloud intentionally share one sky-params library; their ownedPathsmetadata tells an agent which parameter groups each focused surface owns.

Validation, limits, and errors

  • Creation documents are validated against their registered portable schema before save or replacement.
  • The 256 KiB document limit is measured as UTF-8 bytes, so non-ASCII text consumes its actual encoded size.
  • Deletion requires the literal boolean confirm: true.
  • Generation requires policy approval, a recorded gap, sufficient entitlement/credits, and a UUID idempotency key.
  • Use the pagination fields returned by search tools; do not assume the first page exhausts a catalog.
  • Temporary generated-asset downloads expire. First-party public catalog artifact URLs are immutable.

How generation and credits work

A kind: "material" request uses Fal Patina. ToonLab stores and displays the generated preview, every variant, the requested base-color/normal/ roughness/metalness/height maps, and the JSON manifest as one material unit. Resolution presets run from 1K through 8K; custom map counts, variants, inference steps, prompt expansion, and upscaling determine the exact charged credits.

Provider selection is part of the contract. Pass model_provider: "meshy" for Meshy 7 or model_provider: "tripo" for Tripo. Meshy image-to-3D accepts PNG/JPEG input and multi-view accepts 2–4 images. A text request with Meshy first creates a concept image through the selected image_model, then returns a parent concept jobId and child model childJobId/jobIds to poll. Meshy does not support model segmentation; use Tripo for that operation. Ifmodel_provider is omitted, the current Pro compatibility default is Tripo, so agents that intend Meshy must never rely on omission.

  1. Discover and validate first. Search the project library, ToonLab gallery, and only then policy-permitted external sources. The gallery tool covers community work plus every published ToonLab rock and tree; use source: "toonlab",catalog: "rock" or "tree", and the returnednextOffset to exhaust a catalog. Rock results expose dimensionsMetersplus family, profile, and taxonomy for selection before download. A strict denial cannot be bypassed by generation.
  2. Record the gap. Call record_asset_gap and write its result to .toonlab/reports/style-asset-gaps.json and TOONLAB_ASSET_GAPS.md.
  3. Check first. get_generation_capabilities returns your balance, enabled providers/models, supported operations, and the exact credit cost of every kind and resolution — agents should call it before spending.
  4. Generate. generate_asset requires the approved policy, semantic domain, and recorded gap id, then spends exactly the quoted cost. Each call takes a fresh idempotency_key (a UUID), so a retried request returns the original job instead of spending twice.
  5. Chain to 3D. Pass auto_chain: true on an image kind and an explicit model_provider to queue image→3D after the image is ready. For Meshy text mode, also choose image_model; both stages are visible and pollable. Combined costs are reserved up front and each failed step refunds itself.
  6. Poll and save. get_generation_jobs returns progress and a suggested polling interval; when ready, download from the temporary URL or persist with save_generated_asset.

Shaders and procedural runtime

Call get_runtime_guide with shaders, procedural,rock, tree, texture, or style-bundles. The response names the public package entry points and gives runnable examples. The key contract is deliberate: generators own geometry, editable recipes, labels, baked channels, LOD, and collision; domain shaders own appearance. Labs are authoring examples rather than runtime dependencies.

Security

Access uses OAuth 2.1 with PKCE — your password is never shared with the client, tokens are scoped to the permissions shown on the authorization screen, and generation tools are flagged as consequential actions so well-behaved agents confirm before spending credits. Creation reads, edits, and deletes are ownership-scoped on the server; a creation UUID belonging to another account does not grant access. Revoke any client from Settings → MCP; revocation is immediate.

Next

The prompt cookbook shows how to put these tools to work — from the first "start a game" prompt to character-consistent art pipelines.