Skip to main content

MCP/API

MCP/API is the single programming interface to Qubix. External clients — an AI assistant, a BI script, an automation tool — connect to one endpoint over MCP (Model Context Protocol) and call the methods listed on this page. Every call runs strictly within your permissions: an administrator reaches the whole account, a buyer only their team's data.

There is no separate REST API to learn: the methods you see here are exactly what the endpoint serves, so the catalog can never drift from the real interface.

The same methods power the built-in assistant

These methods are not only for external clients. The built-in Qubix AI assistant — the panel available on every screen of the admin panel, with no setup — calls the very same catalog. So whether you ask the built-in assistant or connect your own AI agent over MCP, both read your data and take actions through the same methods, always within your permissions.

Where to find it

In the admin panel, open the account menu (top-right, next to your name) and choose MCP/API.

The endpoint

Everything goes to one address:

POST https://<your-domain>/api/mcp

The transport is Streamable HTTP (JSON-RPC 2.0) — a single endpoint that ready MCP clients speak natively, and that you can also call directly from any language (see Code examples below).

Your API token

Programmatic access uses a personal token (PAT) — created and managed right on this page, in the API Token block.

  1. Press Generate API token (or Regenerate if you already have one).
  2. Copy the token immediately — it is shown only once.

The token looks like qbx_…. Qubix stores only its hash and can never show it again.

  • One token per user. It inherits your role and permissions, so over the API you see exactly the same data and actions as in the interface.
  • Regenerate issues a new token and the old one stops working immediately.
  • Revoke deletes the token and cuts off all access that used it.
Treat the token like a password

A personal token is equivalent to signing in as you. Do not publish it or share it. If it leaks, press Regenerate here — the old token dies at once.

Connect a client

Most MCP clients take a small config: the endpoint plus the Authorization header. While the token is shown right after generation, this page already fills the real value into the example below — copy it as is.

JSON
{
"mcpServers": {
"qubix": {
"url": "https://<your-domain>/api/mcp",
"headers": { "Authorization": "Bearer qbx_YOUR_TOKEN" }
}
}
}

For step-by-step setup of a specific assistant (Claude Code, Claude Desktop, Cursor), see Connecting an external AI.

Code examples

To call the endpoint from your own code, send a JSON-RPC request with the auth and Streamable-HTTP headers. The page offers ready snippets for cURL, JavaScript and Python — switch the tab and copy. For example, listing the available methods:

Bash
curl -X POST 'https://<your-domain>/api/mcp' \
-H 'Authorization: Bearer qbx_YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Python
import requests

res = requests.post(
"https://<your-domain>/api/mcp",
headers={
"Authorization": "Bearer qbx_YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json, text/event-stream",
},
json={"jsonrpc": "2.0", "id": 1, "method": "tools/list"},
)
print(res.text)
For custom integrations

These raw calls illustrate the protocol from any language. Ready clients (Claude, Cursor) do not need them — they use the config above.

What the API exposes

The page lists the full method catalog — about a hundred methods today — and each one is tagged read or write. They cover, within your permissions:

  • Analytics — the dashboard, geo, offers, networks, traffic sources, the Facebook screens and the visitor funnel, plus a drill-down for a single ad, campaign, offer, creative, PWA, geo or traffic source.
  • Creatives — semantic search and the top-performing creative themes.
  • Britva — view automation rules, paused ads and firing history; create, edit and release rules.
  • Actions — pause and resume ads and campaigns; manage offers, networks, traffic sources, tracker campaigns, pixels, websites, domains, PWAs and push campaigns.
  • Free-form queries — a read-only query method for questions the ready-made methods do not cover.

Each method shows its parameters and whether it changes data. Use the search box to find one by name or description.

Write methods are real

Pausing an ad, deleting a rule or an offer through the API changes your live campaigns. In chat clients such actions run only after your confirmation — review what is proposed before approving.

What's next