mcp-for-maya is a Model Context Protocol (MCP) server that allows AI agents (such as Codex and Claude) to drive Autodesk Maya to complete modeling, scene planning, and production tasks. Its core capability is to stop AI from blindly writing code and instead let it view objects, materials, and spatial layout in the scene at any time, and check its own modifications against fixed rules.
Main capabilities
- Spatial awareness: AI can obtain spatial data of the scene through scene_snapshot(), including object positions, dimensions, and spacing.
- Scene editing and validation: Follow the ICEV workflow (Inspect, Compute, Execute, Verify), use execute_code() to run Maya Python code, and validate results through scene_assert() and scene_review().
- Scene auditing: scene_review() provides 11 fixed checks and a normalized score (0-100) based on rule weights.
- Camera planning and aesthetic analysis: The toolset includes related functions (specific details are not expanded in the materials).
- Asset download: Supports downloading assets from Poly Haven (host-side download), accessing api.polyhaven.com and dl.polyhaven.org|.com via HTTPS only when invoked, with domain whitelisting, MD5 verification, and size limits.
- Disaster recovery: scene_checkpoint and scene_rollback can save the scene as a .ma file and roll back (checkpoints do not preserve undo history, and file references are flattened).
- Output format: Uses CoS (Chain-of-Symbol) notation by default, representing scene data in short text lines, reported in the paper to save about 65% of tokens compared with JSON in demonstration scenes (arXiv:2305.10276). The first line ends with MODIFIED=y|n, indicating whether the scene has unsaved changes.
Usage
- Start the MCP server: After running the server, the agent automatically calls maya_setup_guide to guide the connection.
- Connect to Maya: Ensure Maya is open and issue instructions to the agent (such as "check my Maya scene"). If not connected, the agent runs diagnostics and can install userSetup.py (safely merged and backed up). After restarting Maya, the command port opens automatically. You can also run cmds.commandPort(name=":<port>", sourceType="python") in the Maya Script Editor; each Maya instance needs to use a separate port.
- Configure the MCP client: For example, configure it in Codex's ~/.codex/config.toml. For git source installation: args = ["--from", "git+https://github.com/Xxx91n/mcp-for-maya.git", "mcp-for-maya"]; local build: command = "python", args = ["-m", "maya_mcp_server"], and set PYTHONPATH in env to point to <repo>/src.
- Get started: converse in natural language within the agent, e.g. "Check what's in my Maya scene, then build a display stand at the entrance." The AI will call scene_snapshot() to inspect the scene, build the model, then use scene_review() to check the result.
Use cases
- AI-assisted Maya modeling and scene setup.
- Production workflows that require the AI to understand scene spatial relationships and automatically verify modifications.
- Restricting the scope of AI operations in demos, tests, or CI sandboxes.
Limitations and security
- Security model: The server is designed to run Python code directly inside Maya; see docs/threat-model.md. The command port binds only to localhost, and connected MCP clients are trusted not to act maliciously.
- Safeguards: The pipeline (pipeline.py + security.py) checks arguments, applies rate limits (about 100 reads/60 seconds, about 20 writes/60 seconds per session), scans patterns, and logs one line of JSON per call. Some exact patterns are blocked outright (e.g. os.system, bare subprocess), while broader patterns only log warnings.
- Strict policy mode (optional): Setting MAYA_MCP_DISABLE_EXECUTE=1, MAYA_MCP_DISABLE_WRITE_MODULE=1, or MAYA_MCP_DISABLE_ARBITRARY=1 removes code execution tools, while read-only tools remain available.
- safe_mode code allowlist (optional): After setting MAYA_MCP_SAFE_MODE=1 (off by default), code arguments must pass an allowlist check; imports are limited to standard packages (maya, math, json, re, collections, itertools, functools, dataclasses, typing), blocking eval, exec, open, import, getattr, setattr and other built-in functions, denying access to builtins or double-underscore attributes, and immediately rejecting input that cannot be parsed.
- No telemetry: No tracking and no data sent back; only the asset tools make external network requests when called.
- Transactional safety: Checkpoint files do not retain undo history, and file references are flattened.
- Project status: Forked from chadrik/maya-mcp-server, retaining the MIT license. See CONTRIBUTING.md for the contribution process, CHANGELOG.md for the changelog, and SECURITY.md for vulnerability reports.
Tool count
There are 25 MCP tools in total, covering spatial awareness, disaster recovery, asset downloads, visual inspection (GUI sessions only), and more.