# Claude Code

> Add DarkCrawl to Claude Code so it can read .onion pages for you.

Works with Claude Code

**Hosted**

1. [Get a key](https://darkcrawl.dev/docs/build-with-ai/get-a-key/), then set it in your environment as `DARKCRAWL_API_KEY`. Start Claude Code from a terminal where it is set.

2. Add the server to `.mcp.json` in your project, merging it into any `mcpServers` you already have. Claude Code reads the key from `DARKCRAWL_API_KEY`, so the file never holds it.

   ```json
   {
     "mcpServers": {
       "darkcrawl": {
         "type": "http",
         "url": "https://api.darkcrawl.dev/mcp",
         "headers": {
           "Authorization": "Bearer ${DARKCRAWL_API_KEY}"
         }
       }
     }
   }
   ```

3. Check it. Ask Claude Code to list the tools DarkCrawl gives it, or run `/mcp`. You should see the tools on the [MCP page](https://darkcrawl.dev/docs/mcp/).

**On your own server**

1. [Run DarkCrawl](https://darkcrawl.dev/docs/run-it-yourself/) on your own machine. The commands below point at it at `http://127.0.0.1:3002`.

2. Install the `darkcrawl` command with its MCP extra, from the repository root.

   ```bash
   uv tool install --reinstall --python 3.13 '.[mcp]'
   ```

3. Add the server. Run this in a terminal, and put your key in place of `YOUR_API_KEY`.

   ```bash
   claude mcp add --env DARKCRAWL_API_KEY=YOUR_API_KEY --transport stdio darkcrawl -- darkcrawl --url http://127.0.0.1:3002 mcp
   ```

4. Check it. Ask Claude Code to list the tools DarkCrawl gives it. You should see the tools on the [MCP page](https://darkcrawl.dev/docs/mcp/).
