How mhyrr/sketchup-mcp works
SketchupMCP lets an AI client inspect and manipulate a live SketchUp model through MCP tools and a JSON-over-TCP bridge. The principal workflow is a client tool request, Python-side command forwarding, Ruby extension execution, and a response from SketchUp. Tool coverage includes scene and selection inspection, component editing, materials, export, Ruby evaluation, and woodworking joints. The sampled excerpts establish the Python bridge and parts of the Ruby implementation; links to specific Ruby handlers are limited to documented or sampled behavior.
Main entry points: main.rb TCP command server · server.py MCP tools
Components 12
AI client
- Claude / MCP client
MCP server
- MCP tools
src/sketchup_mcp/server.py
TCP bridge
- Connection manager
src/sketchup_mcp/server.py
SketchUp extension
- TCP command server
su_mcp/su_mcp/main.rb - Scene inspection
su_mcp/su_mcp/main.rb - Selection handling
su_mcp/su_mcp/main.rb - Component editing
su_mcp/su_mcp/main.rb - Material control
su_mcp/su_mcp/main.rb - Woodworking joints
su_mcp/su_mcp/main.rb - Ruby evaluation
su_mcp/su_mcp/main.rb - Scene export
su_mcp/su_mcp/main.rb - Active model
Connections 17
- Claude / MCP client → MCP tools: calls tools
- MCP tools → Connection manager: forwards commands
- Connection manager → TCP command server: sends JSON/TCP
- TCP command server → Scene inspection: dispatches
- TCP command server → Selection handling: dispatches
- TCP command server → Component editing: dispatches
- TCP command server → Material control: dispatches
- TCP command server → Woodworking joints: dispatches
- TCP command server → Ruby evaluation: dispatches
- TCP command server → Scene export: dispatches
- Scene inspection → Active model: reads scene
- Selection handling → Active model: reads selection
- Component editing → Active model: edits entities
- Material control → Active model: updates materials
- Woodworking joints → Active model: builds joints
- Ruby evaluation → Active model: executes against
- Scene export → Active model: exports scene