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

# Open in Claude Code / Cursor

> Hand off investigations to your coding agent with one click via MCP and the Struct CLI bridge

After Struct completes an investigation, you can open it directly in **Claude Code** or **Cursor** with one click. Your coding agent receives the full investigation context — root cause, relevant logs, code references, and suggested fix — so it can start implementing immediately.

<Tip>
  You can also use the [Struct Build Agent](/build-agent) to implement fixes automatically without leaving Struct.
</Tip>

<Warning>
  **Setup requires two steps.** Install the MCP server (Step 1) so your agent can access investigation data, and the CLI bridge (Step 2) so the one-click "Open in" buttons work.
</Warning>

***

## Step 1: Set Up MCP

The Struct MCP server gives your coding agent access to investigation data. Set it up from **Settings** → **Coding Agent** in the web app.

<Tabs>
  <Tab title="Claude Code">
    <Steps>
      <Step title="Install MCP">
        Go to **Settings** → **Coding Agent** → **Claude Code** tab and copy the install command:

        ```bash theme={null}
        claude mcp add --transport http struct <your-mcp-url>
        ```

        You can find the full command with your MCP URL in the settings page.
      </Step>

      <Step title="Ready">
        OAuth login is triggered automatically on first use. You can now use Struct MCP tools directly in Claude Code.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Cursor">
    <Steps>
      <Step title="Install MCP">
        Go to **Settings** → **Coding Agent** → **Cursor** tab and click **Install Struct MCP**. This opens Cursor and configures the MCP server automatically.

        Alternatively, add this to your `.cursor/mcp.json` manually:

        ```json theme={null}
        {
          "mcpServers": {
            "struct": {
              "url": "<your-mcp-url>"
            }
          }
        }
        ```

        You can find your MCP URL in the settings page.
      </Step>

      <Step title="Ready">
        OAuth login is triggered automatically on first use. You can now use Struct MCP tools directly in Cursor.
      </Step>
    </Steps>
  </Tab>
</Tabs>

### Available MCP Tools

| Tool                       | Description                                       |
| -------------------------- | ------------------------------------------------- |
| `get_investigation_detail` | Fetch the full investigation report for a session |
| `search_investigations`    | Search across past investigations                 |

***

## Step 2: Install the CLI Bridge

The CLI bridge registers a `struct://` protocol handler on your machine, enabling the one-click **Open in** buttons in the Struct web app.

```bash theme={null}
npm install -g @struct/cli
struct bridge install
```

Then authenticate:

```bash theme={null}
struct login
```

### How "Open in" Works

1. Open an investigation in the Struct web app
2. Click **Open in Claude Code** or **Open in Cursor**
3. Your browser triggers the `struct://` protocol, which the CLI bridge handles
4. Your coding agent opens with the full investigation context loaded via MCP

<Note>
  If the CLI bridge isn't installed, Struct will show install instructions and a fallback option to copy the investigation context to your clipboard.
</Note>

### CLI Commands

The Struct CLI also supports manual handoff from the terminal:

```bash theme={null}
# Open an investigation in your coding agent
struct fix <session-id> --agent claude_code
struct fix <session-id> --agent cursor

# Take over a session locally
struct local --issue-url <linear-issue-url>
struct local --pr-url <github-pr-url>
struct local --thread-url <slack-thread-url>

# Generate MCP config for your agent
struct connect
```

### Uninstall

```bash theme={null}
struct bridge uninstall
```
