关于 Rhino MCP Server
Rhino MCP Server 是面向 Rhino 3D 的 MCP 服务,使 Claude 等 AI 助手能够创建和修改三维对象。项目面向建模与建筑设计人员,但README标明该项目仍在开发中,插件创建对象的功能存在问题。
主要功能
- 01通过 MCP 创建球体、长方体与圆柱体
- 02查询当前场景信息
- 03清空场景对象与创建图层
- 04提供统一的服务启动与日志脚本
适用场景
- 01在 Claude Desktop 中辅助三维建模
- 02通过 AI 助手辅助建筑设计的场景搭建
- 03调试 Rhino 与 MCP 的连接问题
MCP 相关
该项目是一个 MCP 服务,向 MCP 客户端(如 Claude Desktop)暴露几何体、场景与图层相关的工具。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
Rhino MCP Server
⚠️ 正在建设中 ⚠️
本项目目前正在积极开发,尚无法正常运行。Rhino 插件在创建对象时遇到了问题。 我们正在积极寻求社区支持,以帮助解决这些问题。 如果你有 Rhino API 开发、C# 插件或 MCP 集成方面的经验,请考虑参与贡献。 请在 GitHub 上提交 issue 联系我们。
基于 Model Context Protocol(MCP)的 Rhino 3D 服务实现,让 Claude 能够创建和操纵 3D 对象。
概述
本项目实现了一个 Rhino 3D 的 MCP 服务,使 Claude 等 AI 助手能够通过 Model Context Protocol 与 Rhino 交互。该服务允许直接通过 AI 界面创建和操纵 3D 对象。
系统架构
系统由实现 MCP 服务的 Python 组件和与 Rhino 集成的 C# 组件构成。以下是系统组件交互方式的概览:
graph TD
%% Client Applications
client[Client Applications] --> socketProxy
%% Socket Proxy
subgraph "Python Socket Proxy"
socketProxy[socket_proxy.py] --> daemonServer
end
%% Daemon Server
subgraph "Python Daemon Server"
daemonServer[daemon_mcp_server.py] --> combinedServer
end
%% Combined MCP Server
subgraph "Python Combined MCP Server"
combinedServer[combined_mcp_server.py]
mcp[FastMCP] --> tools
combinedServer --> mcp
combinedServer --> rhinoConn
subgraph "MCP Tools"
tools[MCP Tool Methods]
end
rhinoConn[RhinoConnection]
end
%% Rhino Plugin Components
subgraph "C# Rhino Plugin"
rhinoPlugin[RhinoMcpPlugin.cs]
socketServer[RhinoSocketServer.cs]
utilities[RhinoUtilities.cs]
commands[RhinoMcpCommand.cs]
rhinoPlugin --> socketServer
rhinoPlugin --> commands
socketServer --> utilities
end
%% Connections between components
rhinoConn <==> socketServer
%% Logger Components
subgraph "Logging System"
logManager[log_manager.py]
nlogConfig[NLog.config]
end
combinedServer --> logManager
rhinoPlugin --> nlogConfig
%% Connection to Rhino
rhino[Rhino 3D Software]
rhinoPlugin --> rhino
classDef pythonClass fill:#3572A5,color:white;
classDef csharpClass fill:#178600,color:white;
classDef rhinoClass fill:#555555,color:white;
class socketProxy,daemonServer,combinedServer,mcp,tools,rhinoConn,logManager pythonClass;
class rhinoPlugin,socketServer,utilities,commands csharpClass;
class rhino rhinoClass;
有关系统架构的详细信息,包括组件说明和数据流,请参阅 code_architecture.md。
组件
目前有多种实现可供选择:
-
组合式 MCP 服务(推荐):
combined_mcp_server.py- 使用 stdin/stdout 进行通信的直接实现
-
基于 Socket 的服务:
daemon_mcp_server.py- 通过 Socket 连接接收命令的后台服务socket_proxy.py- 在 stdin 与守护进程服务之间转发命令的代理
-
独立服务:
standalone-mcp-server.py- 原始的独立实现
设置说明
1. 设置 Claude Desktop
- 如果尚未安装,请安装 Claude Desktop
- 在 Claude Desktop 设置中配置 MCP 服务连接
2. 运行服务
现在,我们提供了一个统一的服务启动器,可用于运行任意一种服务实现:
./server_launcher.sh [mode]
可用模式:
combined(默认)- 运行组合式 MCP 服务standalone- 运行独立 MCP 服务daemon- 运行守护进程 MCP 服务socket-proxy- 运行 Socket 代理direct- 同时运行守护进程和 Socket 代理logs- 查看最近的日志monitor- 实时监控日志errors- 查看最近的错误help- 显示帮助信息
示例:
# Run the combined server (recommended)
./server_launcher.sh combined
# Or simply
./server_launcher.sh
# Run the socket-based approach (daemon + proxy)
./server_launcher.sh direct
# Monitor logs in real-time
./server_launcher.sh monitor
可用工具
该服务提供了若干 3D 建模工具:
- geometry_tools.create_sphere - 根据指定的中心和半径创建球体
- geometry_tools.create_box - 根据指定的尺寸创建长方体
- geometry_tools.create_cylinder - 根据指定的参数创建圆柱体
- scene_tools.get_scene_info - 获取当前场景的信息
- scene_tools.clear_scene - 清除场景中的对象
- scene_tools.create_layer - 在文档中创建新图层
故障排除
如果遇到连接问题:
-
确保没有旧服务正在运行:
./server_launcher.sh help # This will clean up existing processes -
检查日志文件:
./server_launcher.sh logs # View logs ./server_launcher.sh errors # View errors -
完全重启 Claude Desktop
许可证
本项目基于 MIT License 发布。详情请参阅 LICENSE 文件。
改进后的日志系统
系统采用统一的日志框架,集中管理所有组件的日志:
- 服务日志
- 插件日志
- Claude AI 日志
- 诊断日志
所有日志均采用一致的格式,并存储在 logs/ 目录中;每个组件都有单独的子目录。
日志管理
我们提供了一个日志管理工具,支持强大的日志查看、监控和分析功能:
# View logs
./server_launcher.sh logs
# Monitor logs in real-time
./server_launcher.sh monitor
# View errors with context
./server_launcher.sh errors
# Generate error reports (using the log manager directly)
./log_manager.py report
有关日志系统用法的详细信息,请参阅 LOGGING.md。
开发
项目结构
combined_mcp_server.py:MCP 服务的主要实现diagnose_rhino_connection.py:用于测试 Rhino 连接的诊断工具log_manager.py:用于管理和分析日志的工具server_launcher.sh:用于启动任意服务实现的统一脚本logs/:包含所有日志的目录
添加新功能
- 在
combined_mcp_server.py文件中将新工具添加为方法 - 使用现有的日志框架,确保错误处理一致
- 根据需要更新诊断工具
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。