Skip to main content
Glama

📖 简介

3dsmax-mcp 是一个 MCP(Model Context Protocol)服务器,它在 AI 助手(如 Claude Desktop、Cursor、Windsurf 等)和 Autodesk 3ds Max 之间架起桥梁。

通过自然语言对话,你可以让 AI 直接操控 3ds Max —— 创建模型、设置材质、调整灯光、制作动画,甚至执行自定义脚本,无需手动编写任何代码。

工作原理

┌──────────────┐     MCP协议     ┌──────────────┐    TCP Socket    ┌──────────────┐
│  MCP 客户端   │ ◄────────────► │  3dsmax-mcp  │ ◄──────────────► │   3ds Max    │
│ (Claude 等)  │    stdio 通道   │  (MCP Server) │   127.0.0.1     │  (监听脚本)   │
└──────────────┘                └──────────────┘    :50007         └──────────────┘
  1. MCP 客户端(如 Claude Desktop)通过 MCP 协议与 3dsmax-mcp 服务器通信

  2. 3dsmax-mcp 将 AI 的指令转换为 Python 脚本

  3. 通过 TCP Socket(端口 50007)发送到 3ds Max 中的监听脚本执行

  4. 执行结果原路返回给 AI 助手


Related MCP server: MaxForge MCP

📋 系统要求

项目

要求

操作系统

Windows(3ds Max 仅支持 Windows)

Python

>= 3.10

3ds Max

需支持 Python 3 脚本(推荐 2022 及以上版本)

网络

3ds Max 与 MCP Server 需在同一台机器上运行

MCP 客户端

Claude Desktop / Cursor / Windsurf / 或其他支持 MCP 的客户端


🚀 快速开始

整个安装只需 两步:配置 3ds Max 端的监听脚本,然后配置 MCP 客户端。

第一步:在 3ds Max 中启动监听

你需要让 3ds Max 运行一个 Socket 监听脚本,这样 MCP Server 才能与之通信。

方式 A:自动启动(推荐)

将项目中的 startup_mcp_listener.ms 文件复制到 3ds Max 的启动脚本目录:

C:\Users\<你的用户名>\AppData\Local\Autodesk\3dsMax\<版本号>\ENU\scripts\startup\

💡 提示:放入该目录后,每次启动 3ds Max 会自动运行监听脚本,无需手动操作。

方式 B:手动启动

在 3ds Max 中执行以下任一操作:

  • 菜单方式:Scripting → Run Script → 选择 startup_mcp_listener.ms 文件

  • 拖拽方式:将 startup_mcp_listener.ms 直接拖拽到 3ds Max 视口中

  • 监听器方式:在 MAXScript Listener 中输入:

fileIn @"C:\你的路径\3dsMaxMCP\startup_mcp_listener.ms"

✅ 启动成功后,MAXScript Listener 中会显示:[3dsMaxMCP] MCP Socket Server 启动命令已发送

第二步:安装并配置 MCP 客户端

安装 3dsmax-mcp

提供以下三种安装方式:

通过 pip 安装(推荐):

pip install 3dsmax-mcp

通过 uvx 运行(免安装):

uvx 3dsmax-mcp

从源码安装(开发者):

git clone https://github.com/317431629/3dsMaxMCP.git
cd 3dsMaxMCP
pip install -e .

配置 MCP 客户端

编辑配置文件(通常位于 %APPDATA%\Claude\claude_desktop_config.json):

{
    "mcpServers": {
        "3dsmax-mcp": {
            "command": "uvx",
            "args": ["3dsmax-mcp"]
        }
    }
}

如果使用 pip 安装:

{
    "mcpServers": {
        "3dsmax-mcp": {
            "command": "3dsmax-mcp"
        }
    }
}

在 Cursor 的 Settings → MCP 中添加:

{
    "mcpServers": {
        "3dsmax-mcp": {
            "command": "uvx",
            "args": ["3dsmax-mcp"]
        }
    }
}

或使用 pip 安装后:

{
    "mcpServers": {
        "3dsmax-mcp": {
            "command": "3dsmax-mcp"
        }
    }
}

如果你是从源码克隆的项目:

{
    "mcpServers": {
        "3dsmax-mcp": {
            "command": "python",
            "args": ["-m", "max_mcp"],
            "cwd": "C:/你的路径/3dsMaxMCP"
        }
    }
}

第三步:开始使用 🎉

确保 3ds Max 已启动且监听脚本正在运行,然后在 MCP 客户端中用自然语言对话即可:

  • "在场景中创建一个球体,半径为 30"

  • "把 Box001 移动到坐标 (100, 0, 50)"

  • "给选中的对象创建一个红色金属材质"

  • "在第 0 帧和第 60 帧之间为球体做一个位移动画"

  • "保存当前场景到桌面"


🔧 工具参考

3dsmax-mcp 提供了 25 个工具,覆盖 3ds Max 的常用操作。以下是完整的工具列表和说明。

🎬 场景管理(Scene)

工具名

功能

关键参数

new_scene

新建空白场景

—

open_scene

打开场景文件

file_path: 文件路径

save_scene

保存当前场景

file_path: 保存路径(可选,留空则覆盖保存)

get_scene_info

获取场景信息(对象数、文件路径等)

—

get_scene_objects

获取场景中所有对象的列表

—

import_file

导入外部文件到场景

file_path: 文件路径

export_file

导出场景到文件

file_path: 导出路径

📦 对象操作(Object)

工具名

功能

关键参数

create_object

创建几何体

object_type: 类型(Box/Sphere/Cylinder 等), position: 位置, params: 参数 JSON

