RQ

russell-qca/sketchup-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

32 stars 12 forks 质量 58 趋势 0

通过模型上下文协议(MCP)将Claude连接到SketchUp。

概览

通过模型上下文协议(MCP)将Claude连接到SketchUp。 插件现在采用了模块化结构。使用部署脚本: 脚本会:- 自动找到你的 SketchUp 插件目录 - 复制所有必要文件(主插件 + 库/模块) - 创建所需的目录结构 - 警告 SketchUp 是否运行 重启SketchUp。SketchUp加载时服务器。 打开SketchUp Ruby控制台。你应该会看到这些启动提示: 你应该会看到带有你型号详细信息的JSON回复。 - Python 3.10+ - uv(推荐)或 pip 服务器会启动并通过stdio进行通信。按Ctrl+C可以停止。

概述(AI 翻译)

通过模型上下文协议(MCP)将Claude连接到SketchUp。

建筑


安装

第一部分 — 安装SketchUp Ruby插件

自动安装(推荐)

插件现在采用了模块化结构。使用部署脚本:

剧本将:

  • 自动查找您的SketchUp插件目录
  • 复制所有必要文件(主插件 + 库/模块)
  • 创建所需的目录结构
  • 如果 SketchUp 正在运行,请提醒

手动安装

如果你更喜欢手动安装:

插件文件夹位置:

OS 路径
macOS ~/Library/Application Support/SketchUp /SketchUp/Plugins/
Windows %APPDATA%\SketchUp\SketchUp \SketchUp\Plugins\

复制这些文件:

启动服务器

重启SketchUp。服务器在SketchUp加载时自动启动于8080端口。

你也可以使用:

  • MCP 服务器→启动服务器→插件
  • MCP 服务器→停止服务器→插件
  • MCP 服务器→插件 → 重启服务器

验证

打开SketchUp Ruby控制台。你应该会看到这些启动提示:

测试连接:

你应该会看到带有你型号详细信息的JSON回复。


本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

SketchUp MCP Server

Connect Claude to SketchUp via the Model Context Protocol (MCP).

Architecture

Claude Desktop (MCP client)
        ↕  stdio (MCP protocol)
sketchup-mcp  (Python MCP server)
        ↕  HTTP REST  localhost:8080
sketchup_mcp_server.rb  (Ruby WEBrick plugin inside SketchUp)
        ↕  SketchUp Ruby API
 SketchUp Model

Installation

Part 1 — Install the SketchUp Ruby Plugin

The plugin now has a modular structure. Use the deployment script:

cd sketchup-mcp/sketchup_plugin
./deploy.sh

The script will:

  • Find your SketchUp Plugins directory automatically
  • Copy all necessary files (main plugin + lib/ modules)
  • Create the required directory structure
  • Warn if SketchUp is running

Manual Installation

If you prefer manual installation:

Plugins folder location:

OS Path
macOS ~/Library/Application Support/SketchUp /SketchUp/Plugins/
Windows %APPDATA%\SketchUp\SketchUp \SketchUp\Plugins\

Copy these files:

PLUGINS="~/Library/Application Support/SketchUp 2024/SketchUp/Plugins"

cp sketchup_plugin/sketchup_mcp_server.rb "$PLUGINS/"
mkdir -p "$PLUGINS/lib/construction"
cp sketchup_plugin/lib/construction.rb "$PLUGINS/lib/"
cp sketchup_plugin/lib/construction/roof_truss.rb "$PLUGINS/lib/construction/"

Start the Server

Restart SketchUp. The server auto-starts on port 8080 when SketchUp loads.

You can also use:

  • Plugins → MCP Server → Start Server
  • Plugins → MCP Server → Stop Server
  • Plugins → MCP Server → Restart Server

Verify

Open the SketchUp Ruby Console. You should see these startup messages:

====== LOADING SKETCHUP MCP PLUGIN ======
====== REQUIRES COMPLETE ======
====== CONSTRUCTION MODULES LOADED ======
====== SKETCHUP MCP SERVER STARTED ======

Test the connection:

require 'net/http'
Net::HTTP.get(URI('http://localhost:8080/model/info'))

You should see a JSON response with your model’s details.


Part 2 — Install the Python MCP Server

Prerequisites

  • Python 3.10+
  • uv (recommended) or pip
# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone or navigate to this repository
cd sketchup-mcp

# Install the package and dependencies
uv pip install -e .

# The CLI command 'sketchup-mcp' is now available

Install with pip

cd sketchup-mcp
pip install -e .

Test it standalone

# With SketchUp running and plugin loaded:
sketchup-mcp

The server will start and communicate via stdio. Press Ctrl+C to stop.


Part 3 — Connect to Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "sketchup": {
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "sketchup": { "command": "sketchup-mcp" } } }