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

# Claude Code

> Configure ScrapeGraph MCP in Claude Code

## Claude Code Setup

Add the server with the Claude Code CLI:

```bash theme={null}
claude mcp add --transport http sgai \
  https://mcp.scrapegraphai.com/mcp
```

The default `local` scope makes the server available in the current project. Add `--scope user` to use it in every project.

## Authenticate

```bash theme={null}
claude mcp login sgai
```

Alternatively, run `/mcp` inside Claude Code, select `sgai`, and choose **Authenticate**. Either way a browser window opens: choose **Continue with Google** and sign in with the Google account associated with your ScrapeGraphAI account.

Once the browser shows **Authentication successful. Connected to sgai.**, return to Claude Code — the tools are ready.

### With an API key instead

```bash theme={null}
claude mcp add --transport http sgai \
  https://mcp.scrapegraphai.com/mcp \
  --header "Authorization: Bearer $SGAI_API_KEY"
```

A request carrying an API key skips the OAuth flow, so there is no `claude mcp login` step.

## Verify

```bash theme={null}
claude mcp get sgai
```

Then ask Claude Code to run the `credits` tool. A balance response confirms that authentication and tool execution both work.

<Tip>
  See the [tool reference](/services/mcp-server/introduction#available-tools) for everything the server exposes.
</Tip>
