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

# MCP server

> Let your AI agents interact directly with your adnetwork data.

The Adgreg MCP server exposes your adnetwork data to any MCP-compatible AI agent. Your agent can query your configured websites and spot groups, pull live statistics, and compare performance across adnetworks — all through natural conversation.

The server is hosted at `mcp.adgreg.com`. There is nothing to install or run locally.

Here are a few things you can ask once connected:

* "Show me revenue from ExoClick this week, broken down by spot type."
* "Which of my sites had the most clicks yesterday across all adnetworks?"
* "List all video ad spots configured on site #42."
* "Compare impressions between TrafficStars and Clickadilla for the last 30 days."
* "What's the total revenue for popunder zones on website 7 this month?"
* "Break down daily clicks for ExoClick and TwinRed on website 3 over the past two weeks."

## Prerequisites

* Adgreg account with at least one adnetwork connected
* [Adgreg API key](https://adgreg.com/dashboard/api)

## Connecting your AI tool

<Tabs>
  <Tab title="Claude Code">
    Run the following command to register the server:

    ```bash theme={null}
    claude mcp add adgreg https://mcp.adgreg.com \
      --header "X-API-Key: your-api-key"
    ```

    Replace `your-api-key` with your key from [adgreg.com/dashboard/api](https://adgreg.com/dashboard/api).
  </Tab>

  <Tab title="VS Code">
    Create `.vscode/mcp.json` in your project root:

    ```json .vscode/mcp.json theme={null}
    {
      "servers": {
        "adgreg": {
          "type": "sse",
          "url": "https://mcp.adgreg.com",
          "headers": {
            "X-API-Key": "your-api-key"
          }
        }
      }
    }
    ```

    Replace `your-api-key` with your key from [adgreg.com/dashboard/api](https://adgreg.com/dashboard/api).

    VS Code with GitHub Copilot picks up MCP servers defined in `.vscode/mcp.json` automatically.
  </Tab>
</Tabs>

## Authentication

Your Adgreg API key is passed as the `X-API-Key` header from your MCP client to the server on every request. The server forwards it to the Adgreg API automatically — you never need to include it in your prompts.

<Warning>
  Never share your API key in prompts or commit it to version control. Pass it only through your MCP client's header configuration.
</Warning>

See [Available tools](/mcp-tools) for a full list of what the MCP server can do.
