vn-sketchup-mcp
Controls SketchUp models via MCP tools: create, delete, and transform components; get selection; set materials; export scenes; run arbitrary Ruby inside SketchUp; and create mortise-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 at the origin and make it wood 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: vn-sketchup-mcp
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
Each tool has a clearly distinct resource and action: component CRUD/transform/material, selection retrieval, scene export, Ruby evaluation, and three specific joint-creation operations. The joint tools are similar in category but explicitly differentiated by joint type, so an agent can select among them reliably.
All tools use snake_case with a predictable verb_noun pattern: export_scene, create_component, delete_component, transform_component, get_selection, set_material, and create_* joint tools. There are no mixed conventions or vague names.
The server exposes 10 tools, which is well within the ideal 3-15 range and each tool maps to a meaningful SketchUp operation. The set does not feel bloated or artificially thin.
The surface covers component creation, deletion, transformation, material assignment, selection retrieval, export, and specialized joints, but lacks structured operations for listing/retrieving components by ID, setting or clearing selection, and saving/opening models. eval_ruby can work around these gaps, but relying on arbitrary Ruby evaluation is not a complete structured lifecycle surface.
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Headless CAD engine & MCP server for 2D/3D drafting, solids, DXF/SVG export, and automation.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
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
- AlicenseBqualityDmaintenanceEnables controlling SketchUp from MCP-compatible clients via a stdio Python server that bridges to a Ruby plugin, supporting component operations, material assignment, scene export, arbitrary Ruby evaluation, and wood joinery tools.1015MIT
- AlicenseAqualityCmaintenanceConnects 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