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

# MCP

> Connect AI clients to Traversal via the Model Context Protocol.

The Traversal MCP server lets any compatible AI client run investigations, ask follow-ups, and retrieve results using the [Model Context Protocol](https://modelcontextprotocol.io/). It uses the streamable-http transport with API key authentication.

**Endpoint:** `https://api.prod.traversal.com/mcp/`

For [BYOC deployments](/architecture/byoc), use your organization's API URL + `/mcp/`.

## Authentication

Generate an API key in the Traversal web app under **[Settings > API keys](https://app.traversal.com/settings/api-keys)**. The key is shown once — copy it immediately.

Pass it in the `Authorization` header:

```
Authorization: Bearer trv_ak_...
```

## Setup

The config is the same across clients — an endpoint URL and an `Authorization` header. Find your client below.

<AccordionGroup>
  <Accordion title="Claude Desktop">
    Open **Settings > Developer > Edit Config** and add:

    ```json theme={null}
    {
      "mcpServers": {
        "Traversal": {
          "type": "http",
          "url": "https://api.prod.traversal.com/mcp/",
          "headers": {
            "Authorization": "Bearer YOUR_API_KEY"
          }
        }
      }
    }
    ```

    Restart Claude Desktop after saving.
  </Accordion>

  <Accordion title="Claude Code">
    ```bash theme={null}
    claude mcp add traversal \
      --transport http \
      --header "Authorization: Bearer YOUR_API_KEY" \
      -- https://api.prod.traversal.com/mcp/
    ```
  </Accordion>

  <Accordion title="Cursor">
    Add to `.cursor/mcp.json` in your project root or global settings:

    ```json theme={null}
    {
      "mcpServers": {
        "Traversal": {
          "url": "https://api.prod.traversal.com/mcp/",
          "headers": {
            "Authorization": "Bearer YOUR_API_KEY"
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="OpenCode">
    Add to your `opencode.json` config:

    ```json theme={null}
    {
      "$schema": "https://opencode.ai/config.json",
      "mcp": {
        "traversal": {
          "type": "remote",
          "url": "https://api.prod.traversal.com/mcp/",
          "oauth": false,
          "headers": {
            "Authorization": "Bearer {env:TRAVERSAL_API_KEY}"
          }
        }
      }
    }
    ```

    Set the `TRAVERSAL_API_KEY` environment variable with your API key before launching OpenCode.
  </Accordion>

  <Accordion title="Other clients">
    Any client supporting the **streamable-http** transport can connect (ChatGPT, Windsurf, VS Code, etc.). Configure it with the endpoint URL and an `Authorization: Bearer` header containing your API key.
  </Accordion>
</AccordionGroup>

## Available tools

| Tool                  | Description                                                                       |
| --------------------- | --------------------------------------------------------------------------------- |
| `investigate`         | Run a first-pass investigation (typically 30s–2min).                              |
| `follow_up`           | Continue an investigation — drill into findings or check additional data sources. |
| `get_investigation`   | Get the status and report for an investigation, with a link to the web app.       |
| `list_investigations` | List recent investigations for your organization.                                 |
| `product_feedback`    | Send feedback about the MCP experience.                                           |

<Tip>
  A single `investigate` call is a fast first pass. Follow up at least once to drill into findings and verify hypotheses.
</Tip>

## FAQ

<AccordionGroup>
  <Accordion title="Authentication failed (401)">
    Verify your API key is correct and hasn't been revoked. If you recently regenerated it, update your client configuration.
  </Accordion>

  <Accordion title="Investigation is slow or times out">
    Broad investigations can take up to 2 minutes. Try a surgical investigation first and use `follow_up` to expand scope.
  </Accordion>

  <Accordion title="Viewing results in the web app">
    Call `get_investigation` — the response includes a `ui_url` link to the full investigation in the Traversal web app.
  </Accordion>
</AccordionGroup>
