Skip to main content
Glama

maya-mcp

用 AI agent(ZCode / Codex / OpenCode / Claude Code / Cursor 等)控制 Autodesk Maya 的 MCP 服务器。

  • 架构:Maya 内 Python 插件(TCP 客户端,常驻)↔ 独立 MCP 服务器(FastMCP 4.x)↔ AI 客户端

  • 工具面:混合式——语义工具(场景/对象/材质/动画/渲染)+ execute_python/execute_mel 逃生舱 + 只读 resources

  • 兼容:Maya 2022-2025(插件按 Py3.7 语法上限编写,实测 Maya 2023/Py3.9 通过);服务器端 Python 3.10+

  • transport:默认 stdio,可选 Streamable HTTP

完整技术选型与搭建流程见 Maya-MCP搭建计划书.md; 用户手册见 docs/user-guide.md; 协议规格见 protocol/PROTOCOL.md; 设计决策见 docs/设计规约.md; 开发环境部署见 docs/环境部署说明.md。

快速开始(用户)

pip install maya-mcp
maya-mcp install-maya        # 安装 Maya 侧插件(重启 Maya 生效)
maya-mcp install-clients     # 配置 AI 客户端
maya-mcp doctor              # 自检整条链路

详见 docs/user-guide.md。

Related MCP server: MayaMCP

快速开始(开发)

# 1) 准备服务器端环境(Python 3.10+)
conda create -n maya-mcp python=3.12 -y
conda activate maya-mcp
python -m pip install -r requirements.txt -r requirements-dev.txt

# 2) 验证
python -m pytest -q          # 含 Py3.7 语法门禁 + 协议契约测试
ruff check maya_mcp tests
mypy

# 3) 运行服务器
python -m maya_mcp            # stdio(默认)
python -m maya_mcp --http     # Streamable HTTP,绑 127.0.0.1

Maya 插件端无需 pip 环境(仅标准库 + Maya 自带 PySide2/6),由 Maya 解释器加载; 开发期可在 Maya Script Editor 的 Python 标签页执行(务必带 encoding="utf-8",中文 Windows 下否则会报 GBK 解码错误):

MAYA_MCP_REPO = r"D:/project/maya-MCP"
exec(open(MAYA_MCP_REPO + "/maya_mcp_plugin/dev_load.py", encoding="utf-8").read())

目录

路径

说明

maya_mcp/

MCP 服务器(Python 3.10+,FastMCP 4.x)

maya_mcp_plugin/

Maya 插件(Python 3.7+,PySide2/PySide6)

protocol/

协议规格唯一真源 + JSON Schema

tests/

unit(含 Py3.7 门禁)/ contract / integration

docs/

计划书、环境部署、设计规约、审查报告

状态

M0 + M1 + M2 + M3 全部完成(2026-09-11),并在真实 Maya 2023(Python 3.9.7)上端到端验证通过。

35 个工具,按组渐进暴露(默认只显示 core 的 22 个,用 manage_tools 开启其余):

组

数量

工具

core(默认)

22

maya_ping、list_sessions、set_active_instance、execute_python、execute_mel、scene_new/open/save、get_scene_info、get_selection、select_objects、create_primitive、list_objects、get_attributes、set_attributes、delete_objects、parent_object、duplicate_object、rename_object、manage_tools、capture_viewport、view_image

authoring

5

create_material、assign_material、list_materials、set_material_color、import_reference_image

animation

4

set_keyframe、get_keyframes、set_timeline、playblast

rendering

4

start_render、get_job_status、cancel_job、list_jobs

其他能力:

  • 视觉能力:capture_viewport 截图视口返回给 agent(可看图迭代建模)、view_image 查看本地参考图、import_reference_image 把参考图作为 imagePlane 导入场景

  • MCP resources:maya://sessions、maya://scene/info、maya://editor/selection、maya://node/{path}/attributes(只读增强,均有等价工具)

  • 多 Maya 实例:首个连接自动成为活动实例,set_active_instance 切换,session_key 精确路由;同 PID 重连自动替换僵尸会话

  • 渲染 job:start_render 提交后立即返回 job_id,get_job_status 轮询;Maya 端逐帧在主线程推进,不阻塞其他调用

  • 安装与诊断:install-maya(.mod + 托管 userSetup 块)、install-clients(六客户端,最小改键/幂等/原子写/备份)、doctor(分层自检)

  • 测试:219 项通过(unit + contract + integration),ruff / mypy strict 全绿

真机验证:工具分组开关、材质创建与指定、关键帧读写、playblast、渲染 job 轮询到 done 且期间其他调用不阻塞、插件自动重连、僵尸会话清理——全部实测通过。

下一步:可选项——提交 git 存档、发布 PyPI、补充更多领域工具。

安全要点

  • 本地 TCP 通道自带随机令牌认证(~/.maya-mcp/token)。

  • HTTP transport 默认只绑 127.0.0.1;绑非 loopback 必须显式 --allow-remote 且启用认证。

  • execute_python 逃生舱:危险模式需显式开启、变更默认包 undo、可整体 --no-execute-python 禁用。

  • 详见 protocol/PROTOCOL.md §8 与 docs/设计规约.md。

许可

MIT(待补 LICENSE 文件)。

Available Tools

22 tools
capture_viewportCapture ViewportA

