AI-architecture

Xiaohu1009/AI-architecture

3.3

If you are the rightful owner of AI-architecture and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

AI MCP Server is a unified Model Context Protocol server that integrates Rhino and Grasshopper for enhanced 3D modeling and parametric design.

AI MCP Server - Unified Rhino & Grasshopper Integration

English | 中文

English

AI MCP Server is a unified Model Context Protocol (MCP) server that integrates both Rhino and Grasshopper functionality, providing AI agents with comprehensive 3D modeling and parametric design capabilities.

Key Features

🎯 Unified Interface
  • Single MCP server supporting both Rhino and Grasshopper
  • Smart routing: automatically selects target platform based on operation type
  • Unified error handling and logging
🏗️ Rhino 3D Modeling
  • Object Creation: Points, lines, circles, arcs, ellipses, curves, boxes, spheres, cones, cylinders, surfaces
  • Object Operations: Modify, delete, select objects
  • Document Management: Get document info, layer management
  • Script Execution: Execute RhinoScript Python code
  • Object Queries: Get object info, selected objects info
🔧 Grasshopper Parametric Design
  • Component Management: Add, connect, query components
  • Parametric Modeling: Create complex parametric geometries
  • Pattern Recognition: Create component patterns based on high-level descriptions
  • Smart Connections: Automatically handle data flow connections between components
🚀 Advanced Features
  • Smart Routing: Automatically select Rhino or Grasshopper based on operation type
  • Data Conversion: Convert geometric data between Rhino and Grasshopper
  • Batch Operations: Support batch creation and modification of objects
  • Real-time Sync: Keep data synchronized between both platforms

System Architecture

AI MCP Server
├── Core Server (Python FastMCP)
├── Rhino Bridge (TCP: 1999)
├── Grasshopper Bridge (TCP: 8080)
└── Unified API Layer

Requirements

  • Python 3.10+
  • Rhino 7+ (Windows/Mac)
  • Grasshopper (installed with Rhino)

Quick Start

  1. Navigate to AI MCP Server

    cd AI_mcp_server
    
  2. Install Dependencies

    pip install -e .
    
  3. Start Server

    # Option 1: Direct Python
    python run_server.py
    
    # Option 2: Use startup script (Windows)
    start_server.bat
    
    # Option 3: Use startup script (Linux/Mac)
    chmod +x start_server.sh
    ./start_server.sh
    
  4. Configure AI Client

    For Claude Desktop, add to your MCP configuration:

    {
      "mcpServers": {
        "ai-mcp-server": {
          "command": "python",
          "args": ["run_server.py"],
          "cwd": "D:\\mcp_sever\\AI_mcp_server"
        }
      }
    }
    

    Note: Update the cwd path to match your actual installation directory.

📖 Quick Start Guide: See for detailed setup instructions.
🚀 Cursor Setup: See for quick Cursor IDE setup (Recommended for Chinese users).

Current Status

Server Successfully Running: The AI MCP server can now start properly
Tools Registered: All MCP tools are correctly registered
Connection Detection: Server can detect Rhino and Grasshopper connection status
Graceful Shutdown: Supports Ctrl+C graceful shutdown

Note: The server shows that Rhino (port 1999) and Grasshopper (port 8080) are not connected, which is normal since:

  • These ports require corresponding Rhino and Grasshopper plugins to be running
  • The server is designed to run even without connections, with tools showing connection errors when platforms are unavailable

中文

AI MCP Server是一个统一的Model Context Protocol (MCP)服务器,集成了Rhino和Grasshopper的功能,为AI代理提供完整的3D建模和参数化设计能力。

功能特性

🎯 统一接口
  • 单一MCP服务器同时支持Rhino和Grasshopper
  • 智能路由:根据操作类型自动选择目标平台
  • 统一的错误处理和日志记录
🏗️ Rhino 3D建模
  • 对象创建:点、线、圆、弧、椭圆、曲线、盒子、球体、圆锥、圆柱、表面等
  • 对象操作:修改、删除、选择对象
  • 文档管理:获取文档信息、图层管理
  • 脚本执行:执行RhinoScript Python代码
  • 对象查询:获取对象信息、选择对象信息
🔧 Grasshopper参数化设计
  • 组件管理:添加、连接、查询组件
  • 参数化建模:创建复杂的参数化几何体
  • 模式识别:基于高级描述创建组件模式
  • 智能连接:自动处理组件间的数据流连接
🚀 高级功能
  • 智能路由:根据操作类型自动选择Rhino或Grasshopper
  • 数据转换:在Rhino和Grasshopper之间转换几何数据
  • 批量操作:支持批量创建和修改对象
  • 实时同步:保持两个平台之间的数据同步

系统架构

AI MCP Server
├── Core Server (Python FastMCP)
├── Rhino Bridge (TCP: 1999)
├── Grasshopper Bridge (TCP: 8080)
└── Unified API Layer

安装要求

  • Python 3.10+
  • Rhino 7+ (Windows/Mac)
  • Grasshopper (随Rhino安装)

快速开始

  1. 进入AI MCP Server目录

    cd AI_mcp_server
    
  2. 安装依赖

    pip install -e .
    
  3. 启动服务器

    # 方式1:直接使用Python
    python run_server.py
    
    # 方式2:使用启动脚本 (Windows)
    start_server.bat
    
    # 方式3:使用启动脚本 (Linux/Mac)
    chmod +x start_server.sh
    ./start_server.sh
    
  4. 配置AI客户端

    对于Claude Desktop,请添加到您的MCP配置中:

    {
      "mcpServers": {
        "ai-mcp-server": {
          "command": "python",
          "args": ["run_server.py"],
          "cwd": "D:\\mcp_sever\\AI_mcp_server"
        }
      }
    }
    

    注意:请更新cwd路径以匹配您的实际安装目录。

📖 快速开始指南: 查看 获取详细的设置说明。

当前状态

服务器成功运行:AI MCP服务器现在可以正常启动
工具注册完成:所有MCP工具都已正确注册
连接检测:服务器能够检测Rhino和Grasshopper的连接状态
优雅关闭:支持Ctrl+C优雅关闭

说明:服务器显示Rhino (端口1999) 和 Grasshopper (端口8080) 都未连接,这是正常的,因为:

  • 这些端口需要相应的Rhino和Grasshopper插件运行
  • 服务器设计为即使没有连接也能运行,只是相关工具会显示连接错误

使用方法

现在您可以通过以下方式启动服务器:

cd AI_mcp_server
python run_server.py

服务器将使用stdio传输协议运行,可以与MCP客户端(如Claude Desktop)集成。

项目结构

mcp_sever/
├── AI_mcp_server/              # 主项目目录
│   ├── src/ai_mcp_server/      # 核心源代码
│   ├── docs/                   # 文档
│   ├── examples/               # 示例代码
│   └── README.md               # 详细项目说明
├── demonstration/               # 演示文件
├── PROJECT_SUMMARY.md          # 项目重构总结
└── README.md                   # 本文件

许可证

MIT License - 详见LICENSE文件

支持

如有问题或建议,请提交Issue或联系开发团队。