delete_object

删除对象

object_name: 对象名称

clone_object

克隆对象

object_name: 源对象名称

rename_object

重命名对象

object_name: 当前名称, new_name: 新名称

set_object_transform

设置对象变换(位置/旋转/缩放)

object_name, position, rotation, scale

set_object_property

设置对象属性

object_name, property_name, property_value

get_object_properties

获取对象的详细属性

object_name: 对象名称

select_objects

选择对象

object_names: 对象名称列表

add_modifier

添加修改器

object_name: 对象名称, modifier_type: 修改器类型

🎨 材质(Material)

工具名

功能

关键参数

create_material

创建材质

material_type: 类型(Standard/Physical 等), diffuse_color: 颜色, params: 参数 JSON

assign_material

将材质分配给对象

object_name: 目标对象, material_name: 材质名称

💡 灯光(Light)

工具名

功能

关键参数

create_light

创建灯光

light_type: 类型(Omni/FreeSpot/Skylight 等), position, color, intensity

🎞️ 动画(Animation)

工具名

功能

关键参数

set_keyframe

设置关键帧

object_name, frame, position, rotation, scale

set_time_range

设置动画时间范围

起始帧、结束帧

🔧 通用工具(Utils)

工具名

功能

关键参数

execute_maxscript

执行 MAXScript 代码

script: MAXScript 代码字符串

execute_python_script

执行 Python 脚本

script: Python 代码字符串

get_max_version

获取 3ds Max 版本信息

—


💡 使用示例

场景搭建

用户:帮我创建一个简单的桌子场景。桌面是一个扁平的 Box,四条腿也是 Box。

AI 会依次调用:
  → create_object(object_type="Box", name="TableTop", position="0,0,75", params='{"length":120,"width":80,"height":5}')
  → create_object(object_type="Box", name="Leg_FL", position="-50,-30,0", params='{"length":5,"width":5,"height":75}')
  → create_object(object_type="Box", name="Leg_FR", position="50,-30,0", params='{"length":5,"width":5,"height":75}')
  → create_object(object_type="Box", name="Leg_BL", position="-50,30,0", params='{"length":5,"width":5,"height":75}')
  → create_object(object_type="Box", name="Leg_BR", position="50,30,0", params='{"length":5,"width":5,"height":75}')

材质与灯光

用户:给桌面创建一个木质感的棕色材质,然后在桌子上方添加一盏暖黄色的灯。

AI 会依次调用:
  → create_material(material_type="Standard", name="WoodMat", diffuse_color="139,90,43")
  → assign_material(object_name="TableTop", material_name="WoodMat")
  → create_light(light_type="Omni", name="TableLight", position="0,0,200", color="255,235,200", intensity="1.2")

关键帧动画

用户:让球体从位置 (0,0,0) 在 60 帧内移动到 (100,0,50),同时旋转 360 度。

AI 会依次调用:
  → set_keyframe(object_name="Sphere001", frame="0", position="0,0,0", rotation="0,0,0")
  → set_keyframe(object_name="Sphere001", frame="60", position="100,0,50", rotation="0,0,360")
  → set_time_range(...)  // 设置播放范围为 0-60

执行自定义脚本

用户:把所有 Box 对象的线框颜色设为红色。

AI 会调用:
  → execute_maxscript(script="for obj in objects where classOf obj == Box do obj.wireColor = color 255 0 0")

❗ 常见问题

连接问题

请依次检查:

  1. 3ds Max 是否正在运行? —— 必须先启动 3ds Max

  2. 监听脚本是否已执行? —— 检查 MAXScript Listener 中是否有 [3dsMaxMCP] MCP Socket Server 启动命令已发送 的提示

  3. 端口是否被占用? —— 默认使用端口 50007,确保没有其他程序占用

  4. 防火墙设置 —— 某些安全软件可能阻止本地 Socket 通信,请添加例外

默认 Socket 超时时间为 60 秒。如果你的操作需要更长时间(如复杂渲染或大场景处理),可能会超时。建议:

  • 将复杂操作拆分为多个简单步骤

  • 避免在 MCP 工具中执行渲染等耗时操作

安装问题

uvx 是 uv 工具的一部分。安装方法:

# Windows (PowerShell)
irm https://astral.sh/uv/install.ps1 | iex

# 或通过 pip
pip install uv

理论上支持所有内置 Python 3 的 3ds Max 版本(2022 及以上)。推荐使用 3ds Max 2024 及以上版本,Python 环境更稳定。

使用问题

当前版本默认连接 127.0.0.1:50007,仅支持单实例。如需多实例支持,需要修改监听端口配置。

支持!create_material 和 create_light 工具可以创建第三方插件提供的材质和灯光类型(如 VRayMtl、VRayLight),前提是 3ds Max 中已安装对应插件。对于更复杂的操作,可以使用 execute_maxscript 或 execute_python_script 工具直接执行自定义脚本。


🏗️ 项目结构

3dsMaxMCP/
├── max_mcp/                        # Python 包主目录
│   ├── __init__.py                 # 包入口
│   ├── __main__.py                 # python -m max_mcp 入口
│   ├── server.py                   # MCP Server 核心实现
│   ├── OperationManager.py         # 工具注册与管理
│   ├── log.py                      # 日志管理
│   ├── connector/                  # 通信层
│   │   ├── max_connection.py       # MCP Server → 3ds Max 的 TCP 客户端
│   │   └── max_server_listener.py  # 3ds Max 端的 TCP 监听服务(在 Max 内运行)
│   ├── max_tools/                  # 所有 MCP 工具脚本
│   │   ├── scene/                  # 场景相关工具(7个)
│   │   ├── object/                 # 对象操作工具(9个)
│   │   ├── material/               # 材质工具(2个)
│   │   ├── light/                  # 灯光工具(1个)
│   │   ├── animation/              # 动画工具(2个)
│   │   └── utils/                  # 通用工具(3个)
│   └── utils/                      # 内部工具函数
├── startup_mcp_listener.ms         # 3ds Max 启动脚本(MAXScript)
├── pyproject.toml                  # Python 包配置
├── LICENSE                         # MIT 许可证
└── README.md                       # 本文件

