mcp-for-maya
v0.8.0Spatial awareness for AI agents in Autodesk Maya: scene checks, checkpoints, captures (Beta)
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
scene_snapshot Scene Snapshot
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…
| Parameter | Type | Description |
|---|---|---|
detail | string | Detail level - "compact" (fast), "standard" (+materials/mesh stats), "full" (+vertices). |
format | string | Output format - "cos" (CoS: short one-line-per-object text, compact) or "json" (full JSON). |
session_key | Maya session key (auto-selected if only one session). |
scene_inspect Scene Inspect
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 transfo…
| Parameter | Type | Description |
|---|---|---|
target * | string | Object name or zone name to inspect. |
format | string | Output format - "cos" or "json". |
include_neighbors | boolean | Whether to include nearby objects (default True). |
session_key | Maya session key. |
scene_measure Scene Measure
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 obj…
| Parameter | Type | Description |
|---|---|---|
obj_a * | string | First object name. |
obj_b * | string | Second object name. |
format | string | Output format - "cos" or "json". |
mode | string | What the returned number means — see the list above. |
session_key | Maya session key. |
scene_assert Scene Assert
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)…
| Parameter | Type | Description |
|---|---|---|
expectations * | string | JSON string defining expected state. Format: {"obj_name": {"position": [x,y,z], "bbox_max": [x,y,z], ...}} Supported properties: position, bbox_max, bbox_min, exists, material. Position and bbox value… |
format | string | Output format - "cos" or "json". |
session_key | Maya session key. |
scene_validate Scene Validate
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).
| Parameter | Type | Description |
|---|---|---|
rules * | string | JSON string with constraint rules. Format: [{"type": "min_clearance", "zone": "entrance", "value": 180}, {"type": "max_objects", "value": 5000}, {"type": "no_overlap", "objects": ["wall_a", "shelf_b… |
format | string | Output format - "cos" or "json". |
session_key | Maya session key. |
scene_checkpoint Scene Checkpoint
Save the current scene to a `.ma` file on disk under checkpoints/. 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=Tr…
| Parameter | Type | Description |
|---|---|---|
name | Checkpoint name (^[A-Za-z0-9_-]+$). Required when the scene was never saved to disk. | |
overwrite | boolean | Replace a same-name checkpoint, preserving the old file. |
session_key | Maya session key. |
scene_rollback Scene Rollback
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) a…
| Parameter | Type | Description |
|---|---|---|
filename * | string | Checkpoint filename from scene_checkpoint_list (cp_*.ma or prev_*.ma). |
discard_current_state | boolean | Escape hatch — proceed even if saving the current scene fails. |
session_key | Maya session key. |
scene_checkpoint_list Scene Checkpoint List
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).
| Parameter | Type | Description |
|---|---|---|
session_key | Maya session key. |
camera_create Camera Create
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.
| Parameter | Type | Description |
|---|---|---|
target * | string | Target object name to look at. |
azimuth | number | Horizontal angle in degrees (default 30). |
elevation | number | Vertical angle in degrees (default 15). |
name | string | Camera name. |
session_key | Maya session key. | |
shot_type | string | Shot type (default "medium"). |
camera_orbit Camera Orbit
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).
| Parameter | Type | Description |
|---|---|---|
center * | string | Orbit center as a JSON string "[x, y, z]". |
frames | integer | Number of frames for one full orbit. |
name | string | Camera name. |
radius | number | Orbit radius in scene units. |
session_key | Maya session key. |
scene_aesthetics Scene Aesthetics
Score the scene's look on 5 design dimensions. Scores the scene's look across 5 design dimensions: 1. Color Theory: 60-30-10 rule, temperature balance, harmony type, saturation variety, contrast 2. Spatial Composition: golden ratio proportions, rule-of-thirds alignment, visual weight balance 3. Proportion & Scale: human ergonomic reference, size hierarchy (hero/secondary/tertiary) 4. Lighting Quality: layer composition (key/fill/rim/accent), color temperature consistency 5. Visual Flow: sight line clarity, circulation paths, visual rhythm patterns Returns an overall score (0-100) with grade…
| Parameter | Type | Description |
|---|---|---|
format | string | Output format - "json" (default) or "cos" (a short score summary: the overall score, each dimension's score, and the suggestions). |
session_key | Maya session key. |
scene_review Scene Review
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 `_mcp_scene.register_validator(...)` (call it through execute_code) are reported in a separate "custom" section - `validators` per rule, `score`/`max_score` in weight points, `issues` for what did not pass. The built-in score is unchanged and the s…
| Parameter | Type | Description |
|---|---|---|
checks | string | Comma-separated check names or "all". Options: spatial, overlaps, zones, aesthetics, constraints, orphans, naming, components, conflicts, lighting, organization |
format | string | Output format - "json" or "cos". |
session_key | Maya session key. |
scene_plan Scene Plan
Plan a scene layout: organization checks plus layout suggestions. Checks the scene and produces an actionable plan: - Organization check: finds orphan meshes, empty groups, default names - Zone analysis: coverage and spatial balance across zones - Layout suggestions: spacing, overlap, and clustering detection - Conflict prevention: predicts near-miss collisions - Action plan: prioritized step-by-step execution guide 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 n…
| Parameter | Type | Description |
|---|---|---|
auto_fix | boolean | If True, auto-fix safe issues (remove empty groups, reparent orphans). |
format | string | Output format - "json" (default) or "cos". |
objective | string | Natural language goal description. e.g., "set up entrance area with display window and clear circulation" |
recommend_assets | boolean | If True, attach advisory Poly Haven model recommendations across the mapped built-in zones (entrance, display, furniture, lighting; shell/ip_core/path skipped) to the plan. This reaches the Poly Haven… |
session_key | Maya session key. |
scene_viewport_snapshot Scene Viewport Snapshot
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…
| Parameter | Type | Description |
|---|---|---|
format | string | "jpeg" (default, small) or "png". png recommended for wireframe/line-art review. |
max_size | integer | Longest-side pixel cap for the returned image (default 800 - keeps base64 well under client image token limits). |
quality | integer | JPEG quality 1-100 (ignored for png). |
session_key | Maya session key. |
scene_render_preview Scene Render Preview
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): 1. Switching the panel camera via the modelPanel camera flag is instantaneous, visible, and NOT undoable in Maya. 2. Everything is put back: the panel camera is restored on every path -…
| Parameter | Type | Description |
|---|---|---|
camera | Camera to look through (default: the panel's current camera). | |
format | string | "jpeg" (default) or "png". png recommended for wireframe/line-art review. |
height | integer | Frame height (default 360). Same /4 rule. |
max_size | integer | Longest-side cap for the returned image. |
quality | integer | JPEG quality 1-100. |
session_key | Maya session key. | |
width | integer | Frame width in pixels (default 640). Rounded UP to a multiple of 4 server-side (playblast constraint); the actual size may also be clamped by the viewport - trust the returned metadata, not the reques… |
asset_search Asset Search
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.
| Parameter | Type | Description |
|---|---|---|
asset_type | string | "models" (default), "hdris", or "textures". Note: asset_import handles models only. |
limit | integer | Result cap, 1-20 (default 20). total_count always reports the full match count. |
query | string | Free-text search (matches id, name, categories, tags). Empty returns the unfiltered index page (up to limit). |
asset_import Asset Import
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) -…
| Parameter | Type | Description |
|---|---|---|
asset_id * | string | Poly Haven asset id (case-sensitive, e.g. 'Camera_01'). |
allow_high_polycount | boolean | Override the polycount guard (the override is written to the call record). |
force | boolean | Re-import even when GRP_asset_<id> already exists. |
max_polycount | integer | Face-count guard (default 100000); imports over the limit are deleted and rejected. |
resolution | string | Texture tier '1k' (default), '2k', '4k', '8k'. |
session_key | Maya session key. |
scene_export Scene Export
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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Target file path on the Maya host. Normalized and auto-parented (missing directories are created). An existing file is rejected unless overwrite=True. |
format | "fbx", "obj", or "usd". Optional when the path carries a recognizable extension; a missing extension is appended for an explicit format, and a conflicting extension+format pair is an error, never a gu… | |
objects | Node names to export. None (default) exports the whole scene via exportAll; a list is pre-validated (any missing name aborts - no partial export) and drives exportSelected. | |
overwrite | boolean | Replace an existing target file (default False). |
session_key | Maya session key. |
scene_describe Scene Describe
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.
| Parameter | Type | Description |
|---|---|---|
node * | string | Node name (short name or long DAG path). |
attrs | Attribute names to describe; None (default) lists every attribute listAttr reports UP TO the response budget (limit) - over-budget output is truncated and disclosed via attrs_truncated + total_count,… | |
include_connections | boolean | Return connection wiring {src_plug, dst_plug, direction} (default True); the same budget applies (connections_truncated + total_connections; no cursor in v1 - narrow and re-query). |
include_values | boolean | Also return value + soft_min/soft_max per attr (default False). Reading a value can trigger DG evaluation inside Maya - still read-only, but the eval may cost time on heavy graphs. |
limit | integer | Max items returned per face (attrs and connections). Soft default 200; a caller may relax explicitly to the hard cap 1000 - bounds response size only, not the per-attribute query cost. |
session_key | Maya session key (auto-selected if one session). |
scene_nodes Scene Nodes
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).
| Parameter | Type | Description |
|---|---|---|
cursor | Opaque page token from a previous call's next_cursor; valid while the scene is unchanged. | |
dag_only | boolean | Only DAG nodes (transforms/shapes); False includes dependency nodes such as materials and utility nodes. |
include_type_counts | boolean | Also return per-type counts over the full match set (not just the page). |
inherited | boolean | See type. |
limit | integer | Page size (default 50, hard-capped at 100). |
pattern | Maya glob pattern on names (e.g. "GEO_*"). | |
session_key | Maya session key (auto-selected if one session). | |
type | Node type filter. With inherited=True (default) derived types match too (ls type= semantics, e.g. type="light" matches spotLight/directionalLight); inherited=False pins the exact type. |
list_sessions List Sessions
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: - session_key: Session key used to interact with tools and resources - host: Session host address - port: Session port number - pid: Maya process ID - user: Logged-in user - maya_version: Maya version string - scene_name: Current scene filename - scene_path: Full path to current scene Note: To detect new or removed sessions, clients shou…
maya_setup_guide Maya Setup Guide
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.
| Parameter | Type | Description |
|---|---|---|
action | string | What to do: - "diagnose": Run connection diagnostics and return status - "install": Merge the managed block into userSetup.py. Existing files without the block require a second call with confirm=T… |
confirm | boolean | Required to write into an existing userSetup.py that has no mcp-for-maya managed block (first install call is dry-run). |
dry_run | boolean | Preview the install: return the proposed block without writing anything. |
port | integer | Maya command port number (default: 7001) |
remove_empty_file | boolean | On uninstall, delete the file when it only contained the managed block. |
target_version | Specific Maya version (e.g., "2024"). If None, targets all detected versions. |
write_module Write Module
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, an…
| Parameter | Type | Description |
|---|---|---|
code * | string | Python source code for the module. |
name * | string | Module name. Can be a dotted path (e.g., 'mypackage.utils') in which case parent packages are created automatically. |
overwrite | boolean | If True, overwrite and replace existing module. If False, raise error if module already exists. |
session_key | Maya session key (optional if only one active session exists). |
execute_code Execute Code
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/collection…
| Parameter | Type | Description |
|---|---|---|
code * | string | Python code to execute in Maya. |
result_type | string | Return envelope handling for the execution result: - "NONE": Execute statements, don't capture result (returns None) - "JSON": Evaluate expression, JSON-encode result - "RAW": Evaluate expression, ret… |
session_key | Maya session key (optional if only one session exists). |
add_session Add Session
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.
| Parameter | Type | Description |
|---|---|---|
host | string | The session host (default: "127.0.0.1") |
port | integer | The session port number (default: 7001) |