Self-hosting

AI agents reading your analytics: MCP explained

Ownlytics team · · 6 min read

MCP, the Model Context Protocol, is a standard way for an AI agent to call tools in another system. For analytics, it means an assistant such as Claude Code or Cursor can query your traffic and revenue directly, using a read-only key, and answer in plain language instead of you opening a dashboard.

Which post made the most money last month?
ownlytics · get_breakdown
“Setup guide” brought in $245 from 1,800 visitors, about $0.14 per visitor. “Launch recap” had the most traffic but earned $49.
PostVisitorsRevenue
Setup guide1,800$245
Pricing compared640$147
Launch recap3,200$49

Fig.Your AI assistant reading your analytics through MCP, read-only. Sample data, not a real site.

What problem does it solve?

A dashboard answers the questions its designer anticipated. You click, filter and compare, and if the question does not fit a chart, you export and work it out yourself. An agent connected to the same data lets you ask in your own words: "Which post made me the most money this month?" or "What changed compared with last week?"

The agent does not guess from memory. It calls tools, the tools return numbers from your data, and the agent explains them. If the tool results are wrong or empty, the answer will be too, so the quality sits in the tools and the data, not in the chat.

How does it work with Ownlytics?

Every Ownlytics install has a built-in MCP server, which our docs put at https://YOUR-OWNLYTICS-URL/mcp. You create a read-only API key in the dashboard under Settings, then API keys and AI agents. The client connects over Streamable HTTP with an Authorization: Bearer dbk_... header. The server runs inside your install: on your Cloudflare account when self-hosted, or on Supabase with Hosted. Details are in the MCP docs.

The server exposes 14 read-only tools. In short:

Our analytics MCP server page lists them all.

What can the agent see, and what can it not do?

It is useful to be precise here, because "AI with access to my data" worries people for good reasons.

What you still need to think about is the AI client itself. When an assistant reads your numbers, those numbers become part of the conversation with whichever model provider that client uses. Read that client's data policy. Keep the key out of shared repos and screenshots.

A read-only key limits what an agent can do to your data. It does not limit where the answers it reads are sent, which is up to the client you choose.

Example (made-up numbers for illustration)

Here is the shape of an exchange. These numbers are invented.

You: "Which referrer made the most money in the last 30 days?"

Agent: calls a breakdown tool ranked by revenue and replies, for instance: "Referrer A earned $420 from 6 sales on 1,800 visitors. Referrer B earned $310 from 2 sales on 400 visitors. B has the higher revenue per visitor."

The useful part is the last sentence. The tool ranks by visitors or revenue, so revenue per visitor is the agent's own arithmetic from those two columns, which is why you should spot-check it. It still saves several clicks in a chart. Our post on revenue per visitor explains why that metric matters.

Is traffic from ChatGPT turning into sales?
ownlytics · get_breakdown
Yes, a little: ChatGPT sent 1,411 visitors and 4 sales ($196). Perplexity sent fewer visitors but one in 310 bought.
SourceVisitorsRevenue
chatgpt.com1,411$196
perplexity.ai620$98
claude.ai388$49

Fig.AI assistants as their own channel in the source table. Sample data, not a real site.

When MCP is not worth the trouble

It also does not replace thinking. It answers the question you asked, not the one you should have asked.

How do you start?

  1. Open the dashboard and create a read-only key.
  2. Add the server to your client. Claude Code takes one command; the MCP docs have blocks for Cursor, VS Code, Codex and Windsurf.
  3. Ask one narrow question first, such as "list my last five sales and where each buyer came from."
  4. Compare the answer with the dashboard once, so you know how the agent reads your data.

At a glance

ItemDetail
ProtocolMCP over Streamable HTTP
Endpointhttps://YOUR-OWNLYTICS-URL/mcp
AuthRead-only API key, sent as a Bearer header
Tools14, all read-only
ClientsClaude Code, Cursor, Codex, Windsurf, VS Code and others
Customer emailsHidden unless your key includes them
Works onSelf-hosted and Hosted

Want to see what the agent would be reading? Open the live demo.

FAQ

What is MCP in simple terms?

It is a common way for AI assistants to use outside tools. The assistant asks a tool for data, the tool answers, and the assistant explains it to you.

Can an AI agent change my analytics settings?

Not through our MCP server. Its tools are read-only, and the API key is read-only too.

Does the agent see my customers' emails?

Not by default. Names and emails stay hidden unless you create a key that includes them.

Which AI clients work?

Any client that speaks MCP over Streamable HTTP with a header. Our docs list Claude Code, Cursor, Codex, Windsurf and VS Code.

See the live demo · View pricing

Keep reading