📄 许可证

本项目采用 MIT License 开源许可。

Available Tools

24 tools
add_modifierA

为 3ds Max 场景中的指定物体添加修改器(Modifier)。

该工具可以为场景中已存在的物体添加各种修改器,如 Bend、Twist、Taper、 TurboSmooth、Shell、UVW Map、Noise、Lattice、MeshSmooth 等。

支持的常见修改器类型(modifier_type 参数):

  • Bend: 弯曲修改器

  • Twist: 扭曲修改器

  • Taper: 锥化修改器

  • TurboSmooth: 涡轮平滑

  • MeshSmooth: 网格平滑

  • Shell: 壳修改器(给面片添加厚度)

  • Noise: 噪波修改器

  • Lattice: 晶格修改器

  • UVW_Map: UVW 贴图修改器(注意使用下划线代替空格)

  • Symmetry: 对称修改器

  • FFD_4x4x4: 自由变形修改器

  • Smooth: 平滑修改器

  • Relax: 松弛修改器

  • Push: 推力修改器

  • Stretch: 拉伸修改器

  • Squeeze: 挤压修改器

  • Ripple: 涟漪修改器

  • Wave: 波浪修改器

  • Skew: 倾斜修改器

  • Spherify: 球形化修改器

  • Edit_Poly: 编辑多边形修改器

  • Edit_Mesh: 编辑网格修改器 以及 3ds Max 中任何可用的修改器类名。

Args: object_name: 目标物体的名称(场景中已存在的对象)。 modifier_type: 修改器类型名称,如 "Bend"、"Twist"、"TurboSmooth" 等。 对于名称含空格的修改器,使用下划线代替空格,如 "UVW_Map"。 modifier_params: 修改器参数的 JSON 字符串,键为属性名,值为属性值。 例如: '{"angle": 90, "direction": 45}' 用于 Bend 修改器。 如果为空字符串则使用修改器默认参数。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - object_name (str): 物体名称。 - modifier_type (str): 添加的修改器类型。 - modifier_name (str): 修改器实例名称。 - applied_params (dict): 成功应用的参数。 - message (str): 操作描述信息。

示例调用 - 为物体添加弯曲修改器: add_modifier(object_name="Box001", modifier_type="Bend", modifier_params='{"angle": 90}')

示例调用 - 为物体添加涡轮平滑: add_modifier(object_name="Box001", modifier_type="TurboSmooth", modifier_params='{"iterations": 2}')

示例调用 - 为物体添加壳修改器(添加厚度): add_modifier(object_name="Plane001", modifier_type="Shell", modifier_params='{"innerAmount": 0, "outerAmount": 5}')

Inputs: object_name (required), modifier_type (required), modifier_params.

assign_materialA

将材质赋予 3ds Max 场景中的指定物体。

该工具可以将已存在的材质赋予物体,支持通过材质名称或材质编辑器槽位索引来指定材质。

Args: object_name: 目标物体名称。支持通配符 "",如 "Box" 会赋予所有以 Box 开头的物体。 也支持用英文逗号分隔多个名称,如 "Box001,Sphere001"。 material_name: 材质名称。在场景的所有材质中查找匹配的材质。 与 slot_index 二选一,优先使用 material_name。 slot_index: 材质编辑器的槽位索引(1-24)。当 material_name 为空时使用此参数。 默认为 "0"(不使用槽位)。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - assigned (list): 成功赋予材质的物体列表。 - material_name (str): 使用的材质名称。 - message (str): 操作描述信息。

示例调用 - 按材质名称赋予: assign_material(object_name="Box001", material_name="RedMaterial")

示例调用 - 按槽位赋予: assign_material(object_name="Box001", slot_index="1")

示例调用 - 批量赋予: assign_material(object_name="Box*", material_name="WoodMaterial")

Inputs: object_name (required), material_name, slot_index.

clone_objectA

克隆 3ds Max 场景中的指定物体。

支持三种克隆模式:

  • Copy: 完全独立的副本(默认)。

  • Instance: 实例,与原对象共享修改器和参数。

  • Reference: 引用,可以在原对象基础上添加新修改器。

Args: object_name: 要克隆的源物体名称。 clone_type: 克隆类型,可选 "copy"、"instance"、"reference"。默认为 "copy"。 new_name: 克隆体的名称。如果为空,则使用 3ds Max 默认命名。 offset: 克隆体相对于原物体的偏移量,格式为 "x,y,z"。 默认为 "0,0,0"(与原物体重叠)。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - source_name (str): 源物体名称。 - clone_name (str): 克隆体名称。 - clone_type (str): 克隆类型。 - position (list): 克隆体位置 [x, y, z]。 - message (str): 操作描述信息。

示例调用 - 复制一个 Box: clone_object(object_name="Box001")

示例调用 - 实例化克隆并偏移: clone_object(object_name="Box001", clone_type="instance", offset="50,0,0")

