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

# MCP Server

> Connect LLM clients and AI agents to HasData via the Model Context Protocol.

The **HasData MCP Server** exposes HasData's scraping and search capabilities to any client that speaks the [Model Context Protocol](https://modelcontextprotocol.io). Point your MCP-enabled client (Claude Desktop, Cursor, Windsurf, custom agents, etc.) at the HasData endpoint and your model can scrape web pages, run Google searches, and pull structured data without writing API integration code.

## Endpoint

```
https://mcp.hasdata.com/api/mcp
```

The server uses the streamable HTTP transport.

## Authentication

All requests must include your HasData API key in the `x-api-key` header. You can find your key in the [HasData dashboard](https://app.hasdata.com).

```
x-api-key: <your-api-key>
```

Requests without a valid key are rejected with `401 Unauthorized`.

## Client Configuration

### Claude Desktop / Claude Code

Add the server to your MCP config (`claude_desktop_config.json` for Claude Desktop, or use `claude mcp add` for Claude Code):

```json theme={null}
{
  "mcpServers": {
    "hasdata": {
      "type": "http",
      "url": "https://mcp.hasdata.com/api/mcp",
      "headers": {
        "x-api-key": "<your-api-key>"
      }
    }
  }
}
```

### Cursor

In `~/.cursor/mcp.json` (or the project-level `.cursor/mcp.json`):

```json theme={null}
{
  "mcpServers": {
    "hasdata": {
      "url": "https://mcp.hasdata.com/api/mcp",
      "headers": {
        "x-api-key": "<your-api-key>"
      }
    }
  }
}
```

### Other Clients

Any MCP client that supports the streamable HTTP transport with custom headers will work. Configure it with:

* **URL:** `https://mcp.hasdata.com/api/mcp`
* **Transport:** HTTP (streamable)
* **Header:** `x-api-key: <your-api-key>`

## Billing

Each tool call consumes HasData credits the same way a direct API request would. See [Credits and Concurrency](/credits-and-concurrency) for details.
