================================================================
  RhinoAIBridge v4.11.0 - Installation Guide
  by tanishqb | https://github.com/tanishqbhattad/rhino-mcp
================================================================

WHAT YOU NEED
-------------
  - Rhino 8 (any version)
  - Claude Desktop, OR an OpenAI/Anthropic API key, OR Ollama
  - Windows 10 or 11
  - Internet connection (first run only, to install Python deps)

You do NOT need:
  - .NET SDK
  - Visual Studio
  - Any manual config editing


================================================================
  STEP 1 — Extract the zip
================================================================

Unzip the downloaded rhino-mcp archive to any folder.
Example: C:\RhinoAIBridge\


================================================================
  STEP 2 — Run the installer
================================================================

Double-click INSTALL.bat

IMPORTANT: close BOTH Rhino and your AI client (Claude Desktop / Codex /
Antigravity) before running the installer. Each of them holds files open that
the installer needs to replace. The installer checks for this and will tell
you which one to close.

It will automatically:
  [1] Copy the pre-built plugin files to Rhino's plugin folder
  [2] Install uv (Python package manager) if not already present
  [3] Install the MCP server's Python dependencies and verify it imports
  [4] Patch Claude Desktop, Codex, and Gemini Antigravity configs when detected

The whole process takes 1-2 minutes.

When it finishes you get a verification report like this:

     Rhino plugin ........ OK
     uv .................. OK
     Python MCP server ... OK
     Clients configured .. Claude Desktop

If any line says FAIL, the reason is on screen and the full detail is written
to install-log.txt next to INSTALL.bat. The window always waits for you to
press ENTER, so it can never vanish before you have read it.


================================================================
  STEP 3 — Register the plugin in Rhino (first time only)
================================================================

1. Open Rhino 8
2. In the Rhino command line, type:  PluginManager
3. Click "Install..."
4. Navigate to:
   %APPDATA%\McNeel\Rhinoceros\8.0\Plug-ins\RhinoAIBridge\
   Select: RhinoAIBridge.rhp
5. Click Open

You only do this ONCE. After the first install, the plugin
loads automatically every time you open Rhino.


================================================================
  STEP 4 — Start the bridge
================================================================

You do NOT need to do anything. Since v4.10 the plugin loads with Rhino and
starts the bridge automatically, so simply opening Rhino 8 is enough.

You will see a confirmation message in the Rhino console:
  "Listening on 127.0.0.1:9544"

Access mode (how much the AI is allowed to do) is controlled by the
RHINO_AIBRIDGE_MODE environment variable:

  safe       blocks code execution and destructive edits
  standard   allows delete / boolean, still blocks code
  developer  full access - required for execute_python3

To set it, search Windows for "environment variables", add a new user
variable named RHINO_AIBRIDGE_MODE, and restart Rhino.

If the bridge ever does not start, type  AIBridge  in the Rhino command line
to start it manually.  To stop it:  AIBridgeStop


================================================================
  STEP 5A — Connect Claude Desktop
================================================================

1. Restart Claude Desktop (the installer already patched the config)
2. Open a new conversation
3. Type:  ping Rhino
4. Claude should respond with your document name and object count

If it doesn't work:
  - Make sure Rhino is open and AIBridge is running (Step 4)
  - Check %APPDATA%\Claude\claude_desktop_config.json contains
    an entry with "rhino-architect" in it


================================================================
  STEP 5B — Connect ChatGPT
================================================================

Open a terminal (Command Prompt or PowerShell) and run:

  cd C:\RhinoAIBridge\server
  set OPENAI_API_KEY=sk-your-key-here
  uv run python chat.py --provider openai --model gpt-4o

Then type your instructions at the prompt.


================================================================
  STEP 5C — Connect Ollama (free, runs locally)
================================================================

First install Ollama from https://ollama.com and pull a model:

  ollama pull qwen2.5-coder:7b

Then in a separate terminal run:

  ollama serve

Then open another terminal:

  cd C:\RhinoAIBridge\server
  uv run python chat.py --provider ollama --model qwen2.5-coder:7b

Best local models for Rhino work:
  - qwen2.5-coder:7b    (fast, good for simple tasks)
  - qwen2.5-coder:32b   (best quality, needs 20GB VRAM)
  - llama3.1:70b        (excellent tool use, needs 40GB RAM)


================================================================
  EXAMPLE PROMPTS TO TRY
================================================================

"ping Rhino"
  -> Confirms connection, shows scene info

"Create a 10-storey building mass, 20m x 30m footprint, 
 3.5m floor height, starting at Z=0"

"Derive floor slabs from that mass"

"Add a structural core in the centre"

"Set up standard architecture layers"

"Capture the viewport from the front view"

"Run the 'ExtractWireframe' command on object [id]"

"Report the total floor area grouped by layer"


================================================================
  TROUBLESHOOTING
================================================================

Problem: "Cannot connect to Rhino at 127.0.0.1:9544"
Fix: Open Rhino and type AIBridge in the command line

Problem: Plugin doesn't appear in Claude Desktop
Fix: Restart Claude Desktop. If still missing, open
     %APPDATA%\Claude\claude_desktop_config.json and check
     for a "rhino-architect" entry in "mcpServers"

Problem: uv command not found
Fix: Open a NEW terminal window after install. The PATH
     change from installation doesn't apply to already-open
     windows.

Problem: Ollama says "connection refused"
Fix: Run "ollama serve" in a terminal BEFORE starting chat.py

Problem: "PluginManager" doesn't show RhinoAIBridge
Fix: Make sure you browsed to the .rhp file at:
     %APPDATA%\McNeel\Rhinoceros\8.0\Plug-ins\RhinoAIBridge\


================================================================
  UNINSTALL
================================================================

1. In Rhino: PluginManager -> find RhinoAIBridge -> Uninstall
2. Delete the folder:
   %APPDATA%\McNeel\Rhinoceros\8.0\Plug-ins\RhinoAIBridge\
3. Remove the rhino-architect entry from:
   %APPDATA%\Claude\claude_desktop_config.json


================================================================
  SUPPORT & SOURCE CODE
================================================================

GitHub: https://github.com/tanishqbhattad/rhino-mcp
Issues: https://github.com/tanishqbhattad/rhino-mcp/issues

MIT License — free for personal and commercial use.

================================================================