示例调用 - 带名称的引用克隆: clone_object(object_name="Box001", clone_type="reference", new_name="Box001_Ref", offset="100,0,0")

Inputs: object_name (required), clone_type, new_name, offset.

create_lightA

在 3ds Max 场景中创建一个灯光对象。

支持的灯光类型(light_type 参数):

  • Omni: 泛光灯(点光源),向四周均匀照射(默认)。

  • TargetSpot: 目标聚光灯,带目标点的锥形光源。

  • FreeSpot: 自由聚光灯,无目标点的锥形光源。

  • TargetDirect: 目标平行光,平行方向光照。

  • FreeLight: 自由灯光。

  • Skylight: 天光,模拟天空环境光照。

  • mr_Sky_Portal: Mental Ray 天空门户(需要 MR 插件)。 以及 V-Ray、Arnold 等插件的灯光类型(如 VRayLight、aiAreaLight)。

Args: light_type: 灯光类型名称。默认为 "Omni"。 name: 灯光名称。如果为空则使用默认命名。 position: 灯光位置,格式为 "x,y,z"。默认为 "0,0,100"。 color: 灯光颜色,格式为 "r,g,b" (0-255)。默认为 "255,255,255"(白色)。 intensity: 灯光强度/倍增器,默认 "1.0"。 params: 灯光额外参数的 JSON 字符串。 例如: '{"castShadows": true, "hotspot": 30, "falloff": 60}' 用于聚光灯。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - name (str): 创建的灯光名称。 - light_type (str): 灯光类型。 - position (list): 位置 [x, y, z]。 - message (str): 操作描述信息。

示例调用 - 创建泛光灯: create_light(light_type="Omni", name="MainLight", position="0,0,200", color="255,245,230", intensity="1.5")

示例调用 - 创建聚光灯: create_light(light_type="FreeSpot", name="SpotLight01", position="100,0,150", params='{"hotspot": 30, "falloff": 60}')

示例调用 - 创建天光: create_light(light_type="Skylight", intensity="0.8")

Inputs: light_type, name, position, color, +2 more.

create_materialA

在 3ds Max 中创建一个材质。

该工具可以创建各种类型的材质,并设置基本属性如颜色等。 创建的材质会被放入 3ds Max 的材质编辑器中。

支持的材质类型(material_type 参数):

  • Standard: 标准材质(默认),支持 Blinn/Phong/Metal 等着色器。

  • Physical: 物理材质(PBR),适合写实渲染。

  • VRayMtl: V-Ray 材质(需要安装 V-Ray 插件)。

  • Multi_Sub: 多维子材质(Multi/Sub-Object)。

  • Blend: 混合材质。 以及其他 3ds Max 中可用的材质类名。

Args: material_type: 材质类型名称,默认为 "Standard"。 name: 材质名称。如果为空字符串则使用默认命名。 diffuse_color: 漫反射颜色,格式为 "r,g,b"(0-255),如 "255,0,0" 为红色。 留空则使用默认颜色。 params: 材质额外参数的 JSON 字符串。 例如: '{"opacity": 50, "specularLevel": 80}' 用于 Standard 材质。 留空则使用默认值。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - name (str): 创建的材质名称。 - material_type (str): 材质类型。 - slot_index (int): 材质编辑器中的槽位索引。 - message (str): 操作描述信息。

示例调用 - 创建红色标准材质: create_material(material_type="Standard", name="RedMaterial", diffuse_color="255,0,0")

示例调用 - 创建物理材质: create_material(material_type="Physical", name="MetalMat", diffuse_color="180,180,180")

示例调用 - 创建带参数的标准材质: create_material(material_type="Standard", name="GlassMat", diffuse_color="200,220,255", params='{"opacity": 30, "specularLevel": 90}')

Inputs: material_type, name, diffuse_color, params.

create_objectA

在 3ds Max 场景中创建一个基础几何体对象。

支持的几何体类型(object_type 参数):

  • Box: 长方体,参数: length, width, height, lengthsegs, widthsegs, heightsegs

  • Sphere: 球体,参数: radius, segments, smooth

  • Cylinder: 圆柱体,参数: radius, height, heightsegs, capsegs, sides, smooth

  • Plane: 平面,参数: length, width, lengthsegs, widthsegs

  • Torus: 圆环体,参数: radius1, radius2, segments, sides, smooth

  • Cone: 圆锥体,参数: radius1, radius2, height, heightsegs, capsegs, sides, smooth

  • Tube: 管状体,参数: radius1, radius2, height, heightsegs, capsegs, sides, smooth

  • Pyramid: 四棱锥,参数: width, depth, height

  • GeoSphere: 几何球体,参数: radius, segs

  • Teapot: 茶壶,参数: radius, segments, smooth

  • Hedra: 多面体,参数: radius, family, p, q

  • Torus_Knot: 圆环结,参数: radius, radius2, p, q, segments, sides 以及 3ds Max 中任何可用的基础创建类名。

Args: object_type: 几何体类型名称,如 "Box"、"Sphere"、"Cylinder" 等。 对于名称含空格的类型,使用下划线代替空格,如 "Torus_Knot"。 name: 对象名称。如果为空字符串则使用 3ds Max 的默认命名。 position: 对象的世界坐标位置,格式为 "x,y,z",如 "0,0,0" 或 "100,50,0"。 默认值为 "0,0,0"(世界原点)。 params: 对象创建参数的 JSON 字符串,键为属性名,值为属性值。 例如: '{"radius": 30, "segments": 32}' 用于创建球体。 例如: '{"length": 50, "width": 40, "height": 30}' 用于创建长方体。 如果为空字符串则使用默认参数。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - name (str): 创建的对象名称。 - object_type (str): 对象类型。 - position (list): 对象的位置坐标 [x, y, z]。 - applied_params (dict): 成功应用的参数。 - message (str): 操作描述信息。

