
SketchUp 的 MCP 服务器
概览
将Claude(或任何支持MCP的AI客户端)连接到SketchUp,实现提示驱动的3D建模。 - (PyPI 上的 sketchup-mcp2)— 通过模型上下文协议向大型语言模型(LLM)开放类型工具。- — 在 SketchUp 内部运行 TCP 服务器,并对当前模型执行命令。 要么从发布页面获取最新的.rbz,要么从源码构建: 在 SketchUp 中:窗口→扩展管理器→安装扩展,选择 .rbz,重启 SketchUp。该插件自带eval_ruby——SketchUp 内任意 Ruby 执行——;在 MCP 服务器的插件→设置→中取消勾选......以关闭门。 MCP 服务器→ Start Server →插件——默认监听于 127.0.0.1:9876。 对于 Claude Code / Claude Desktop,请添加 .mcp.json (或claude_desktop_config.json): UVX会自动从PyPI拉取SketchUp-MCP2——如果你没有UV,请安装。 就这些。问Claude诸如“做一张1.2×0.8米的橡木餐桌”,然后看着它发生。
概述(AI 翻译)
将Claude(或任何支持MCP的AI客户端)连接到SketchUp,实现提示驱动的3D建模。
双进程桥:
- Python MCP 服务器(PyPI 上的
sketchup-mcp2)——通过模型上下文协议向大型语言模型(LLM)开放类型化工具。 - Ruby SketchUp 扩展 — 在 SketchUp 内部运行 TCP 服务器,并对实时模型执行命令。
快速开始
1.安装SketchUp扩展
要么从发布页面获取最新的.rbz,要么从源代码构建:
在 SketchUp 中:Window → Extension Manager → Install Extension,选择 .rbz,重启 SketchUp。该插件自带 eval_ruby —— 在 SketchUp 内任意执行 Ruby —— 默认启用;取消勾选 在 Plugins → MCP Server → Settings... 中启用 Ruby 评估以关闭门。
2.在 SketchUp 内部启动服务器
Plugins → MCP Server → Start Server —— 默认监听 127.0.0.1:9876。
3.配置你的MCP客户端
对于 Claude Code / Claude Desktop,请在 .mcp.json(或 [claude_desktop_config.json])添加:
uvx 会自动从 PyPI 中拉取 sketchup-mcp2——如果你没有 UV,请安装它。
就这些。问Claude类似*“创建一个1.2×0这样的问题。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCP Server for SketchUp
Connect Claude (or any MCP-aware AI client) to SketchUp for prompt-driven 3D modeling.
Two-process bridge:
- Python MCP server (
sketchup-mcp2on PyPI) — exposes typed tools to the LLM via the Model Context Protocol. - Ruby SketchUp extension — runs a TCP server inside SketchUp and executes commands against the live model.
Quickstart
1. Install the SketchUp extension
Either grab the latest .rbz from the Releases page or build it from source:
gem install --user-install rubyzip
(cd mcp_for_sketchup && ruby package.rb)
# → mcp_for_sketchup/mcp_for_sketchup_v.rbz
In SketchUp: Window → Extension Manager → Install Extension, pick the .rbz, restart SketchUp. The plugin ships with eval_ruby — arbitrary Ruby execution inside SketchUp — enabled by default; uncheck Enable Ruby evaluation in Plugins → MCP Server → Settings... to close the gate.
2. Start the server inside SketchUp
Plugins → MCP Server → Start Server — by default listens on 127.0.0.1:9876.
3. Configure your MCP client
For Claude Code / Claude Desktop, add to .mcp.json (or claude_desktop_config.json):
{
"mcpServers": {
"sketchup": {
"command": "uvx",
"args": ["sketchup-mcp2"],
"env": {
"SKETCHUP_MCP_HOST": "127.0.0.1",
"SKETCHUP_MCP_PORT": "9876",
"SKETCHUP_MCP_TIMEOUT": "60",
"SKETCHUP_MCP_LOG_LEVEL": "INFO"
}
}
}
}
uvx will pull sketchup-mcp2 from PyPI automatically — install uv if you don’t have it.
That’s it. Ask Claude things like “create a 1.2 × 0.8 m oak dining table” and watch it happen.
Features
Tool catalogue
| Category | Tools |
|---|---|
| Geometry | create_component (cube / cylinder / cone / sphere), delete_component, transform_component — all dimensions in mm; position is an absolute bbox-min target |
| Materials | set_material — paints a group, component instance, face or edge with an existing material (by name), a named color or hex #rrggbb |
| Booleans | boolean_operation — union / difference / intersection |
| Edge ops | chamfer_edge, fillet_edge — feature edges only (seams and concave edges skipped; fillet also skips curved rims and refuses a body without straight feature edges); distance/radius in mm, segments configurable |
| Joinery | create_mortise_tenon, create_dovetail, create_finger_joint |
| Export | export_scene — skp / obj / dae / stl / png / jpg; skp is refused for an untitled model |
安装
uvx sketchup-mcp2配置
{
"mcpServers": {
"sketchup": {
"command": "uvx",
"args": ["sketchup-mcp2"],
"env": {
"SKETCHUP_MCP_HOST": "127.0.0.1",
"SKETCHUP_MCP_PORT": "9876",
"SKETCHUP_MCP_TIMEOUT": "60",
"SKETCHUP_MCP_LOG_LEVEL": "INFO"
}
}
}
}