Fusion 360 MCP Server

MIT License

Integrations

  • Interfaces with Autodesk Fusion 360 to execute CAD modeling operations, allowing users to create 3D designs through natural language commands that are converted into Fusion 360 toolbar-level commands and Python scripts.

  • Provides an HTTP API server implementation with endpoints for listing tools, calling individual tools, and executing sequences of tools for Fusion 360 operations.

Fusion 360 MCP サーバー

Cline と Autodesk Fusion 360 間のインターフェイスとなるモデル コンテキスト プロトコル (MCP) サーバー。このサーバーは、Fusion 360 ツールバー レベルのコマンドを、Fusion の API に直接マップされる呼び出し可能なツールとして公開します。

🧠 概要

このプロジェクトにより、Cline は次のことが可能になります。

  • 自然言語プロンプトを解析する(例:「角の丸いボックスを作成してください」)
  • これらをFusionツールのアクションに解決します(例:CreateSketch → DrawRectangle → Extrude → Fillet)
  • これらのツールをこのMCPサーバー経由で呼び出します
  • Fusion 360で実行できるPythonスクリプトを返す

🛠️ インストール

前提条件

  • Python 3.9以上
  • オートデスク Fusion 360

設定

  1. このリポジトリをクローンします:
    git clone https://github.com/yourusername/fusion360-mcp-server.git cd fusion360-mcp-server
  2. 依存関係をインストールします:
    pip install -r requirements.txt

🚀 使用方法

HTTPサーバーの実行

cd src python main.py

これにより、 http://127.0.0.1:8000で FastAPI サーバーが起動します。

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 ツールをサポートしています。

作成する

  • CreateSketch : 指定された平面上に新しいスケッチを作成します
  • DrawRectangle : アクティブなスケッチに長方形を描画します
  • DrawCircle : アクティブなスケッチに円を描きます
  • 押し出し: プロファイルを 3D ボディに押し出します
  • 回転: 軸を中心にプロファイルを回転します

修正する

  • フィレット: 選択したエッジにフィレットを追加します
  • 面取り: 選択したエッジに面取りを追加します
  • シェル: 指定された壁厚のソリッドボディをくり抜きます
  • 結合: ブール演算を使用して2つのボディを結合します

輸出

  • 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で定義されます。各ツールには以下のものが含まれます。

  • name : ツールの名前
  • 説明: ツールの機能
  • パラメータ: ツールが受け入れるパラメータ
  • docs : 関連する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. src/script_generator.pySCRIPT_TEMPLATESにスクリプト テンプレートを追加します。
  3. src/script_generator.py_process_parametersにパラメータ処理ロジックを追加します。

📚 ドキュメントリンク

🔄今後の機能強化

  • コンテキスト認識操作のためのセッション状態追跡
  • 動的ツール登録
  • ソケットまたはファイルポーリングによる自動化
  • その他のFusionコマンド

📄 ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

-
security - not tested
A
license - permissive license
-
quality - not tested

Cline がコマンドを Fusion の API にマッピングし、実行可能な Python スクリプトを生成することで、自然言語プロンプトを Fusion 360 CAD 操作に変換できるようにするモデル コンテキスト プロトコル サーバー。

  1. 🧠 Overview
    1. 🛠️ Installation
      1. Prerequisites
      2. Setup
    2. 🚀 Usage
      1. Running the HTTP Server
      2. Running as an MCP Server
      3. API Endpoints
      4. Example API Calls
    3. 📦 Available Tools
      1. Create
      2. Modify
      3. Export
    4. 🔌 MCP Integration
      1. 🧩 Tool Registry
        1. 📝 Script Generation
          1. 🧪 Extending the Server
            1. Adding New Tools
          2. 📚 Documentation Links
            1. 🔄 Future Enhancements
              1. 📄 License

                Related MCP Servers

                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server built with mcp-framework that allows users to create and manage custom tools for processing data, integrating with the Claude Desktop via CLI.
                  Last updated -
                  48
                  4
                  TypeScript
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that allows management and execution of Blender Python scripts, enabling users to create, edit and run scripts in a headless Blender environment through natural language interfaces.
                  Last updated -
                  4
                  Python
                • A
                  security
                  F
                  license
                  A
                  quality
                  A CLI tool that runs a Model Context Protocol server over stdio, enabling interaction with specification documents like business requirements, product requirements, and user stories for the Specif-ai platform.
                  Last updated -
                  9
                  0
                  TypeScript
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server for Unity game development that enables users to manage projects, edit scenes, create prefabs, and generate scripts through natural language integration with Smithery.ai.
                  Last updated -
                  TypeScript

                View all related MCP servers

                ID: zorqcmyr4n