Skip to main content
Glama

SketchupMCP - Sketchup 模型上下文協議(MCP)整合

SketchupMCP 透過模型上下文協議(MCP)將 Sketchup 連接到 Claude AI,使 Claude 能夠直接與 Sketchup 互動和控制。這項整合允許使用提示輔助 3D 建模、場景創建和操作 Sketchup。

特別感謝 mhyrr/sketchup-mcp 提供的架構。 我們對其原生版本(mhyrr/sketchup-mcp)進行了繁體中文化及部份功能優化與調整。

功能

  • 雙向通信:透過 TCP 套接字連接 Claude AI 與 Sketchup

  • 組件操作:在 Sketchup 中創建、修改、刪除和變換組件

  • 材質控制:應用和修改材質與顏色

  • 場景檢查:獲取當前 Sketchup 場景的詳細資訊

  • 選取處理:獲取並操作已選取的組件

  • Ruby 代碼執行:在 Sketchup 中直接執行任意 Ruby 代碼,以進行高級操作

Related MCP server: SketchupMCP

組件

該系統由兩個主要組件組成:

  1. Sketchup 擴展:在 Sketchup 內部創建 TCP 伺服器來接收並執行命令的擴展

  2. MCP 伺服器(sketchup_mcp/server.py):實作模型上下文協議並連接到 Sketchup 擴展的 Python 伺服器

安裝

安裝 Sketchup 擴展

  1. 下載或自行構建最新的 .rbz 檔案

  2. 在 Sketchup 中,前往 Window > Extension Manager

  3. 點擊 Install Extension,然後選擇下載的 .rbz 檔案

  4. 重新啟動 Sketchup

Python 套件安裝

我們使用 uv 來管理 Python 環境,因此需要先安裝 uv:

pip install uv

Installing via Smithery

要使用 Smithery 安裝 Sketchup MCP:

npx -y @smithery/cli install @BearNetwork-BRNKC/SketchUp-MCP --client claude

安裝 Sketchup 擴展

  1. 下載或自行構建最新的 .rbz 檔案

  2. 在 Sketchup 中,前往 Window > Extension Manager

  3. 點擊 Install Extension,然後選擇下載的 .rbz 檔案

  4. 重新啟動 Sketchup

使用方式

啟動連線

  1. 在 Sketchup 中,前往 Extensions > SketchupMCP > Start Server

  2. 伺服器將預設啟動在 9876 端口

  3. 確保 MCP 伺服器已在終端執行

與 Claude 配合使用

在 Claude 配置中加入以下內容,以使用 MCP 伺服器:

"mcpServers": {
    "sketchup": {
        "command": "uvx",
        "args": [
            "sketchup-mcp"
        ]
    }
}

這將自動從 PyPI 下載最新版本。

成功連接後,Claude 將能夠透過以下功能與 Sketchup 互動:

工具

  • get_scene_info - 獲取當前 Sketchup 場景資訊

  • get_selected_components - 獲取當前選取的組件資訊

  • create_component - 創建新組件並指定參數

  • delete_component - 從場景中刪除組件

  • transform_component - 移動、旋轉或縮放組件

  • set_material - 為組件應用材質

  • export_scene - 將當前場景匯出為多種格式

  • eval_ruby - 在 Sketchup 中執行任意 Ruby 代碼以進行高級操作

指令示例

以下是一些可以要求 Claude 執行的操作示例:

  • "創建一個帶有屋頂和窗戶的簡單房屋模型"

  • "選取所有組件並獲取它們的資訊"

  • "將選取的組件變成紅色"

  • "將選取的組件向上移動 10 個單位"

  • "將當前場景匯出為 3D 模型"

  • "使用 Ruby 代碼創建一個複雜的藝術與工藝櫃"

疑難排解

  • 連線問題:確保 Sketchup 擴展伺服器和 MCP 伺服器都在運行

  • 命令執行失敗:檢查 Sketchup 的 Ruby 控制台以查看錯誤訊息

  • 超時錯誤:嘗試簡化請求或將操作拆分為較小的步驟

技術細節

通信協議

該系統使用基於 TCP 套接字的簡單 JSON 協議:

  • 命令 以 JSON 物件的形式發送,包含 type 和可選的 params

  • 回應 以 JSON 物件的形式返回,包含 status 及 result 或 message

授權

MIT 授權許可證

Available Tools

10 tools
create_componentC

Create a new component in Sketchup

Inputs: dimensions, position, type.

create_dovetailC

Create a dovetail joint between two components

Inputs: pin_id (required), tail_id (required), angle, depth, +6 more.

create_finger_jointC

Create a finger joint (box joint) between two components

Inputs: board1_id (required), board2_id (required), depth, height, +5 more.

create_mortise_tenonC

Create a mortise and tenon joint between two components

Inputs: mortise_id (required), tenon_id (required), depth, height, +4 more.

delete_componentC

Delete a component by ID

Inputs: id (required).

eval_rubyB

Evaluate arbitrary Ruby code in Sketchup

Inputs: code (required).

export_sceneC

Export the current scene

Inputs: format.

get_selectionB

Get currently selected components

Inputs: no named parameters.

set_materialC

Set material for a component

Inputs: id (required), material (required).

transform_componentC

Transform a component's position, rotation, or scale

Inputs: id (required), position, rotation, scale.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 10 tools

    Disambiguation4/5

    Most tools have distinct purposes, but the four joint creation tools (create_dovetail, create_finger_joint, create_mortise_tenon) could be confusing as they all create joints between components with only subtle differences in joint type. Other tools like create_component, delete_component, and transform_component are clearly distinct.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with snake_case, such as create_component, delete_component, and export_scene. There are no deviations in naming style, making the set predictable and easy to understand.

    Tool Count5/5

    With 10 tools, this is well-scoped for a Sketchup integration server. The count covers core operations like component management, joint creation, and scene export without being overwhelming, fitting typical MCP server ranges.

    Completeness4/5

    The tool set covers key Sketchup operations including component CRUD (create, delete, transform), joint creation, selection, material setting, and scene export. A minor gap is the lack of a tool to update component properties beyond transformation, but agents can work around this using existing tools like eval_ruby.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Connects Sketchup to Claude AI through the Model Context Protocol, allowing Claude to directly interact with and control Sketchup for prompt-assisted 3D modeling and scene manipulation.
      10
      531
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables 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.
      10
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Connects SketchUp to Claude AI through the Model Context Protocol, enabling prompt-assisted 3D modeling, scene manipulation, and woodworking joinery operations.
      22
      1,258 PyPI
      58
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Connects Claude AI to SketchUp, allowing you to create and modify 3D models via natural language commands.
      21
      7
      MIT