示例调用 - 创建一个默认球体: create_object(object_type="Sphere")

示例调用 - 在指定位置创建带参数的长方体: create_object(object_type="Box", name="MyBox", position="100,0,0", params='{"length": 50, "width": 40, "height": 30}')

示例调用 - 创建圆柱体: create_object(object_type="Cylinder", name="MyCylinder", position="0,50,0", params='{"radius": 20, "height": 60, "sides": 24}')

示例调用 - 创建平面: create_object(object_type="Plane", params='{"length": 200, "width": 200, "lengthsegs": 10, "widthsegs": 10}')

Inputs: object_type (required), name, position, params.

delete_objectA

删除 3ds Max 场景中的指定物体。

该工具可以删除场景中指定名称的对象。支持通配符 "*" 进行批量删除。

Args: object_name: 要删除的物体名称。支持以下格式: - 精确名称:如 "Box001",删除指定物体。 - 通配符:如 "Box*",删除所有以 "Box" 开头的物体。 - 多个名称:用英文逗号分隔,如 "Box001,Sphere001,Cylinder001"。 - 特殊值 "*":删除场景中所有对象(谨慎使用!)。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - deleted (list): 被删除的对象名称列表。 - deleted_count (int): 被删除的对象数量。 - not_found (list): 未找到的对象名称列表(仅精确匹配时)。 - message (str): 操作描述信息。

示例调用 - 删除单个物体: delete_object(object_name="Box001")

示例调用 - 批量删除(通配符): delete_object(object_name="Box*")

示例调用 - 删除多个指定物体: delete_object(object_name="Box001,Sphere001,Cylinder001")

示例调用 - 删除所有物体: delete_object(object_name="*")

Inputs: object_name (required).

execute_maxscriptA

在 3ds Max 中执行一段 MAXScript 代码并返回结果。

该工具允许你发送 MAXScript 代码到 3ds Max 中执行。 适用于某些用 MAXScript 更直接或更方便的操作场景。

使用说明:

Args: script: 要执行的 MAXScript 代码字符串。

Returns: dict: 操作结果。 - success (bool): 是否成功执行。 - result (str): MAXScript 执行结果的字符串表示。 - message (str): 操作描述信息。

示例脚本 - 获取选中对象数量: execute_maxscript(script="selection.count")

示例脚本 - 选中所有 Box 对象: execute_maxscript(script="select (for obj in objects where classOf obj == Box collect obj)")

示例脚本 - 重置场景: execute_maxscript(script="resetMaxFile #noPrompt")

示例脚本 - 设置渲染分辨率: execute_maxscript(script="renderWidth = 1920; renderHeight = 1080")

Inputs: script (required).

execute_python_scriptA

在 3ds Max 中执行一段 Python 脚本并返回执行结果。

该工具允许你发送任意 Python 代码到 3ds Max 中执行。 脚本在 3ds Max 的 Python 环境中运行,可以访问 pymxs、MaxPlus 等模块。

使用说明:

  • 脚本中可以通过 import pymxs; rt = pymxs.runtime 来访问 MAXScript 运行时。

  • 脚本中可以使用 print() 输出调试信息(会打印到 3ds Max 控制台)。

  • 如果需要返回结果,请将结果赋值给 _mcp_max_results 变量(字典或可 JSON 序列化的对象)。

  • 如果脚本没有设置 _mcp_max_results,则返回 {"success": True, "message": "脚本已执行完成"}。

示例脚本 - 获取场景中所有对象的名称: import pymxs rt = pymxs.runtime names = [str(obj.name) for obj in rt.objects] _mcp_max_results = {"success": True, "object_names": names, "count": len(names)}

示例脚本 - 创建一个球体: import pymxs rt = pymxs.runtime sphere = rt.Sphere(radius=30, pos=rt.Point3(0, 0, 0)) sphere.name = "MCP_Sphere" _mcp_max_results = {"success": True, "name": str(sphere.name), "radius": 30}

Args: script: 要在 3ds Max 中执行的 Python 脚本代码字符串。

Returns: dict: 包含执行结果的字典。 - success (bool): 脚本是否执行成功。 - 其他字段取决于脚本中 _mcp_max_results 的内容。

Inputs: script (required).

export_fileA

从 3ds Max 导出场景或选中的对象到文件。

支持的格式包括 FBX、OBJ、STL、3DS 等。 可以导出场景中的全部对象或仅导出选中的对象。

Args: file_path: 导出文件的完整路径(包含扩展名)。 支持的格式:.fbx, .obj, .stl, .3ds, .dae 等。 selected_only: 是否仅导出选中的对象。 "true" 表示只导出选中对象。 "false"(默认)表示导出场景中所有对象。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - file_path (str): 导出的文件路径。 - selected_only (bool): 是否仅导出选中对象。 - message (str): 操作描述信息。

示例调用 - 导出全部对象为 FBX: export_file(file_path="C:/Export/scene.fbx")

示例调用 - 仅导出选中对象为 OBJ: export_file(file_path="C:/Export/selected.obj", selected_only="true")

Inputs: file_path (required), selected_only.

get_max_versionA

获取当前 3ds Max 的版本信息和环境信息。

该工具返回 3ds Max 的版本号、构建信息、Python 版本等环境信息, 帮助了解运行环境。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - max_version (str): 3ds Max 版本号。 - max_version_number (int): 3ds Max 版本数字。 - python_version (str): Python 版本。 - message (str): 描述信息。

