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

# Connect your client

> Configure Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, or a custom agent runtime to use the Titan MCP server.

The Titan MCP server is a hosted remote server using **Streamable HTTP**. Any client that supports remote MCP servers can connect—there is nothing to install.

| Setting       | Value                                     |
| ------------- | ----------------------------------------- |
| **Endpoint**  | `https://mcp.webscraping.titannet.io/mcp` |
| **Transport** | Streamable HTTP                           |
| **Auth**      | `Authorization: Bearer titan_sk_...`      |
| **Protocol**  | JSON-RPC 2.0                              |

<Warning>
  API keys must be sent in the `Authorization` header. The server rejects keys passed as query parameters, so never put a key in a URL where it could land in logs or browser history.
</Warning>

You need a key with `mcp:*` scopes before connecting. See [Authentication and scopes](/docs/mcp/authentication-and-scopes).

## Claude Code

```bash theme={null}
claude mcp add --transport http titan https://mcp.webscraping.titannet.io/mcp \
  --header "Authorization: Bearer $TITAN_API_KEY"
```

Verify with `claude mcp list`. Add `--scope user` to make the server available across all your projects instead of just the current one.

## Claude Desktop

Open **Settings → Connectors → Add custom connector**, then enter the endpoint URL and your `Authorization` header. Restart Claude Desktop and the Titan tools appear in the tool picker.

## Cursor

Add to `~/.cursor/mcp.json` for all projects, or `.cursor/mcp.json` inside a project:

```json theme={null}
{
  "mcpServers": {
    "titan": {
      "url": "https://mcp.webscraping.titannet.io/mcp",
      "headers": {
        "Authorization": "Bearer titan_sk_..."
      }
    }
  }
}
```

Reload Cursor, then confirm the server shows as connected under **Settings → MCP**.

## VS Code

Add to `.vscode/mcp.json` in your workspace. Using an input keeps the key out of the committed file:

```json theme={null}
{
  "inputs": [
    {
      "id": "titan-key",
      "type": "promptString",
      "description": "Titan API key",
      "password": true
    }
  ],
  "servers": {
    "titan": {
      "type": "http",
      "url": "https://mcp.webscraping.titannet.io/mcp",
      "headers": {
        "Authorization": "Bearer ${input:titan-key}"
      }
    }
  }
}
```

VS Code prompts for the key on first use and stores it securely.

## Windsurf

Add to `~/.codeium/windsurf/mcp_config.json`:

```json theme={null}
{
  "mcpServers": {
    "titan": {
      "serverUrl": "https://mcp.webscraping.titannet.io/mcp",
      "headers": {
        "Authorization": "Bearer titan_sk_..."
      }
    }
  }
}
```

Reload the MCP servers from the Windsurf Cascade panel.

## Any other MCP client

Supply the endpoint, the transport type, and the auth header in whatever shape your client expects. Most use one of two conventions:

<CodeGroup>
  ```json mcpServers convention theme={null}
  {
    "mcpServers": {
      "titan": {
        "url": "https://mcp.webscraping.titannet.io/mcp",
        "headers": { "Authorization": "Bearer titan_sk_..." }
      }
    }
  }
  ```

  ```json servers convention theme={null}
  {
    "servers": {
      "titan": {
        "type": "http",
        "url": "https://mcp.webscraping.titannet.io/mcp",
        "headers": { "Authorization": "Bearer titan_sk_..." }
      }
    }
  }
  ```
</CodeGroup>

## Custom agent runtimes

If you are building your own agent, use an MCP SDK rather than hand-rolling JSON-RPC:

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
  import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

  const transport = new StreamableHTTPClientTransport(
    new URL("https://mcp.webscraping.titannet.io/mcp"),
    {
      requestInit: {
        headers: { Authorization: `Bearer ${process.env.TITAN_API_KEY}` },
      },
    },
  );

  const client = new Client({ name: "my-agent", version: "1.0.0" });
  await client.connect(transport);

  const { tools } = await client.listTools();
  console.log(tools.map((t) => t.name));
  ```

  ```python Python theme={null}
  import os
  from mcp import ClientSession
  from mcp.client.streamable_http import streamablehttp_client

  url = "https://mcp.webscraping.titannet.io/mcp"
  headers = {"Authorization": f"Bearer {os.environ['TITAN_API_KEY']}"}

  async with streamablehttp_client(url, headers=headers) as (read, write, _):
      async with ClientSession(read, write) as session:
          await session.initialize()
          tools = await session.list_tools()
          print([t.name for t in tools.tools])
  ```
</CodeGroup>

See [Programmatic integration](/docs/mcp/examples/programmatic-integration) for a complete agent loop.

## Verify the connection

Ask your client to list its tools. Six should appear:

```text theme={null}
titan_search
titan_fetch
titan_crawl
titan_list_templates
titan_run_template
titan_get_run
```

To check without a client:

```bash theme={null}
curl -sS -X POST "https://mcp.webscraping.titannet.io/mcp" \
  -H "Authorization: Bearer $TITAN_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

## Troubleshooting

| Symptom                             | Cause and fix                                                                                                   |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `401 missing_authentication`        | No `Authorization` header reached the server. Check your client forwards custom headers.                        |
| `401 invalid_api_key`               | The key is wrong, revoked, or does not start with `titan_sk_`.                                                  |
| `401 query_string_api_key_rejected` | The key was sent as a URL parameter. Move it to the `Authorization` header.                                     |
| `403 insufficient_scopes`           | The key carries no `mcp:*` scope. Create a new key—scopes cannot be widened after creation.                     |
| `forbidden` on one tool only        | The key is missing that tool's specific scope. See [Authentication and scopes](/docs/mcp/authentication-and-scopes). |
| Tools missing after config          | Restart or reload the client. Most clients read MCP config only at startup.                                     |

## Next steps

* [MCP quickstart](/docs/mcp/quickstart) — first tool call end to end
* [Tool reference](/docs/mcp/tools/overview) — parameters and limits
* [Errors and warnings](/docs/mcp/errors-and-warnings) — every error code and whether to retry
