> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aliengh.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect an agent

> Let Claude Code, Cursor or any MCP client build and wire components while you watch.

Alien runs an MCP server inside Grasshopper. It starts when Grasshopper loads and listens only on your own machine:

```text theme={null}
http://127.0.0.1:9876/mcp
```

Connect your agent and it can place and wire components, edit scripts, inspect results, look at the viewport and drive Rhino, live on your canvas.

## Connect

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={null}
    claude mcp add --transport http alien http://127.0.0.1:9876/mcp
    ```
  </Tab>

  <Tab title="Cursor and others">
    ```json theme={null}
    {
      "mcpServers": {
        "alien": { "url": "http://127.0.0.1:9876/mcp" }
      }
    }
    ```
  </Tab>
</Tabs>

Rhino and Grasshopper need to be open. The server tells the agent how to work with Alien when it connects, and its `docs` tool serves the full reference, so there's nothing to paste into a prompt.

## What your agent can do

<AccordionGroup>
  <Accordion title="Grasshopper" icon="diagram-project">
    | Tool | What it does |
    | - | - |
    | `canvas` | See the canvas: components, their state, pins and wires, and what you've selected |
    | `add` | Place an Alien component with a new or existing script, or any Grasshopper component. Builds whole chains in one call |
    | `wire` | Connect or disconnect wires |
    | `delete` | Remove components (script files are kept) |
    | `search` | Find components in the Grasshopper library |
    | `script_read` | Read a component's script |
    | `script_edit` | Change a script and wait for the re-run, with any error and its line |
    | `generate` | Describe a component: the same write, run and fix loop as the panel |
    | `inspect` | Summarise a component's data: counts, types, ranges, samples |
    | `set_values` | Set inputs and re-run, or press a button |
    | `bake` | Bake a component's output into the Rhino document |
  </Accordion>

  <Accordion title="Rhino" icon="cube">
    | Tool | What it does |
    | - | - |
    | `doc` | Rhino and Grasshopper document info; save |
    | `objects` | List and filter Rhino objects |
    | `layers` | The layer tree; create and change layers |
    | `view` | Set the viewport: view, camera, display mode, zoom |
    | `capture` | A picture of the viewport or the canvas |
    | `rhino` | Run a Rhino command |
    | `run_code` | Run a short Python or C# snippet inside Rhino |
  </Accordion>

  <Accordion title="Reference" icon="book">
    | Tool | What it does |
    | - | - |
    | `docs` | The Alien reference, by topic |
    | `repo` | The script folder and, with `library: true`, every component by category plus the generated objects |
  </Accordion>
</AccordionGroup>

In the next beta, changes made through `add`, `wire`, `delete` and `set_values` can be undone with **Cmd/Ctrl+Z**, the same as your own.

## Try it

```text theme={null}
Look at my canvas, then add a component that offsets the selected curve inwards five times by 300 mm, and show me the viewport.
```

## Keep it local

<Warning>
  The server listens on loopback only and refuses requests from web pages. Any program running on your computer can still use it, including `run_code`, as with any local MCP server. Don't expose port 9876 to your network.
</Warning>

Port 9876 taken? Set `"port"` in [Settings](/reference/settings) and restart Rhino.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.