示例调用: get_max_version()

Inputs: no named parameters.

get_object_propertiesA

获取 3ds Max 场景中指定物体的详细属性信息。

该工具返回物体的变换信息(位置/旋转/缩放)、几何属性、修改器列表、 材质信息等综合属性数据,帮助 AI 了解物体的当前状态。

Args: object_name: 目标物体的名称(场景中已存在的对象)。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - name (str): 物体名称。 - class_name (str): 物体类名(如 Box, Sphere, Editable_Poly 等)。 - super_class (str): 物体超类名(如 GeometryClass, Light 等)。 - transform (dict): 变换信息。 - position (list): 位置 [x, y, z]。 - rotation (list): 旋转欧拉角 [x, y, z](度数)。 - scale (list): 缩放 [x, y, z]。 - properties (dict): 物体的创建参数(如 radius, length 等)。 - modifiers (list): 修改器列表,每个包含 name 和 class_name。 - material (dict|None): 材质信息(如果有)。 - is_hidden (bool): 是否隐藏。 - is_frozen (bool): 是否冻结。 - wirecolor (list): 线框颜色 [r, g, b]。 - vertex_count (int): 顶点数(如果是网格对象)。 - face_count (int): 面数(如果是网格对象)。 - message (str): 操作描述信息。

示例调用: get_object_properties(object_name="Box001")

示例调用: get_object_properties(object_name="MCP_Sphere")

Inputs: object_name (required).

get_scene_infoA

获取当前 3ds Max 场景的综合信息。

该工具返回当前场景的全面信息,包括文件路径、对象统计、时间范围、 单位设置等,帮助 AI 了解场景的整体状态。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - file_path (str): 当前场景文件的完整路径(未保存时为空)。 - file_name (str): 场景文件名。 - is_saved (bool): 场景是否已保存。 - object_counts (dict): 各类型对象数量统计。 - total (int): 总对象数。 - geometry (int): 几何体数量。 - lights (int): 灯光数量。 - cameras (int): 相机数量。 - helpers (int): 辅助对象数量。 - shapes (int): 样条线数量。 - time_range (dict): 时间/帧范围。 - start (int): 起始帧。 - end (int): 结束帧。 - current (int): 当前帧。 - fps (float): 帧率。 - units (dict): 单位设置。 - system_type (str): 系统单位类型。 - system_scale (float): 系统单位缩放。 - display_type (str): 显示单位类型。 - message (str): 描述信息。

示例调用: get_scene_info()

Inputs: no named parameters.

get_scene_objectsA

获取当前 3ds Max 场景中的所有对象信息。

该工具可以列出场景中的所有对象,或者按类型/名称进行过滤。 返回每个对象的名称、类型、位置、是否隐藏等基本信息。

支持的过滤类型(object_type 参数):

  • "": 返回所有对象(默认)

  • "Geometry": 仅返回几何体对象(Box、Sphere、Mesh 等)

  • "Light": 仅返回灯光对象

  • "Camera": 仅返回相机对象

  • "Helper": 仅返回辅助对象(Dummy、Point 等)

  • "Shape": 仅返回样条线/形状对象(Line、Circle、Rectangle 等)

  • "SpaceWarp": 仅返回空间扭曲对象

  • "Bone": 仅返回骨骼对象 也支持具体的类名,如 "Box"、"Sphere"、"Editable_Mesh" 等。

Args: object_type: 按类型过滤对象,可以是超类名(如 "Geometry")或具体类名(如 "Box")。 如果为空字符串则返回所有对象。 name_filter: 按名称过滤对象,支持通配符 ""。 例如: "Box" 匹配所有以 "Box" 开头的对象。 如果为空字符串则不按名称过滤。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - objects (list): 对象信息列表,每个元素包含: - name (str): 对象名称。 - class_name (str): 对象类名。 - super_class (str): 对象超类名。 - position (list): 位置坐标 [x, y, z]。 - is_hidden (bool): 是否隐藏。 - is_frozen (bool): 是否冻结。 - count (int): 返回的对象数量。 - total_in_scene (int): 场景中的总对象数量。 - message (str): 描述信息。

示例调用 - 获取所有对象: get_scene_objects()

示例调用 - 仅获取几何体: get_scene_objects(object_type="Geometry")

示例调用 - 按名称过滤: get_scene_objects(name_filter="Box*")

示例调用 - 按类型和名称组合过滤: get_scene_objects(object_type="Geometry", name_filter="Wall*")

Inputs: object_type, name_filter.

import_fileA

在 3ds Max 中导入外部文件。

支持的格式包括 FBX、OBJ、Alembic(ABC)、STL、3DS 等 3ds Max 能识别的文件格式。 导入的对象将被添加到当前场景中。

Args: file_path: 要导入的文件完整路径。 支持的常见格式:.fbx, .obj, .abc, .stl, .3ds, .dae 等。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - file_path (str): 导入的文件路径。 - message (str): 操作描述信息。

示例调用: import_file(file_path="C:/Models/character.fbx")

示例调用: import_file(file_path="C:/Models/terrain.obj")

Inputs: file_path (required).

new_sceneA

在 3ds Max 中新建/重置场景。

该工具将清空当前场景并创建一个新的空场景。

Args: force: 是否强制新建(不提示保存当前场景)。 "true"(默认)表示强制新建,不保存当前更改。 "false" 表示如果当前场景有未保存更改,会先保存。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - message (str): 操作描述信息。

示例调用 - 强制新建: new_scene()

