mcp-for-maya
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PYTHONPATH | No | Only needed when running from a source checkout with `python -m maya_mcp_server`; point it at `<repo>/src`. | |
| MAYA_MCP_EXCLUDE_PORTS | No | Excludes specific ports from the auto-scan probe set, e.g. a port occupied by a non-Maya TCP service. | |
| MAYA_MCP_INCLUDE_PORTS | No | Binds the auto-scan probe set to a specific list of Maya command ports, e.g. `7001,7002`. Comma-separated, ranges like `7005-7010` are allowed. | |
| MAYA_MCP_VP2_BOTTOM_UP | No | Forces the VP2 readback direction when a driver misreports it (`0` or `1`). |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server provides tools to interact with Autodesk Maya 3D sessions.
Connection & Setup
maya_setup_guide: Diagnose connection, install userSetup.py, get fallback instructions Actions: diagnose | install | guide | uninstall Use when list_sessions returns empty or on first-time setup.
Spatial Awareness (ICEV: look, work out, change, check)
LOOK: scene_snapshot() for a spatial overview
WORK OUT: Use the spatial data to plan the change
CHANGE: execute_code() to apply it
CHECK: scene_assert() to confirm the result; scene_viewport_snapshot() to look at it (GUI)
Scene Tools
scene_snapshot: Full scene spatial overview
scene_inspect: Deep inspection of object/zone
scene_measure: Distance/clearance between objects
scene_assert: Verify scene state
Scene-Graph Introspection
scene_describe: API-level node self-description - exact type, attribute metadata (keyable/connectable/enum/ranges) and connection wiring; use before composing execute_code setAttr/connectAttr calls (spatial questions -> scene_inspect); responses are bounded - 200 items per face by default, relaxable to 1000 via limit=; *_truncated flags + totals disclose any cut (narrow via attrs=[...] and re-query)
scene_nodes: bounded enumeration incl. non-DAG nodes (materials/tool nodes); type/pattern/dag_only filters + has_more/next_cursor pagination
Constraint & Safety Tools
scene_validate: Read-only spatial constraint validation (clearance, overlap, height); without auto_fix mutations (automated repair belongs to scene_plan); disambiguated from scene_review (heuristic checks) and scene_assert (boolean gate checks)
scene_checkpoint: writes the current scene to a .ma file on disk under checkpoints/ (name whitelist; a scene never saved to disk gets a temporary checkpoint instead)
scene_checkpoint_list: List saved checkpoints
scene_rollback: Open a checkpoint file and point the scene back at its original path (saves the current scene first)
Camera & Shot Tools
camera_create: Create camera with shot type (wide/medium/close/etc)
camera_orbit: Create orbiting camera with animation (orbit/turntable; static shot-type framing belongs to camera_create)
Check by looking (GUI sessions only)
scene_viewport_snapshot: WYSIWYG viewport capture (HUD/selection included - what the artist sees)
scene_render_preview: clean single-frame playblast (camera optional; state restored afterwards)
Look Quality (5 Dimensions)
scene_aesthetics: Scores the scene's look on 5 dimensions:
Color Theory: 60-30-10 rule, temperature, harmony, saturation, contrast
Spatial Composition: golden ratio, rule-of-thirds, visual weight balance
Proportion & Scale: human ergonomics, size hierarchy (hero/secondary/tertiary)
Lighting Quality: layer composition, color temperature consistency
Visual Flow: sight lines, circulation clarity, visual rhythm Returns: overall score (0-100), grade (S/A/B/C/D/F), improvement suggestions
scene_review: Checks the whole scene after operations (score 0-100) Checks: spatial, overlaps, zones, aesthetics, constraints, orphans, naming, components, conflicts, lighting, organization
Scene Planning
scene_plan: Plans a scene layout; checks organization, suggests layout changes, warns about conflicts; opt-in recommend_assets adds advisory Poly Haven model picks across entrance/display/furniture/lighting zones (search only, 5s soft budget, graceful offline/partial fallback, no download/import)
Asset Tools (Poly Haven CC0)
asset_search: Search the Poly Haven index (host-side; no session)
asset_import: Download (https whitelist + md5 + cache) and import FBX into Maya with texture auto-wiring; idempotent via GRP_asset_ dedup
Scene Export
scene_export: Export the scene (or named objects) to FBX/OBJ/USD (path normalized, parents auto-created, overwrite opt-in, selection restored; Alembic is not supported)
General Tools
list_sessions: Discover active Maya sessions (if empty, call maya_setup_guide for connection help)
write_module: Define in-memory virtual Python modules in an active session with overwrite semantics; disambiguated from execute_code (use execute_code for one-off snippets, queries, or expression evaluation)
execute_code: Execute arbitrary Python code with full session privileges in an active session; irreversible (cannot be undone); returns structured response envelopes via result_type; disambiguated from write_module (module definition) and domain-specific scene tools
Best practices:
Call scene_snapshot() before modifications
Use scene_checkpoint() before risky operations
A checkpoint file carries no undo history; after scene_rollback call scene_snapshot to rebuild context
A checkpoint file is self-contained (references flattened, no write-back) one scene file per session assumed
Use scene_validate() to check constraints after changes
Cache auto-invalidates after execute_code/write_module
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| scene_snapshotA | Get a complete spatial overview of the current Maya scene. Returns a structured description of ALL objects with positions, sizes, and types. Call this once at the start of each task to see the whole scene before changing it. Sizes are world-axis bounding boxes. Each shape's own box is transformed once, so a rotated parent no longer widens a size layer by layer; geometry that does not fill its own box (an L-shape, a character mesh) can still read up to one axis-alignment too wide. The first line ends with MODIFIED=y or MODIFIED=n. y means the scene has changes that were never saved; n means it has none. This is Maya's own flag for the whole scene, so it says nothing about which object changed. Changes made through this server's own tools count too, so y does not mean a person edited the scene. JSON output carries the same fact as the top-level scene_modified field. The flag is read again on every call and never comes from the cache, while the object list may be a few seconds old. Object positions, box corners and zone centers/boxes are in the scene's current linear unit (cm, m or mm); JSON and the CoS header name that unit. Boundary: Disambiguated from scene_inspect (deep-dive inspection of specific objects or zones) and scene_nodes (granular DAG/DG node name discovery with pagination). |
| scene_inspectA | Deep inspection of a specific object or zone. Returns detailed properties including transform, BBox, material, mesh stats, and optionally nearby objects with distances. Object positions, box corners, sizes, neighbor distances and zone centers/boxes are in the scene's current linear unit (cm, m or mm). JSON object results name that unit. Centimetre output keeps its previous shape; non-centimetre zone results and the CoS view add the unit. An object's BBox is the node's own box, without its ancestors' transforms. The zone branch reports world-axis boxes built from each shape's own box transformed once, so a rotated parent no longer widens them layer by layer; geometry that does not fill its own box can still read up to one axis-alignment too wide. Boundary: Disambiguated from scene_snapshot (broad whole-scene spatial overview) and scene_describe (API-level attribute metadata, types, and connection wiring). |
| scene_measureA | Measure the spatial relationship between two objects. Call this in the compute step (the second of ICEV's four steps), to turn a spatial question into a number before you execute a change: size a clearance before moving something, prove two objects interpenetrate before you separate them, or get the axis detail behind an overlap that scene_validate reported. Read-only and idempotent: it queries world-space bounding boxes and never modifies the scene, so no checkpoint file is written. Requires an active Maya session. Every mode measures world-space AABBs, not the mesh surface and not the object origin. Each shape's own box is transformed once, so a rotated parent no longer widens the result layer by layer; geometry that does not fill its own box (an L-shape, a character mesh) can still measure up to one axis-alignment too wide. The modes differ in what the number means: center distance between the AABB midpoints. surface distance between the closest facing AABB corners — an axis-aligned approximation, so it over-reports clearance for rotated or concave geometry. clearance SIGNED, and 0 is NOT a "merely touching" signal. Per axis the gap is +separated / 0=touching / -penetrating: > 0 euclidean distance across the STRICTLY SEPARATED axes only. Penetrating axes contribute 0, so they are invisible in this number. = 0 no axis is strictly separated and at least one axis is exactly touching. The other axes may be deeply penetrating, so 0 does NOT mean the boxes just touch. < 0 all three axes penetrate; the value is the SHALLOWEST penetration depth, the minimum translation needed to pull them apart. bbox_overlap is true if and only if all three axes strictly penetrate. A single penetrating axis already makes it read false, so it can never be read as "no penetration". Read details.clearances_xyz for the signed per-axis truth before concluding anything from distance alone. bbox overlap test. On overlap, distance is 0 and overlap_dims holds the per-axis penetration extents; otherwise distance is euclidean and gaps_xyz holds the per-axis gaps. Distances are in the scene's current linear unit (cm, m or mm), not always centimetres. Boundary: Disambiguated from scene_inspect (per-object property deep-dive), scene_snapshot (whole-scene spatial overview) and scene_assert (checks the scene against expected values rather than measuring one pair). |
| scene_assertA | Verify scene state matches expected values. Use this after modifications to confirm the scene is in the desired state. This is the check step (the last of ICEV's four steps). bbox_min/bbox_max compare world-axis boxes built from each shape's own box, transformed once: a rotated parent no longer widens them layer by layer, but geometry that does not fill its own box (an L-shape, a character mesh) can still read up to one axis-alignment too wide. Boundary: Disambiguated from scene_validate (checks relational spatial constraints across zones rather than exact expected values for named objects). |
| scene_validateA | Validate scene against spatial constraints. Checks the scene for constraint violations like minimum clearance, object limits, overlaps, and height requirements. This is a read-only check without auto_fix mutations (it cannot modify or repair objects; for automated fixes, see scene_plan with auto_fix=True). Because it is non-destructive, it needs no undo or rollback checkpoint. Requires an active Maya session. Boundary: Disambiguated from scene_review (a full check of scene quality across 11 checks) and scene_assert (verifies specific numeric values or object existence). |
| scene_checkpointA | Save the current scene to a Boundary: Disambiguated from scene_checkpoint_list (list the checkpoint files already written) and scene_rollback (open one and point the scene at it) — scene_checkpoint is the save half. Writes a self-contained .ma into a checkpoints/ directory next to the scene file. A scene that was never saved to disk needs an explicit name, and its temporary checkpoint goes under the Maya workspace — returned with original_file_status="no_original_file" and scene_rebound_to=null. Same-name checkpoints are rejected unless overwrite=True (the old file is preserved via rename). Honest bounds: the file contains no undo history — after scene_rollback, call scene_snapshot to rebuild context. References are flattened (self-contained, no write-back). Assumes one scene file per session. |
| scene_rollbackA | Open a checkpoint file and point the scene at its original path (S2). Boundary: Disambiguated from scene_checkpoint (save a checkpoint from the current scene) and scene_checkpoint_list (list the ones already written) — scene_rollback is the read-back half. Before opening, the current scene is saved to a file first (auto_before_rollback); if that fails, the read-back aborts — pass discard_current_state=True to escape (the result reports safety_snapshot="skipped_by_user"). The scene points back only when it has a file path at read-back time; otherwise it stays on the checkpoint path (S1) and scene_rebound_to is null. The checkpoint file carries no undo history — call scene_snapshot afterwards to rebuild context. The result also says scene_modified_before: whether the scene still had changes that were never saved at the moment this call read the flag — a read of its own, just before the rollback request and before any file is opened. It is the same Maya flag scene_snapshot reports; after the open, that flag describes the checkpoint, not the scene being replaced. The value never changes what this tool does: a changed scene and a clean scene take the same path, and the copy written before the switch behaves exactly as before (safety_snapshot reports "skipped_by_user" only when discard_current_state lets a failed save through). The one new failure is Maya refusing to answer that question: the call then errors, with nothing opened yet, instead of printing a made-up "clean". That read is its own round trip, so it is worth saying what it covers when calls overlap: two scene_rollback calls for one session can each run their own read and their own switch. The value then describes the scene as it was at that read, which may be a scene the other call has already replaced. Nothing is gated by that difference, and scene_name_before still names the scene the rollback itself read (empty when the scene was never saved). |
| scene_checkpoint_listA | List all saved checkpoints for the current scene state. Boundary: Disambiguated from scene_checkpoint (save a new checkpoint) and scene_rollback (open one and point the scene at it) — scene_checkpoint_list only reads what is already on disk. Saved scenes list <scene_dir>/checkpoints; a scene never saved to disk lists the workspace checkpoints instead (adhoc flag per entry). |
| camera_createA | Create a camera positioned for a specific shot type. Boundary: Disambiguated from camera_orbit (animates a turntable around a point over many frames) — camera_create frames one static shot and adds no animation. Supports the 8 built-in shot types: extreme_wide, wide, medium, close, extreme_close, over_shoulder, bird_eye, low_angle. |
| camera_orbitA | Create an orbiting camera with turntable animation around a point. Side effects: creates a new camera and animation curves in the scene and marks the scene dirty. Not idempotent — each call adds another camera. Requires an active Maya session. Boundary: Disambiguated from camera_create (static shot-type framing; use camera_orbit only when an animated orbit is needed). |
| scene_aestheticsA | Score the scene's look on 5 design dimensions. Scores the scene's look across 5 design dimensions:
Returns an overall score (0-100) with grade (S/A/B/C/D/F) and improvement suggestions. Boundary: Disambiguated from scene_review (scene_aesthetics evaluates visual design theory and artistic harmony in depth, while scene_review is a broad check of the whole scene). |
| scene_reviewA | Check a whole scene - all the aspects worth checking after operations. Runs spatial integrity, overlap detection, zone coverage, aesthetics, constraint validation, orphan detection, naming, componentization, conflicts, lighting quality, and scene organization. Returns a score (0-100) and detailed issue list. Checks you add in the Maya session with
Boundary: Disambiguated from scene_validate (narrow rule-based spatial constraint checking) and scene_aesthetics (in-depth 5-dimension aesthetic theory scoring). Use this after any major scene modification to verify quality. |
| scene_planA | Plan a scene layout: organization checks plus layout suggestions. Checks the scene and produces an actionable plan:
With recommend_assets=True, also recommends Poly Haven models across the built-in scene zones (entrance, display, furniture, lighting; shell, ip_core, and path are skipped with no search): reads fresh zone geometry (after auto_fix completes when auto_fix=True), resolves a target object per zone from objective (full DAG path, unique short name, or single measurable zone object; otherwise falls back to the zone's world-axis bounding box, built from shape boxes transformed once, so a rotated parent no longer widens it by layer), searches the models index in a worker thread under a 5s soft time budget reusing the 300s models index cache, checks words, deduplicates (capped at 3 per zone and 12 total), and screens candidates in metres (0.5x-1.5x per sorted axis for an object target; upper limit only for zone_bbox). Recommendations are advisory references — search only, no download and no import — and a search timeout, network failure (returning partial/offline status), or corrupt metadata never drops or changes the plan itself. Clearances and collisions are not verified. Blockout first: check organization and proportions before committing to detailed modeling. Accepts a plain-language objective. Boundary: Disambiguated from scene_review (scene_plan focuses on forward-looking layout planning and actionable auto_fix reorganization, whereas scene_review gives an overall diagnostic score). |
| scene_viewport_snapshotA | Capture the active viewport as an image (WYSIWYG). Boundary: Disambiguated from scene_render_preview (playblast a frame from a chosen camera with the HUD suppressed) — scene_viewport_snapshot captures the panel exactly as the artist sees it, HUD included. GUI sessions only - headless (mayapy/batch/native-channel) sessions get a structured gui_session_required error. The capture is what the artist sees: viewport HUD, selection highlights and ornaments included. That is a feature - the agent verifies exactly what the user is looking at. A cmds.refresh(force=True) runs first so the frame is current. |
| scene_render_previewA | Single-frame playblast preview from a camera (clean, no HUD). Boundary: Disambiguated from scene_viewport_snapshot (capture the panel as the artist sees it, HUD and selection highlights included) — scene_render_preview renders a chosen camera with the HUD suppressed. GUI sessions only - headless sessions get a structured gui_session_required error. Side-effect disclosures (read_only_hint is honest):
|
| asset_searchA | Search the Poly Haven CC0 asset index (host-side, no Maya needed). Boundary: Disambiguated from asset_import (downloads the asset into a live Maya scene and mutates it) — asset_search only resolves ids and metadata, so it needs no session and changes nothing. Queries https://api.polyhaven.com/assets and returns matching asset metadata. Read-only and idempotent - pure lookup. |
| asset_importA | Import a Poly Haven CC0 model into Maya (find ids via asset_search). Boundary: Disambiguated from asset_search (host-side id and metadata lookup that touches no Maya session) — asset_import is the mutating half and needs a live session to import into. Pipeline: host downloads FBX + textures from the Poly Haven whitelist (https-only, size caps, per-file md5 verify) into the platformdirs cache -> Maya imports the local FBX (explicit meters unit handling) -> texture maps auto-wire by PH naming convention (diff/albedo -> color sRGB; rough/metal -> Raw single-channel; nor_gl -> bump2d normal) -> polycount gate -> group as GRP_asset_ -> bbox/metadata report. Idempotent by default: a second call with the same asset_id reports the existing group instead of duplicating (force=True re-imports). |
| scene_exportA | Export the Maya scene (or named objects) to a local file. Writes through cmds.file with prompt=False forced (a modal dialog would hang the command channel). Formats: fbx, obj, usd (Alembic is not supported - its AbcExport API is not a cmds.file surface). The selection set is restored after every objects= export and the scene's modified flag is untouched. destructive_hint is False but note: overwrite=True permanently replaces the target file - that path is not recoverable. |
| scene_describeA | API-level self-description of ONE node (not spatial). Boundary: scene_inspect answers WHERE an object is (position, bbox, neighbors); scene_nodes discovers candidate node names; scene_describe answers WHAT the node is at the API level - exact node type, per-attribute metadata, and connection wiring - so you can compose accurate execute_code/setAttr/connectAttr calls against real names. |
| scene_nodesA | Bounded enumeration of scene nodes - including non-DAG nodes. Boundary: scene_snapshot is the low-resolution spatial overview you call once per workflow; scene_nodes is the name-discovery complement for the API layer - it lists nodes a spatial view never shows (materials, shadingEngines, tool nodes) and pages honestly: has_more/next_cursor tell you when the list was cut (for attribute schema and connection inspection, call scene_describe). |
| list_sessionsA | List all active Maya sessions. Boundary: Disambiguated from add_session (register a host:port by hand) and maya_setup_guide (diagnose an empty result) — list_sessions only reports what is already connected. Returns a list of session information including:
Note: To detect new or removed sessions, clients should call this tool periodically (e.g., every 10-30 seconds) and compare results. The SessionManager automatically scans for new Maya sessions in the background. If this returns an empty list, call maya_setup_guide() for connection help. |
| maya_setup_guideA | Maya connection setup guide and diagnostics. Boundary: Disambiguated from list_sessions (read the current session set) and add_session (attach a host:port you already know) — maya_setup_guide diagnoses and repairs the connection itself. Use this tool when list_sessions returns empty or when setting up Maya MCP for the first time. Provides platform-aware diagnostics, auto-installation of userSetup.py, and step-by-step fallback instructions. |
| write_moduleA | Create a virtual in-memory Python module in an active Maya session. Injects reusable Python functions into the target Maya session's sys.modules. Modules are virtual and in-memory: they do not persist across Maya restarts, and existing modules are protected unless overwrite=True is explicitly set. Requires an active Maya session. Under safe_mode (MAYA_MCP_SAFE_MODE, opt-in, default off) this code payload passes the same deny-by-default allowlist as execute_code: non-allowlisted imports, denied builtin names (any reference, not just calls), builtins references, dunder attribute access, and unparseable input are rejected with safe_mode_rejected naming the triggering rule id. Successful responses carry mode: "safe" on their structured payload. Under the code allowlist, execute_code payloads can only import the v1 allowlisted roots, so a module defined here whose root is not one of those roots is not importable by name from allowlisted code. Boundary: Use write_module to define reusable libraries and helper functions; use execute_code for one-shot imperative execution or expression evaluation. |
| execute_codeA | Execute arbitrary Python code in an active Maya session. Runs arbitrary code with full session privileges of the connected Maya process. Execution is irreversible and cannot be undone (modifications do not register an automatic undo chunk). The return value shape is governed by the result_type envelope parameter. Requires an established Maya session (discoverable via list_sessions). Under safe_mode (MAYA_MCP_SAFE_MODE, opt-in, default off) the code payload passes a deny-by-default allowlist checked on the parsed code before dispatch: imports outside the v1 roots (maya/math/json/re/collections/ itertools/functools/dataclasses/typing), denied builtins (eval/exec/open/import/getattr/setattr/...), builtins references (any use of a denied name rejects, not just calls), dunder attribute access, and unparseable input are rejected with safe_mode_rejected naming the triggering rule id. Successful responses carry mode: "safe" on their structured payload. This catches slips, it is not a sandbox — code that passes still runs with full session privileges. |
| add_sessionA | Manually add a Maya session at a specific host and port. Boundary: Disambiguated from list_sessions (report the sessions the SessionManager already discovered) and maya_setup_guide (diagnose and repair a connection) — add_session registers a host:port you already know. Use this when auto-discovery doesn't find your Maya session, or to connect to a Maya instance on a specific port. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 25 tools
The set is dense with scene-inspection tools (scene_snapshot, scene_inspect, scene_describe, scene_nodes, scene_measure) and scene-checking tools (scene_assert, scene_validate, scene_review, scene_aesthetics, scene_plan), which could easily be misselected. However, nearly every description carries an explicit 'Boundary:' paragraph naming the neighbouring tools, so an agent can resolve the overlaps from documentation alone; only a couple (scene_validate vs scene_assert, scene_review vs scene_aesthetics) remain genuinely close.
Dominant noun_action convention with consistent prefix groups (scene_*, camera_*, asset_*), all snake_case. A few outliers use verb_noun or three-part forms (list_sessions, add_session, maya_setup_guide, write_module, execute_code), which is a minor deviation rather than a conflicting convention.
25 tools is at the heavy end of the range and the surface is noticeably redundant: five separate read-only scene-inspection tools and four-plus scene-scoring/validation tools. Each is individually justified, but the count feels inflated for what is essentially 'inspect, plan, validate, edit, export'.
Coverage is broad and lifecycle-aware: discovery sessions, spatial inspection, planning, checkpoint/rollback, rendering, asset search/import, export, and arbitrary code execution. The notable gap is direct object manipulation (no move/transform/delete/reset tools), so agents must fall back to execute_code for the most basic edit operations.