How zkbkb/fusion-mcp works
Project type and purpose
• This is a hybrid tool+plugin project: a Python-based MCP (Model Context Protocol) server plus a Fusion 360 add-in.
• Purpose: run a FastMCP server exposing 44 CAD “tools” over JSON-RPC/TCP to drive Fusion 360 via natural-language AI clients (Cursor, Claude).
• Dual-mode: “Plugin Mode” for production (real Fusion 360 API), “Simulation Mode” for development/testing (mock data).
File structure
• Top-level:
• setup.py, requirements.txt, install_addin.py, mcp_config.json
• src/ (all source code)
• tests/ subdivided into unit, integration, performance, platform
• src/ subdirectories:
• fusion360/ – the add-in code (addin.py + manifest)
• mcp_server.py – MCP server entrypoint using FastMCP
• tools/ – 5 tool categories (sketch, modeling, assembly, analysis, general utils)
• core/ – bridge.py (API bridge), config.py, resources.py
• context/ – persistence.py, tools.py (state & design-intent management)
• utils/ – error handling, logging, helpers, validators
• Configuration & build:
• mcp_config.json – example AI client config
• install_addin.py – script to copy plugin into Fusion 360 add-ins folder
• manifest file (FusionMCP.manifest) under src/fusion360
README for additional insights
• Lists core components with file locations and description (MCP Server, Socket Bridge, Fusion360 Plugin, Tool Modules, Context Manager, Core Bridge).
• Shows communication flow:
AI Command → MCP Client → stdio → MCP Server → TCP Socket → Fusion360 Plugin → Fusion360 API → CAD Operation.
a. Main components:
• AI Client (Cursor/Claude)
• MCP Server (FastMCP)
• Socket Bridge (Fusion360SocketBridge in core/bridge.py)
• Fusion 360 Plugin (addin.py + manifest)
• Fusion 360 Application & API
• Tool modules (sketch, modeling, assembly, analysis under src/tools/)
• Context Manager (persistence & tools for design history)
• Configuration & Logging (config.py, logging_config.py)
• External: MCP protocol (JSON-RPC 2.0), TCP Socket
b. Relationships and interactions:
• AI Client ↔ (JSON-RPC stdio) ↔ MCP Server
• MCP Server registers each tool (via decorators) and dispatches to tool modules
• MCP Server ↔ (TCP socket) ↔ Socket Bridge ↔ Fusion 360 Plugin
• Fusion 360 Plugin calls Fusion 360 API to perform CAD operations
• Context Manager persists design intent between tool calls
• Core Bridge handles mode switching (real vs simulation)
c. Architectural patterns & principles:
• Dual-mode operation: real vs mock environment
• Modular design: each tool category self-contained
• Asynchronous event-driven server (asyncio + FastMCP)
• Separation of concerns:
• API layer (core/bridge)
• Business logic (tools/)
• Persistence (context/)
• Plugin hosting (fusion360/)
• JSON-RPC 2.0 for tool invocation
d. Key technologies/frameworks:
• Python 3.8+
• FastMCP (Model Context Protocol server framework)
• asyncio, JSON-RPC
• TCP Sockets (localhost:8765)
• Fusion 360 API (adsk.core, adsk.fusion)
• pytest for testing
Final advice
• Be exhaustive: show all subcomponents (tools/, core/, context/, utils/)
• Both modes (production vs simulation)
• Three-layer call chain (AI → MCP → Plugin → API)
• Special features: asynchronous processing, design persistence, automatic mode switching