示例调用 - 保存后新建: new_scene(force="false")

Inputs: force.

open_sceneA

在 3ds Max 中打开一个场景文件。

该工具将加载指定的 .max 场景文件。

Args: file_path: 要打开的场景文件完整路径,必须是 .max 文件。 例如: "C:/Projects/MyScene.max" force: 是否强制打开(不提示保存当前场景)。 "true" 表示强制打开(不保存当前更改), "false"(默认)表示如果当前场景有更改会先尝试保存。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - file_path (str): 打开的文件路径。 - message (str): 操作描述信息。

示例调用: open_scene(file_path="C:/Projects/MyScene.max")

示例调用 - 强制打开(不保存当前场景): open_scene(file_path="C:/Projects/MyScene.max", force="true")

Inputs: file_path (required), force.

rename_objectA

重命名 3ds Max 场景中的指定物体。

Args: object_name: 当前物体名称(场景中已存在的对象)。 new_name: 新的物体名称。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - old_name (str): 原名称。 - new_name (str): 新名称。 - message (str): 操作描述信息。

示例调用: rename_object(object_name="Box001", new_name="Wall_Left")

Inputs: object_name (required), new_name (required).

save_sceneA

保存当前 3ds Max 场景文件。

该工具可以将当前场景保存到文件,支持覆盖保存和另存为。

Args: file_path: 保存的文件路径。 - 如果为空字符串,则保存到当前文件(覆盖保存)。 若当前场景未保存过则会失败。 - 如果指定了路径,则另存为到该路径。 路径必须以 .max 结尾,如 "C:/Projects/MyScene.max"。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - file_path (str): 保存的文件完整路径。 - message (str): 操作描述信息。

示例调用 - 覆盖保存: save_scene()

示例调用 - 另存为: save_scene(file_path="C:/Projects/MyScene.max")

Inputs: file_path.

select_objectsA

在 3ds Max 场景中选择或取消选择对象。

该工具可以按名称或类型选择场景中的对象,也可以清除当前选择。

Args: object_name: 要选择的物体名称。支持以下格式: - 精确名称:如 "Box001" - 通配符:如 "Box*" 选择所有以 Box 开头的物体 - 多个名称:用英文逗号分隔,如 "Box001,Sphere001" - 留空配合 object_type 使用,按类型选择 object_type: 按类型选择,如 "Geometry"、"Light"、"Camera"、"Box"、"Sphere" 等。 可与 object_name 组合使用。 action: 操作类型。 - "select": 选择匹配的对象(默认),替换当前选择。 - "add": 将匹配的对象添加到当前选择中。 - "deselect": 从当前选择中移除匹配的对象。 - "clear": 清除所有选择(忽略 object_name 和 object_type)。 - "invert": 反转当前选择(忽略 object_name 和 object_type)。 - "all": 选择所有对象(忽略 object_name 和 object_type)。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - selected (list): 当前选中的对象名称列表。 - selected_count (int): 当前选中的对象数量。 - message (str): 操作描述信息。

示例调用 - 选择单个对象: select_objects(object_name="Box001")

示例调用 - 按通配符选择: select_objects(object_name="Wall*")

示例调用 - 按类型选择所有灯光: select_objects(object_type="Light")

示例调用 - 清除选择: select_objects(action="clear")

示例调用 - 选择所有对象: select_objects(action="all")

Inputs: object_name, object_type, action.

set_keyframeA

在 3ds Max 中为指定物体的属性设置关键帧。

该工具可以在指定帧为物体的变换属性(位置/旋转/缩放)或自定义属性设置关键帧。

Args: object_name: 目标物体名称。 frame: 关键帧所在的帧号,如 "0"、"30"、"60"。 position: 在该帧的位置值,格式 "x,y,z"。留空表示不设置位置关键帧。 rotation: 在该帧的旋转值(欧拉角度数),格式 "x,y,z"。留空表示不设置旋转关键帧。 scale: 在该帧的缩放值,格式 "x,y,z" 或单个值如 "2"。留空表示不设置缩放关键帧。 property_name: 自定义属性名(如 "radius"、"height" 等)。与 property_value 配合使用。 property_value: 自定义属性在该帧的值。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - object_name (str): 物体名称。 - frame (int): 关键帧号。 - keys_set (list): 成功设置的关键帧类型列表。 - message (str): 操作描述信息。

示例调用 - 设置位置关键帧: set_keyframe(object_name="Box001", frame="0", position="0,0,0") set_keyframe(object_name="Box001", frame="30", position="100,0,0")

示例调用 - 设置位置和旋转关键帧: set_keyframe(object_name="Box001", frame="0", position="0,0,0", rotation="0,0,0") set_keyframe(object_name="Box001", frame="60", position="100,0,0", rotation="0,0,360")

示例调用 - 设置自定义属性关键帧(如半径动画): set_keyframe(object_name="Sphere001", frame="0", property_name="radius", property_value="10") set_keyframe(object_name="Sphere001", frame="30", property_name="radius", property_value="50")

Inputs: object_name (required), frame (required), position, rotation, +3 more.

set_object_propertyA

设置 3ds Max 场景中指定物体的属性值。

该工具可以设置物体的各种属性,包括显示属性和创建参数。

常用属性名称(property_name 参数):

  • wirecolor: 线框颜色,值格式 "r,g,b" (0-255),如 "255,0,0"

  • isHidden: 是否隐藏,值 "true" 或 "false"

  • isFrozen: 是否冻结,值 "true" 或 "false"

  • renderable: 是否可渲染,值 "true" 或 "false"

  • boxMode: 是否以盒模式显示,值 "true" 或 "false"

  • backfaceCull: 是否背面剔除,值 "true" 或 "false"

  • 以及对象的创建参数(如 radius、length、width、height、segments 等)

