SketchupMCP

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Enables two-way communication with SketchUp, allowing component creation, manipulation, and transformation; material application; scene inspection; selection handling; and execution of Ruby code for 3D modeling and scene management.

SketchupMCP - Sketchup 模型上下文协议集成

SketchupMCP 通过模型上下文协议 (MCP) 将 Sketchup 与 Claude AI 连接起来,使 Claude 能够直接与 Sketchup 交互并控制 Sketchup。这种集成支持在 Sketchup 中进行快速辅助的 3D 建模、场景创建和操作。

非常感谢Blender MCP提供的灵感和结构。

特征

  • 双向通信:通过 TCP 套接字连接将 Claude AI 连接到 Sketchup
  • 组件操作:在 Sketchup 中创建、修改、删除和转换组件
  • 材料控制:应用和修改材料和颜色
  • 场景检查:获取当前 Sketchup 场景的详细信息
  • 选择处理:获取并操作选定的组件
  • Ruby 代码评估:直接在 SketchUp 中执行任意 Ruby 代码以进行高级操作

成分

该系统由两个主要组件组成:

  1. Sketchup 扩展:Sketchup 扩展,在 Sketchup 中创建 TCP 服务器来接收和执行命令
  2. MCP 服务器 ( sketchup_mcp/server.py ) :一个实现模型上下文协议 ( MCP ) 并连接到 Sketchup 扩展的 Python 服务器

安装

Python 打包

我们正在使用 uv,因此您需要brew install uv

Sketchup扩展

  1. 下载或构建最新的.rbz文件
  2. 在 Sketchup 中,转到窗口 > 扩展管理器
  3. 点击“安装扩展程序”并选择下载的.rbz文件
  4. 重新启动 Sketchup

用法

启动连接

  1. 在 Sketchup 中,转到扩展 > SketchupMCP > 启动服务器
  2. 服务器将在默认端口(9876)上启动
  3. 确保 MCP 服务器正在你的终端中运行

与 Claude 一起使用

通过将以下内容添加到 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 代码以进行高级操作

示例命令

以下是您可以要求克劳德做的事情的一些示例:

  • “创建一个带有屋顶和窗户的简单房屋模型”
  • “选择所有组件并获取其信息”
  • “将选定的组件设为红色”
  • “将选定的组件向上移动 10 个单位”
  • “将当前场景导出为 3D 模型”
  • “使用 Ruby 代码创建一个复杂的工艺品柜”

故障排除

  • 连接问题:确保 Sketchup 扩展服务器和 MCP 服务器都在运行
  • 命令失败:检查 Sketchup 中的 Ruby 控制台是否有错误消息
  • 超时错误:尝试简化您的请求或将其分解为更小的步骤

技术细节

通信协议

该系统使用基于 JSON 的简单 TCP 套接字协议:

  • 命令以 JSON 对象的形式发送,带有type和可选params
  • 响应是带有statusresultmessage JSON 对象

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

执照

麻省理工学院

-
security - not tested
F
license - not found
-
quality - not tested

通过模型上下文协议将 Sketchup 连接到 Claude AI,使 Claude 能够直接与 Sketchup 交互并控制 Sketchup,从而实现快速辅助的 3D 建模和场景操作。

  1. Features
    1. Components
      1. Installation
        1. Python Packaging
        2. Sketchup Extension
      2. Usage
        1. Starting the Connection
        2. Using with Claude
        3. Example Commands
      3. Troubleshooting
        1. Technical Details
          1. Communication Protocol
        2. Contributing
          1. License
            ID: klbs5dmoei