Display Ad Server
Serve ads in standard fixed-size ad units
Native Ad Server
Serve native ads on your web page or app
VAST Video Ad Server
Serve MP4 video ads as pre/mid/post-rolls
CTV Video Ad Server
Monetize your CTV channel
White Label Ad Server
Build your own ad server in hours
User Guide
Learn how to use the platform
API Quickstart
Test the API in just minutes
Full API Docs
Automate your complete ad operations
MCP Server
Connect AI Agents to Your Ad Server
Migration Assistance
Need help switching to AdGlare?
Enterprise-grade Infrastructure
Engineered for speed, built for trust
Realtime Reporting
Never miss an imporant KPI
Management APIs
Automate your complete ad ops workflow
Feature Overview
See if we're a fit in minutes
Talk to Sales
Reach out to get started
Talk to Support
Get help with your ad server
Security / Compliance
GDPR / CCPA, cookie laws, ISO 27001
Terms of Service
AdGlare's terms and privacy policy
IAB TCF Policy
AdGlare is a registered IAB vendor
Network Status
Keep track of network uptime
AI Automation

Connect AI Agents to Your Ad Server

Use the AdGlare Model Context Protocol (MCP) server to connect compatible AI assistants and agents to selected AdGlare tools.

Ask questions in natural language and let your AI client call supported AdGlare functions as part of your workflow. Supports Claude Code, Claude Desktop, Cursor, GitHub Copilot, Gemini, and ChatGPT.

AdGlare Ad Server MCP

MCP provides a standardized way for AI applications to discover tools and invoke them. If you have an AdGlare account, we'll automatically create your personal MCP server. It acts as the connection between the AI client and the AdGlare operations made available to your account.

What is the AdGlare MCP server?

The Model Context Protocol is an open standard that lets AI applications connect to external tools and data. The AdGlare MCP server exposes your ad server as a set of tools an AI agent can discover and call. For example, you can ask:

It works with any MCP-compatible client, so you do not need a custom integration for each AI system.

Quick start

  1. Get your API key. Log in to AdGlare and open your account Settings to find your API key.
  2. Find your MCP URL. Every customer has a dedicated endpoint:
    https://{your_name}.mcp.adglare.app/mcp
    Replace {your_name} with your AdGlare account name.
  3. Add the server to your AI agent using one of the examples below, with your key sent as a Bearer token.
  4. Ask a question, for instance “List my active campaigns.”

Authentication with API keys

Every request must include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Requests without a valid key receive an HTTP 401 response. Never paste your key into a chat message or commit it to a code repository.

Available tools

AI agents discover these tools automatically when they connect.

ToolWhat it doesParameters
list_campaignsLists ad campaigns, optionally filtered by status.status (optional)
get_campaign_statsReturns impressions, clicks and CTR for a campaign over a date range.campaign_id, from, to (dates as YYYY-MM-DD)

Set up the MCP server in your AI agent

Replace {your_name} and YOUR_API_KEY in each example. Client configuration formats change over time, so check your client’s own MCP documentation if something differs.

Claude Code

claude mcp add --transport http adglare https://{your_name}.mcp.adglare.app/mcp \
  --header 'Authorization: Bearer YOUR_API_KEY'

Claude Desktop

Add this to claude_desktop_config.json. It uses the mcp-remote bridge, which requires Node.js.

{
  'mcpServers': {
    'adglare': {
      'command': 'npx',
      'args': ['-y', 'mcp-remote', 'https://{your_name}.mcp.adglare.app/mcp',
               '--header', 'Authorization:'],
      'env': { 'ADGLARE_AUTH': 'Bearer YOUR_API_KEY' }
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project, or the global Cursor config.

{
  'mcpServers': {
    'adglare': {
      'url': 'https://{your_name}.mcp.adglare.app/mcp',
      'headers': { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
  }
}

VS Code (GitHub Copilot)

Add to .vscode/mcp.json. VS Code asks for the key once and keeps it out of the file.

{
  'servers': {
    'adglare': {
      'type': 'http',
      'url': 'https://{your_name}.mcp.adglare.app/mcp',
      'headers': { 'Authorization': 'Bearer ${input:adglare-key}' }
    }
  },
  'inputs': [
    { 'type': 'promptString', 'id': 'adglare-key', 'description': 'AdGlare API key', 'password': true }
  ]
}

Gemini CLI

Add to ~/.gemini/settings.json.

{
  'mcpServers': {
    'adglare': {
      'httpUrl': 'https://{your_name}.mcp.adglare.app/mcp',
      'headers': { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
  }
}

OpenAI API (Responses API)

from openai import OpenAI

client = OpenAI()
response = client.responses.create(
    model='YOUR_MODEL',
    tools=[{
        'type': 'mcp',
        'server_label': 'adglare',
        'server_url': 'https://{your_name}.mcp.adglare.app/mcp',
        'headers': {'Authorization': 'Bearer YOUR_API_KEY'},
        'require_approval': 'always',
    }],
    input='Which AdGlare campaigns are active?',
)
print(response.output_text)

Test your connection

This request should return the list of tools above:

curl -s https://{your_name}.mcp.adglare.app/mcp \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{'jsonrpc':'2.0','id':1,'method':'tools/list'}'
ProblemLikely cause
HTTP 401Missing or incorrect API key, or the header is not formatted as Bearer YOUR_API_KEY.
HTTP 404 or cannot connectWrong account name in the URL, or the path /mcp is missing.
No tools appearRestart your AI client after editing its configuration, and confirm it supports remote HTTP MCP servers.

Security and best practices

See also the AdGlare security and privacy pages.

Frequently Asked Questions

expand_more

What is the AdGlare MCP server?

It is a Model Context Protocol (MCP) server that lets AI agents and assistants securely read data from your AdGlare ad server, such as campaigns and performance statistics, using natural language.

expand_more

What can I do with AdGlare MCP?

Available actions depend on the tools exposed by your AdGlare MCP endpoint. The initial example supports retrieving statistics for a campaign over a date range. Additional tools may be exposed as they become available. Your AI client can only perform operations that the server makes available and authorizes.

expand_more

How do I authenticate with the AdGlare MCP server?

Use an API key. Find it in the settings of your AdGlare account and send it as a Bearer token in the Authorization header of every request.

expand_more

What is my AdGlare MCP server URL?

Each customer has a dedicated URL in the format https://{your_name}.mcp.adglare.app/mcp, where {your_name} is your AdGlare account name.

expand_more

Does AdGlare MCP work with ChatGPT, Claude, Cursor, or Visual Studio Code?

Any AI system that understands MCP, including Claude Code, Claude Desktop, Cursor, VS Code, Gemini CLI, OpenAI ChatGPT, etc.

expand_more

Is my ad data safe when I use an AI agent?

The agent can only access what your API key allows. Keep the key secret, revoke it in your settings at any time, and remember that data returned by tools is processed by the AI provider you choose.

expand_more

Can I use a local AI model with AdGlare MCP?

Yes. Any local setup with an MCP-capable client, for example a model running in Ollama, can connect to the same URL with the same API key.

expand_more

Is the AdGlare MCP server the same as the AdGlare REST API?

No. The AdGlare REST API provides direct HTTP endpoints. MCP is a standardized interface that lets compatible AI clients discover and call selected tools. MCP complements the API; it does not replace it.

expand_more

Can an AI agent change or delete my AdGlare campaigns?

An AI client can only request operations exposed by the MCP server and permitted by its API Key. Set the MCP server to 'read-only' mode on page Settings => MCP Server to prevent your AI agent from modifying your data.