Args: object_name: 目标物体名称。支持通配符 "*" 进行批量设置。 property_name: 属性名称。 property_value: 属性值(字符串形式)。 数字值: "30"、"1.5" 布尔值: "true"、"false" 颜色值: "255,0,0"(仅 wirecolor 属性使用)

Returns: dict: 操作结果。 - success (bool): 是否成功。 - modified (list): 成功修改的物体列表。 - property_name (str): 属性名称。 - property_value (str): 设置的属性值。 - message (str): 操作描述信息。

示例调用 - 设置线框颜色为红色: set_object_property(object_name="Box001", property_name="wirecolor", property_value="255,0,0")

示例调用 - 隐藏物体: set_object_property(object_name="Box001", property_name="isHidden", property_value="true")

示例调用 - 修改球体半径: set_object_property(object_name="Sphere001", property_name="radius", property_value="50")

示例调用 - 批量冻结所有 Box: set_object_property(object_name="Box*", property_name="isFrozen", property_value="true")

Inputs: object_name (required), property_name (required), property_value (required).

set_object_transformA

设置 3ds Max 场景中指定物体的变换属性(位置/旋转/缩放)。

该工具可以设置物体的位置、旋转和缩放,支持绝对模式和相对模式。 可以同时设置多个变换属性,也可以只设置其中一个。

Args: object_name: 目标物体的名称(场景中已存在的对象)。 position: 位置坐标,格式为 "x,y,z",如 "100,50,0"。 留空则不改变位置。 rotation: 旋转欧拉角(度数),格式为 "x,y,z",如 "0,0,45"。 留空则不改变旋转。 scale: 缩放比例,格式为 "x,y,z",如 "2,2,2"(等比放大2倍)。 也可使用单个值表示等比缩放,如 "1.5"(等同于 "1.5,1.5,1.5")。 留空则不改变缩放。 relative: 是否使用相对模式。"true" 表示在当前值基础上叠加, "false"(默认)表示设置为绝对值。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - object_name (str): 物体名称。 - old_transform (dict): 变换前的值。 - new_transform (dict): 变换后的值。 - message (str): 操作描述信息。

示例调用 - 移动物体到指定位置: set_object_transform(object_name="Box001", position="100,0,50")

示例调用 - 旋转物体45度(Z轴): set_object_transform(object_name="Box001", rotation="0,0,45")

示例调用 - 等比缩放物体: set_object_transform(object_name="Box001", scale="2,2,2")

示例调用 - 相对移动物体(在当前位置基础上偏移): set_object_transform(object_name="Box001", position="10,0,0", relative="true")

示例调用 - 同时设置位置和旋转: set_object_transform(object_name="Box001", position="100,50,0", rotation="0,0,90")

Inputs: object_name (required), position, rotation, scale, +1 more.

set_time_rangeA

设置 3ds Max 的时间/帧范围参数。

该工具可以设置动画的帧范围、当前帧位置和帧率。 所有参数都是可选的,只设置你需要修改的参数。

Args: start_frame: 动画起始帧。留空不修改。 end_frame: 动画结束帧。留空不修改。 current_frame: 当前帧(时间滑块位置)。留空不修改。 fps: 帧率。常见值: "24"(电影)、"25"(PAL)、"30"(NTSC)。留空不修改。

Returns: dict: 操作结果。 - success (bool): 是否成功。 - time_range (dict): 设置后的时间范围信息。 - message (str): 操作描述信息。

示例调用 - 设置帧范围: set_time_range(start_frame="0", end_frame="100")

示例调用 - 设置当前帧: set_time_range(current_frame="50")

示例调用 - 设置帧率和范围: set_time_range(start_frame="0", end_frame="240", fps="24")

Inputs: start_frame, end_frame, current_frame, fps.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 24 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific operations in 3ds Max (e.g., create_object, add_modifier, set_keyframe), but there is some overlap between get_object_properties and get_scene_objects in retrieving object information, and execute_maxscript and execute_python_script both allow script execution, which could cause confusion. However, descriptions clarify their specific uses.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with clear verb_noun structure (e.g., create_object, delete_object, get_scene_info). There are no deviations in naming conventions, making the set predictable and easy to understand.

    Tool Count3/5

    With 24 tools, the count is borderline high for a single domain like 3D modeling, but it covers a comprehensive range of operations in 3ds Max (creation, modification, animation, scene management). It feels slightly heavy but justifiable given the complexity of the software.

    Completeness5/5

    The tool set provides complete coverage for 3ds Max operations, including object creation, modification, animation, scene management, import/export, and scripting. There are no obvious gaps; agents can perform full workflows from modeling to rendering preparation.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Connect AI agents to Autodesk 3ds Max through the Model Context Protocol, enabling natural language control of scene creation, materials, modifiers, rendering, and plugin workflows.
      231 PyPI
      398
      MIT
    • F
      license
      B
      quality
      C
      maintenance
      Enables AI agents to control a live 3ds Max session directly, including creating and editing objects, materials, animation, and scene inspection, with undo support.
      17
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to connect to Autodesk 3ds Max via the Model Context Protocol, allowing natural-language control of scene creation, modeling, materials, viewport capture, and plugin introspection through dedicated MCP tools.
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to directly control Autodesk 3ds Max for modeling, shading, rigging, animation, rendering, baking, and engine export through MCP.
      375
      5
      MIT