
mcp-for-maya
io.github.Xxx91n由 GitHub 帳號 Xxx91n 發布v0.7.0更新於 Oct 30, 2026
AI agents' spatial awareness inside Autodesk Maya: audit, rollback safety, visual loop (Beta)
概覽
讓 AI 代理透過本機命令埠檢查、規劃、建模並審查 Autodesk Maya 3D 場景的 MCP 伺服器。
- 可以做什麼
- 讀取與量測場景:整場景空間快照、物件檢查、間距與重疊量測、節點與場景圖檢視
- 規劃與審查:場景規劃、11 項確定性檢查並給出 0-100 評分、自訂規則驗證與狀態斷言
- 建構與修改:在 Maya 中執行任意 Python、注入可重用模組,以及建立攝影機與環繞動畫
- 保護成果:記憶體檢查點、回復與檢查點清單
- 截圖與匯出:GUI 工作階段下的視埠截圖與單格算圖預覽,以及 FBX/OBJ/USD 匯出
- 取得資產與管理連線:Poly Haven 模型搜尋與匯入,以及 Maya 工作階段探索與安裝引導
- 適用情境
- 適合希望助理在執行中的 Maya 工作階段裡完成 3D 建模、場景配置、攝影機設定或品質審查,並依空間與工程檢查驗證自身變更、而非盲目修改的情況。
- 執行需求
- 本機 Python 套件(需 Python 3.10 以上),以 uvx 或 pip 執行,支援 Windows、Linux、macOS。需要 Autodesk Maya 2023 或更新版本並開啟 Python 命令埠(例如 7001),可手動設定或透過安裝引導。視覺截圖工具需要 GUI 版 Maya 工作階段。另有選用環境變數可調整埠掃描與策略模式。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 mcp-for-maya,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
English | 简体中文
[mcp-for-maya — Give AI agents eyes inside Autodesk Maya]
mcp-for-maya
MCP server giving AI agents spatial awareness of Autodesk Maya scenes
[CI] [PyPI] [License: MIT] [Python]
What this is
mcp-for-maya is a Model Context Protocol (MCP) server that lets LLM agents (Codex, Claude, etc.) drive Autodesk Maya for 3D modeling, scene planning, and engineering-grade delivery.
Forked from chadrik/maya-mcp-server. The fork keeps the upstream connection stack and adds a scene-intelligence layer: spatial awareness, deterministic auditing, transactional safety, and a visual loop. The agent stops writing blind — it reads spatial state, materials, and object relationships, then verifies changes against engineering rules.
[Live Demo — captured by the product itself][!WARNING] This server executes arbitrary Python inside Maya — a designed capability, not a bug. The validation / rate-limit / audit pipeline is a safety net for accidents and injected instructions, not a boundary against a malicious client; the connected agent is trusted. See docs/threat-model.md.
Every asset below is a real capture produced by this project's own tool chain — no mockups: scenes were built procedurally through execute_code / write_module (plus one live asset_import), frames rendered through scene_render_preview, the audit pair via scene_review + scene_viewport_snapshot, and the orbit sequence captured frame-by-frame with playblast (Maya 2024 GUI session).
[movement orbit — 20 real playblast frames, 120° sweep]
Reproduce every frame with the scripts in .github/assets-src/.
vs blender-mcp
Three-tier comparison with ahujasid/mcp-for-blender (measured 2026-09):
Poly Haven model search + import shipped in 0.2.0 (issue #2 thin slice: FBX + texture wiring; HDRIs and texture packs remain roadmap). AI generation and first-class object CRUD are out of scope — the latter is already covered by execute_code.
On the shared asset-download path, this project's controls are enforced in code: downloads happen host-side only — https + host allowlist, per-file md5, size caps, filenames sanitized from the URL's last segment (polyhaven.py) — and Maya itself never touches the network. Enforcement detail: docs/threat-model.md.
25 MCP tools in total.
[Quick Start]1. Install
[!NOTE] Three-layer naming: dist name
mcp-for-maya(PyPI shelf name) → installs import packagemaya_mcp_server(kept from upstream); script namemcp-for-maya(old namemaya-mcp-serverremains as a compat alias).uvx mcp-for-mayaresolves precisely because the command name matches the dist name.
2. Connect Maya
Option A: automatic (recommended)
With the MCP server running, the agent calls maya_setup_guide to walk the connection:
- Make sure Maya is running
- Give the agent any instruction (e.g. "look at my Maya scene")
- If unconnected, the agent runs diagnostics and can install
userSetup.py(idempotent marker-block merge, timestamped backup before writing) - After restarting Maya, the command port opens automatically
Option B: manual
In Maya's Script Editor (Python mode, not MEL):
Option C: persistent auto-connect
Save this as userSetup.py in your Maya scripts directory:
Multiple Maya instances
A commandPort is a single listening socket bound to one host:port — a second instance fails to bind the same port, so each Maya instance needs its own port. Typical topology:
Run cmds.commandPort(name=":<port>", sourceType="python") inside each instance (its Script Editor or its own userSetup.py). Auto-scan is the primary path — the server periodically enumerates listening Maya ports and bootstraps them; if a session is missed, add_session(host, port) is the manual fallback. If scanning probes a non-Maya TCP service on the box, bound the probe set with MAYA_MCP_INCLUDE_PORTS=7001,7002 (comma-separated, 7005-7010 ranges allowed) or exclude offenders via MAYA_MCP_EXCLUDE_PORTS=<port>.
Note: a commandPort does not persist across sessions — it dies with Maya; for persistence write it into userSetup.py (Option C).
Troubleshooting
3. Configure the MCP client
Codex ~/.codex/config.toml:
For the git source use args = ["--from", "git+https://github.com/Xxx91n/mcp-for-maya.git", "mcp-for-maya"]; for a source checkout use command = "python", args = ["-m", "maya_mcp_server"], and point PYTHONPATH at <repo>/src under env.
4. Use it
Talk naturally:
"Look at what's in my Maya scene, then create a display shelf at the entrance"
The agent calls scene_snapshot() → understands the scene → models → scene_review() audits the result.
Every scene modification follows the ICEV loop (also shipped as an agent process card, see skills/icev-workflow):
- INSPECT:
scene_snapshot()for full-scene spatial data - COMPUTE: plan positions, sizes, clearances from that data
- EXECUTE:
execute_code()applies Maya Python - VERIFY:
scene_assert()+scene_review()confirm the result; on GUI sessions the visual tools give pixel-level confirmation
Tools reference
Spatial
Audit
Cameras
Disaster recovery
Assets (Poly Haven, host-side download)
Scene export
Visual loop (GUI sessions only)
CoS notation
Default output uses Chain-of-Symbol notation to compress scene data. The format's paper reports ~65% token savings vs JSON on its demo scenes (arXiv:2305.10276, −65.8%) — this project implements the notation; that figure is the paper's measurement, not a benchmark of this project.
Agent skills
Two Experimental process cards ship in skills/:
[Audit & Trust]Evaluated on Claude Code only; untested on Codex/Gemini CLI/Cursor. Cross-model evaluation is tracked in issue #3.
scene_review() provides 11 universal checks (score normalized to 0-100):
Trust & privacy
- Zero telemetry: no phone-home — the project ships no telemetry or unsolicited outbound traffic; verify in source. The ONLY outbound calls are the two asset tools: HTTPS to
api.polyhaven.com/dl.polyhaven.org|.com(host allowlist + md5 + size caps inpolyhaven.py), and only when you call them. - Local, single-user: the command port binds localhost only; the connected MCP client is trusted.
- Safety net: a unified pipeline (
pipeline.py+security.py) validates arguments + token-bucket rate limits (~100/60s reads, ~20/60s writes, per session) + pattern scan (warn-only by default) + an independent JSONL audit log across all 25 tools. It catches accidents, not malicious clients — full model in docs/threat-model.md. - Transactional safety:
scene_checkpoint/scene_rollbackgive in-memory snapshots and explicit rollback (no undo history; references flattened). - Strict policy mode (optional): set
MAYA_MCP_DISABLE_EXECUTE=1,MAYA_MCP_DISABLE_WRITE_MODULE=1, orMAYA_MCP_DISABLE_ARBITRARY=1(all three) to remove the escape-hatch tools fromtools/listand deny the call with[policy_disabled]. Read-only tools are unaffected. These are misuse guardrails, not a hostile-agent boundary — an agent that still holdsexecute_codeis already inside the trust boundary; what they buy is a smaller blast radius for a demo, a mistake, or a CI sandbox. Rationale: docs/threat-model.md. Per-code reference: docs/guide/error-codes.md. safe_modeAST gate (optional): setMAYA_MCP_SAFE_MODE=1(default off) and the two code-bearing tools stay listed but theircodepayloads pass a deny-by-default AST allowlist: v1 import roots (maya/math/json/re/collections/itertools/functools/dataclasses/typing), no denied builtin names — every reference rejects, not just calls (eval/exec/open/__import__/getattr/setattr/…), no__builtins__, no dunder attribute access, and unparseable input rejects ("cannot decide ⇒ deny"). Rejections raise[safe_mode_rejected](a hostisErrorfailure) naming the rule id and are auditedrejected; successful responses carrymode: "safe"and the tool descriptions gain oneBoundary:line. DISABLE flags still remove tools first — safe_mode only narrows what remains. Same posture as the DISABLE flags: a safety net, not a boundary. Rationale: docs/threat-model.md. Per-code reference: docs/guide/error-codes.md.- Vulnerability reporting: SECURITY.md.
Versioning
This project follows Semantic Versioning:
- 0.x (through 0.3.x, Alpha): the tool surface could still change; minor bumps carried features, no compatibility freeze.
- Beta (0.4.0 onward; current release 0.7.0): feature-complete tier — external testing begins here (classifier
4 - Beta). - 1.0.0: public API freeze — tool surface and output schemas stable per semver; breaking changes require 2.0.0. Promoted together with the
5 - Production/Stableclassifier in one commit; gated by the #7 real-machine checklist.
The public API is the MCP tool surface: tool names, their input/output shapes, the two-layer error contract (host isError failures vs {error:{code,message,suggestion}} domain results), and tool-annotation semantics (docs/threat-model.md §5). Additive changes (new tools, new optional response fields) ship as minor releases; breaking changes ship as a major bump. 1.0.0 freezes this surface — it is not a quality certification; the remaining real-machine verification surface is tracked explicitly in #7.
Releases are milestone-driven — no fixed cadence. Roadmap lives in GitHub issues: #2 Poly Haven integration (model slice shipped in 0.2.0; scene_plan recommendation residual split to #31), #3 Skills program (v1.x), #4 security & permission model (v1.x), #5 scene export + introspection (both shipped in 0.3.0), #6 more asset sources (exploratory), #7 real-machine checklist + v1.0 feedback (pinned).
Requirements
The two visual-loop tools need a GUI session (headless/mayapy returns a structured capability error). On the first capture the server probes the VP2 readback direction per-session (a disposable scene probe, net-zero side effects); MAYA_MCP_VP2_BOTTOM_UP=0|1 forces it when a driver misreports.
Development
See CONTRIBUTING.md for the PR flow and CHANGELOG.md for the change log.
Credits
Forked from chadrik/maya-mcp-server — upstream MIT copyright retained (see LICENSE); this project adds the scene-intelligence layer on top of its connection stack.
How each upstream open issue maps to a disposition and release version in this fork: docs/upstream-issue-status.md.
來源:README.md,提交 f5a3858
工具
0版本歷史
3- v0.7.0最新Oct 29, 2026
- v0.6.0Oct 26, 2026
- v0.5.0Sep 30, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分