vn-sketchup-mcp
Provides tools for controlling SketchUp, allowing agents to create, delete, transform, and select components, assign materials, export scenes, run Ruby scripts, and generate woodworking joints such as mortise-and-tenon, dovetail, and finger joints.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@vn-sketchup-mcp Create a cube in SketchUp and assign it a red oak material."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
vn-sketchup-mcp
Điều khiển SketchUp từ Claude Code / Codex / Antigravity (và mọi MCP client dùng stdio) thông qua Model Context Protocol.
Bản Việt hoá + đã vá lỗi của mhyrr/sketchup-mcp: cài phát chạy ngay, không còn crash do lệch phiên bản thư viện mcp.
Control SketchUp from Claude Code / Codex / Antigravity via MCP. A fixed, ready-to-run fork of mhyrr/sketchup-mcp.
Vá gì so với bản gốc? (What is fixed)
Bản gốc crash ngay khi khởi động server vì:
Nó
import mcp.server.fastmcp(lớpFastMCP). Nhưng thư việnmcpbản 2.x đã đổi tênFastMCP->MCPServer, xoámcp.server.fastmcp. Khi cài bằnguvx/pipkhông ghim phiên bản, máy kéo vềmcp 2.x-> ModuleNotFoundError / crash -> MCP client báoConnection closed.Gói trên PyPI còn dùng API cũ
FastMCP(description=...)(đã bỏ), lỗiunexpected keyword argument 'description'.
Cách vá ở repo này:
pyproject.tomlghimmcp[cli]>=1.3,<2-> luôn càimcp 1.xcònFastMCP.Dùng
server.pybản mới (đã đổi sangFastMCP(instructions=...), hợp lệ vớimcp 1.x).Kèm installer 1 lệnh tự copy plugin Ruby vào mọi bản SketchUp + in sẵn cấu hình cho 3 client.
Kết quả: uv run vn-sketchup-mcp chạy ổn, kết nối được SketchUp (đã kiểm chứng trên SketchUp Pro 2018, Ruby 2.2.4; và các bản mới hơn).
Related MCP server: CDT-SketchUp
Kiến trúc (How it works)
Gồm 2 phần:
Plugin SketchUp (Ruby) — chạy 1 TCP server bên trong SketchUp ở cổng 9876, nhận lệnh và thao tác model.
MCP server (Python) — client (Claude Code/Codex/Antigravity) chạy qua stdio; nó nối tới cổng 9876 để đẩy lệnh vào SketchUp.
Claude Code / Codex / Antigravity <--stdio--> vn-sketchup-mcp (Python) <--TCP:9876--> SketchUp (Ruby plugin)Yêu cầu
uv (tự tải Python 3.12, không cần cài Python riêng)
git
SketchUp (Pro để dùng được đủ Solid Tools; đã test 2018+)
Cài đặt (Install)
1. Clone
git clone https://github.com/andyluu98/vn-sketchup-mcp.git
cd vn-sketchup-mcp2. Chạy installer (khuyên dùng)
Windows (PowerShell):
powershell -ExecutionPolicy Bypass -File install.ps1macOS / Linux:
bash install.shInstaller sẽ: cài uv nếu thiếu -> uv sync (ghim mcp<2) -> copy plugin Ruby vào mọi bản SketchUp phát hiện được -> in sẵn cấu hình MCP.
3. Bật server trong SketchUp
Mở SketchUp -> menu Extensions > MCP Server > Start Server.
Ruby Console hiện Server created on port 9876 là OK. Giữ SketchUp mở khi dùng.
Đăng ký MCP cho từng client
Cấu hình cùng một dạng cho cả 3 (thay <REPO> = đường dẫn tuyệt đối bạn đã clone):
{
"mcpServers": {
"sketchup": {
"command": "uv",
"args": ["run", "--directory", "<REPO>", "vn-sketchup-mcp"]
}
}
}Claude Code: thêm vào
~/.claude.json(mụcmcpServers) hoặc chạy:claude mcp add sketchup -- uv run --directory <REPO> vn-sketchup-mcpCodex: thêm MCP server dạng trên vào cấu hình Codex (
~/.codex/config.tomlphần[mcp_servers]hoặc file cấu hình MCP tương ứng).Antigravity: thêm cùng khối
mcpServersvào phần cấu hình MCP của Antigravity.
Sau khi thêm, khởi động lại client. Nhớ SketchUp đang mở + đã Start Server.
Nếu
uvkhông nằm trong PATH của client, thay"command": "uv"bằng đường dẫn tuyệt đối tớiuv(vdC:\\Users\\<ban>\\.local\\bin\\uv.exe).
Công cụ (MCP tools)
Tool | Mô tả |
| Tạo khối cơ bản (cube...) theo vị trí/kích thước |
| Xoá đối tượng |
| Di chuyển/xoay/scale |
| Lấy các đối tượng đang chọn |
| Gán vật liệu/màu |
| Xuất scene |
| Chạy Ruby tuỳ ý trong SketchUp (mạnh nhất: dựng mọi hình học qua SketchUp Ruby API) |
| Mộng ghép gỗ |
eval_ruby là công cụ linh hoạt nhất: bạn mô tả, agent sinh Ruby dựng nhà/nội thất trực tiếp trong SketchUp.
Xử lý sự cố (Troubleshooting)
Triệu chứng | Nguyên nhân / Cách xử lý |
Client báo | Thường do |
| Đang dùng |
Không thấy menu Extensions > MCP Server | Plugin chưa cài. Chạy lại installer, hoặc |
Gọi tool báo lỗi kết nối | Chưa bấm Start Server trong SketchUp, hoặc SketchUp đã đóng. |
Lệnh đầu tiên sau khi kết nối lỗi lạ | Thử lại lần nữa (request đầu ngay sau bắt tay đôi khi chập). |
Ghi công (Credits)
Fork từ mhyrr/sketchup-mcp (MIT).
Việt hoá, vá lỗi phiên bản
mcp, thêm installer đa client: andyluu98.
MIT License.
Available Tools
10 toolscreate_componentC
Create a new component in Sketchup
Inputs: type, position, dimensions. Returns: result
create_dovetailC
Create a dovetail joint between two components
Inputs: pin_id (required), tail_id (required), angle, depth, +6 more. Returns: result
create_finger_jointB
Create a finger joint (box joint) between two components
Inputs: board1_id (required), board2_id (required), depth, width, +5 more. Returns: result
create_mortise_tenonC
Create a mortise and tenon joint between two components
Inputs: tenon_id (required), mortise_id (required), depth, width, +4 more. Returns: result
delete_componentB
Delete a component by ID
Inputs: id (required). Returns: result
eval_rubyB
Evaluate arbitrary Ruby code in Sketchup
Inputs: code (required). Returns: result
export_sceneC
Export the current scene
Inputs: format. Returns: result
get_selectionB
Get currently selected components
Inputs: no named parameters. Returns: result
set_materialC
Set material for a component
Inputs: id (required), material (required). Returns: result
transform_componentC
Transform a component's position, rotation, or scale
Inputs: id (required), scale, position, rotation. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools target distinct operations: component creation, deletion, transformation, selection, materials, scene export, and specific joint types. The main ambiguity is eval_ruby, which can theoretically perform any operation, but its purpose as a scripting escape hatch is clear.
Tool names consistently follow a verb_noun pattern, such as create_component, delete_component, transform_component, export_scene, and create_dovetail. There is no mixing of casing styles or vague verbs, making the naming predictable.
Ten tools is a well-scoped number for a Sketchup-focused server. Each tool covers a meaningful aspect of the modeling workflow, and the count is neither too sparse nor bloated.
The tool set covers core component operations and joint creation, but lacks direct component read/list operations and joint removal or editing tools. eval_ruby can fill some gaps, but it is a generic escape hatch rather than a structured part of the domain surface.
Maintenance
Related MCP Connectors
Headless CAD engine & MCP server for 2D/3D drafting, solids, DXF/SVG export, and automation.
Create, inspect, validate, and save editable 3D building scenes with Pascal's MCP server.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables direct interaction and control of SketchUp through Claude AI using the Model Context Protocol and a TCP socket connection. It allows for prompt-assisted 3D modeling, component manipulation, and the execution of arbitrary Ruby code within the SketchUp environment.101MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to inspect and manipulate live SketchUp models through a safe loopback bridge, supporting geometry creation, component/group operations, tags, materials, and transformations with persistent-ID safety.MIT
- AlicenseAqualityBmaintenanceConnects MCP-aware AI clients to a live SketchUp session so models can be built and edited through natural-language prompts. Exposes typed tools for geometry creation, materials, booleans, edge chamfers/fillets, joinery, scene export, model introspection, viewport screenshots, and an optional arbitrary-Ruby escape hatch.24MIT
- AlicenseCqualityBmaintenanceEnables MCP clients to inspect and modify SketchUp models through a local authenticated bridge, covering entity creation and editing, geometry, materials, tags, cameras, scenes, transactions, snapshots, and file or view export. It also offers an optional full SketchUp Ruby API execution channel and batch operations for furniture, architectural, and analysis tasks.371MIT