Screenshot the Maya viewport and return the image so you can see the scene.

Use this to visually check modeling progress before/after making changes. The returned path is also included for reuse.

Inputs: camera, output, session_key.

create_primitiveCreate PrimitiveB

Create a polygon primitive (cube/sphere/cylinder/cone/plane/torus).

Inputs: type (required), name, size, scale, +4 more. Returns: object

delete_objectsDelete ObjectsC

Delete nodes by name or wildcard pattern.

Inputs: patterns (required), session_key. Returns: object

duplicate_objectDuplicate ObjectB

Duplicate a node, optionally renaming and reparenting the copy.

Inputs: node (required), name, parent, session_key. Returns: object

execute_melExecute MelB

Evaluate a MEL command inside Maya (escape hatch).

Inputs: cmd (required), undo, timeout_s, session_key. Returns: object

execute_pythonExecute PythonA

Run arbitrary Python inside Maya (escape hatch).

WARNING: this is NOT a security sandbox. It can read/write files and run system commands. Destructive patterns require allow_dangerous=True.

Inputs: code (required), undo, timeout_s, persistent, +3 more. Returns: object

get_attributesGet AttributesC

Read attributes of a node.

Inputs: node (required), attrs, session_key. Returns: object

get_scene_infoGet Scene InfoB

Summarize the current scene: name, path, units, fps, object count, references.

Inputs: session_key. Returns: object

get_selectionGet SelectionB

List the currently selected nodes.

Inputs: session_key, include_shapes. Returns: object

list_objectsList ObjectsC

List scene nodes, optionally filtered by type and name pattern.

Inputs: pattern, session_key, type_filter. Returns: object

list_sessionsList SessionsA

List connected Maya instances (session_key, versions, scene, tools, active).

Inputs: no named parameters. Returns: object

manage_toolsManage ToolsA

List or toggle tool groups.

Non-core groups (authoring/animation/rendering) start disabled to keep the tool list small; call with action='enable', group='authoring' to reveal them.

Inputs: action (required), tool, group. Returns: object

maya_pingMaya PingA

Check connectivity to a Maya instance and return basic instance info.

Use this to verify the server/plugin link before running other tools.

Inputs: session_key. Returns: object

parent_objectParent ObjectA

Parent a node under another, or unparent it to the world.

Inputs: child (required), parent, session_key. Returns: object

rename_objectRename ObjectC

Rename a node.

Inputs: node (required), new_name (required), session_key. Returns: object

scene_newScene NewC

Create a new, empty scene.

Inputs: force, session_key. Returns: object

scene_openScene OpenC

Open (or reference) a Maya scene file.

Inputs: path (required), force, reference, session_key. Returns: object

scene_saveScene SaveC

Save the current scene (optionally to a new path).

Inputs: path, force, session_key. Returns: object

select_objectsSelect ObjectsC

Select nodes by name or wildcard pattern.

Inputs: patterns (required), extend, session_key. Returns: object

set_active_instanceSet Active InstanceA

Choose which connected Maya instance handles calls that omit session_key.

Useful when several Maya instances are open.

Inputs: instance_id (required). Returns: object

set_attributesSet AttributesC

Set one or more attributes on a node.

Inputs: node (required), attrs (required), session_key. Returns: object

view_imageView ImageA

Display a local image file to yourself (e.g. a modeling reference).

Use when the user points you at a reference image: view it first, then model (optionally placing it in the viewport via import_reference_image).

Inputs: path (required), session_key.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 22 tools

    Disambiguation4/5

    Tools are largely distinct by resource and action, with clear separation between scene, object, selection, session, and viewport operations. Escape hatches (execute_python/execute_mel) conceptually overlap with all tools, and generic set_attributes/get_attributes slightly overlap with specific operations like rename_object, but descriptions clarify intended use.

    Naming Consistency4/5

    Most tools follow a verb_noun pattern (get_selection, set_attributes, create_primitive). Exceptions are scene_new/open/save (noun+verb) and maya_ping (noun prefix), but the pattern is still readable and mostly consistent.

    Tool Count4/5

    22 tools is on the heavy side, but the Maya automation domain is complex and the server provides manage_tools to disable non-core groups by default, keeping the effective list smaller. Each tool earns its place.

    Completeness4/5

    Core scene and object lifecycle, selection, sessions, viewport capture, and escape hatches are covered. Missing direct tools for rendering, animation, materials, and export, but execute_python/mel and toggleable tool groups allow workarounds.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to programmatically control Autodesk Maya via natural language using over 30 tools for 3D modeling, lighting, and animation. It connects through Maya's command port to facilitate procedural scene generation and complex production-ready workflows.
      1
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to control Autodesk Maya through natural language for scene creation, modeling, material assignment, and object manipulation.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables natural language control of Autodesk Maya through MCP, including scene queries, Python/MEL execution, viewport screenshots, tool invocation, and customizable body rigging.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Gives LLM agents spatial awareness inside Autodesk Maya, enabling scene inspection and measurement, aesthetic and engineering audits, camera planning, checkpoint/rollback safety, asset import, and viewport or render previews. Agents can also execute arbitrary Python in Maya to build and verify 3D scenes against engineering rules instead of writing blind.
      25
      262 PyPI
      7
      MIT