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

# Claude Code

> Add the 2extract MCP server to Claude Code with a single command and provision proxies from your terminal.

Claude Code has first-class support for remote MCP servers, so setup is one command - no config files to edit.

***

## Prerequisites

* Claude Code installed and signed in
* A 2extract API key with the scopes your work needs - see [Quick Start](/ai/mcp-server/quick-start)

***

## Add the server

```bash icon="terminal" theme={null}
claude mcp add --transport http 2extract https://mcp.2extract.com/mcp \
  --header "Authorization: Bearer 2xt_YOUR_API_KEY"
```

That registers the server for your user account, so it is available in every project.

To scope it to one project instead, add `--scope project` - the entry lands in `.mcp.json` in the repository root.

<Warning>
  With `--scope project` the key is written into a file that is usually committed. Either add `.mcp.json` to `.gitignore`, or keep the server at user scope.
</Warning>

***

## Verify

Inside Claude Code, run:

```
/mcp
```

`2extract` should appear as connected. Then ask something read-only:

> What is my 2extract balance?

<Check>
  A number comes back. You are connected, and nothing was created or charged.
</Check>

***

## Managing the server

```bash icon="terminal" theme={null}
# List every configured MCP server
claude mcp list

# Show details for this one
claude mcp get 2extract

# Remove it
claude mcp remove 2extract
```

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="/mcp does not list 2extract">
    Run `claude mcp list` to confirm the entry exists. If it does but is not connecting, the URL is probably missing the `/mcp` path - the endpoint is `https://mcp.2extract.com/mcp`, not the bare host.
  </Accordion>

  <Accordion title="Every tool returns unauthorized">
    The key is missing, mistyped, or expired. Re-add the server with a fresh key:

    ```bash icon="terminal" theme={null}
    claude mcp remove 2extract
    claude mcp add --transport http 2extract https://mcp.2extract.com/mcp \
      --header "Authorization: Bearer 2xt_YOUR_API_KEY"
    ```
  </Accordion>

  <Accordion title="Some tools work, others fail">
    That is a scope problem, not a connection problem. The key is missing the scope that tool needs - most often `proxies:read` on a key that only has `proxies:write`. See [Overview](/ai/mcp-server/overview#scopes-an-agent-needs).
  </Accordion>
</AccordionGroup>

***

## Next steps

<CardGroup cols={2}>
  <Card title="Usage Examples" icon="terminal" href="/ai/mcp-server/usage-examples">
    Full sessions from request to connection string.
  </Card>

  <Card title="Prompts" icon="list-check" href="/ai/mcp-server/prompts">
    Four slash commands that ship with the server.
  </Card>
</CardGroup>
