Token导航 LogoToken导航TokenDH.com
Fusion 360 MCP Server logo
设计创作stdio官方级别未说明来源级核验

Fusion 360 MCP Server

MCP Server

一个连接Cline和Autodesk Fusion 360的模型上下文协议(MCP)服务器,将Fusion 360工具栏命令暴露为可调用的工具,并生成可执行的Python脚本。

工具数

0

提示词数

0

GitHub Stars

71

资源数

0
3D建模API接口PythonClineCline

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

ArchimedesCrypto

提供方

ArchimedesCrypto

最后核验

2026/5/17 20:37

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

Fusion 360 MCP服务器

连接Cline和Autodesk Fusion 360的模型上下文协议(MCP)服务器。该服务器将Fusion 360工具栏级命令公开为可调用工具,直接映射到Fusion的API。

🧠 概述

该项目使Cline能够:

  • 解析自然语言提示(例如,“制作一个圆角框”)
  • 将它们分解为Fusion工具操作(例如CreateSketch→ 绘制矩形→ 挤出→ 圆角)
  • 通过此MCP服务器调用这些工具
  • 返回可以在Fusion 360中执行的Python脚本

🛠️ 安装

先决条件

  • Python 3.9或更高版本
  • Autodesk Fusion 360

设置

  1. 克隆此存储库:
   git clone https://github.com/yourusername/fusion360-mcp-server.git
   cd fusion360-mcp-server
  1. 安装依赖项:
   pip install -r requirements.txt

🚀 用法

运行HTTP服务器

cd src
python main.py

这将在以下位置启动FastAPI服务器 http://127.0.0.1:8000.

作为MCP服务器运行

cd src
python main.py --mcp

这将以MCP模式启动服务器,从stdin读取并写入stdout。

API终点

  • GET /:检查服务器是否正在运行
  • GET /tools:列出所有可用工具
  • POST /call_tool:调用单个工具并生成脚本
  • POST /call_tools:按顺序调用多个工具并生成脚本

API调用示例

列出工具

curl -X GET http://127.0.0.1:8000/tools

调用单个工具

curl -X POST http://127.0.0.1:8000/call_tool \
  -H "Content-Type: application/json" \
  -d '{
    "tool_name": "CreateSketch",
    "parameters": {
      "plane": "xy"
    }
  }'

调用多个工具

curl -X POST http://127.0.0.1:8000/call_tools \
  -H "Content-Type: application/json" \
  -d '{
    "tool_calls": [
      {
        "tool_name": "CreateSketch",
        "parameters": {
          "plane": "xy"
        }
      },
      {
        "tool_name": "DrawRectangle",
        "parameters": {
          "width": 10,
          "depth": 10
        }
      },
      {
        "tool_name": "Extrude",
        "parameters": {
          "height": 5
        }
      }
    ]
  }'

📦 可用工具

服务器目前支持以下Fusion 360工具:

创建

  • 创建草图:在指定平面上创建新草图
  • 绘制矩形:在活动草图中绘制矩形
  • 画圈:在活动草图中绘制一个圆
  • 挤出:将轮廓拉伸为三维实体
  • 旋转:使轮廓围绕轴旋转

修改

  • 菲力:向选定边添加圆角
  • 倒角:为选定边添加倒角
  • 外壳:挖空具有指定壁厚的固体
  • 合并:使用布尔运算组合两个实体

出口

  • ExportBody:将正文导出到文件

🔌 MCP集成

要将此服务器与Cline一起使用,请将其添加到MCP设置配置文件中:

{
  "mcpServers": {
    "fusion360": {
      "command": "python",
      "args": ["/path/to/fusion360-mcp-server/src/main.py", "--mcp"],
      "env": {},
      "disabled": false,
      "autoApprove": []
    }
  }
}

🧩 工具注册表

工具定义见 src/tool_registry.json每个工具都有:

  • 名字:工具的名称
  • 描述:这个工具做什么
  • 参数:工具接受的参数
  • 文档:相关Fusion API文档链接

工具定义示例:

{
  "name": "Extrude",
  "description": "Extrudes a profile into a 3D body.",
  "parameters": {
    "profile_index": {
      "type": "integer",
      "description": "Index of the profile to extrude.",
      "default": 0
    },
    "height": {
      "type": "number",
      "description": "Height of the extrusion in mm."
    },
    "operation": {
      "type": "string",
      "description": "The operation type (e.g., 'new', 'join', 'cut', 'intersect').",
      "default": "new"
    }
  },
  "docs": "https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-6D381FCD-22AB-4F08-B4BB-5D3A130189AC"
}

📝 脚本生成

服务器根据工具调用生成Fusion 360 Python脚本。这些脚本可以在Fusion 360的脚本编辑器中执行。

生成脚本示例:

import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        design = app.activeProduct
        
        # Get the active component in the design
        component = design.rootComponent
        
        # Create a new sketch on the xy plane
        sketches = component.sketches
        xyPlane = component.xYConstructionPlane
        sketch = sketches.add(xyPlane)
        
        # Draw a rectangle
        rectangle = sketch.sketchCurves.sketchLines.addTwoPointRectangle(
            adsk.core.Point3D.create(0, 0, 0),
            adsk.core.Point3D.create(10, 10, 0)
        )
        
        # Extrude the profile
        prof = sketch.profiles.item(0)
        extrudes = component.features.extrudeFeatures
        extInput = extrudes.createInput(prof, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
        distance = adsk.core.ValueInput.createByReal(5)
        extInput.setDistanceExtent(False, distance)
        extrude = extrudes.add(extInput)
        
        ui.messageBox('Operation completed successfully')
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

🧪 扩展服务器

添加新工具

  1. 向添加新的工具定义 src/tool_registry.json
  2. 将脚本模板添加到 SCRIPT_TEMPLATES 在……里面 src/script_generator.py
  3. 添加参数处理逻辑 _process_parameters 在……里面 src/script_generator.py

📚 文档链接

🔄 未来的增强功能

  • 上下文感知操作的会话状态跟踪
  • 动态刀具注册
  • 通过套接字或文件轮询实现自动化
  • 更多Fusion命令

📄 许可证

此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。

目录标签

目录标签

3D建模API接口PythonCline本地部署自动化工具CAD集成Python脚本生成

支持客户端

Cline

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

部署方式(deploymentType,部署类型)

local-only

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononelocal-only

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP