← Blog 6 min read

How to Query Your Web Analytics from an AI Assistant

Your analytics dashboard makes you go and look. Connecting it to an AI assistant flips that β€” you ask a question in plain language, in the tool you already work in, and get the answer. Here's how it works, and how to set it up.

The dashboard makes you do the work

Every analytics tool ships a dashboard, and the dashboard quietly assumes a lot of you. You have to remember it exists. You have to log in. You have to pick the right date range, find the right chart, and do the mental arithmetic to compare this week with last week. None of that is hard β€” but all of it is friction, and friction is why most people check their analytics far less often than they say they will.

The data was never the bottleneck. The trip to the data is.

What changes when analytics talks to your assistant

If you write code or content, you probably already spend part of your day in an AI assistant β€” Claude, Cursor, or something similar. Imagine asking it, in that same window:

"How did traffic do this week compared with last week?"

And getting a real answer, pulled from your actual analytics, with the comparison already done. Then a follow-up β€” "which pages drove the increase?" β€” that just works, because the assistant kept the context.

That is the shift. You stop travelling to the data and start asking for it. The dashboard is still there when you want to look at a chart, but it is no longer the only door.

The mechanism that makes this possible is a small open standard called MCP.

MCP, briefly

The Model Context Protocol (MCP) is an open standard for connecting AI assistants to external tools and data. An MCP server exposes a set of well-described actions β€” called tools β€” and any MCP-compatible assistant can discover and call them. Claude Desktop, Claude Code and Cursor all speak it.

It means a service no longer needs a custom plugin for every AI product. It ships one MCP server, and every MCP client can use it. Logly ships one for analytics.

What you can ask

Once the Logly MCP server is connected, your assistant can answer questions like:

It can also hand you the tracking snippet for a site β€” useful when you are setting Logly up on something new and want the assistant to drop the tag in for you.

Setting it up

Two steps. First, create an API key in Settings β†’ API keys in your Logly dashboard. Second, point your MCP client at the server. It runs through npx, so there is nothing to install or keep updated.

Claude Desktop

Edit claude_desktop_config.json (Settings β†’ Developer β†’ Edit Config):

{
  "mcpServers": {
    "logly": {
      "command": "npx",
      "args": ["-y", "@logly-uk/mcp"],
      "env": { "LOGLY_API_KEY": "logly_your_key_here" }
    }
  }
}

Claude Code

claude mcp add logly -e LOGLY_API_KEY=logly_your_key_here -- npx -y @logly-uk/mcp

Cursor

Add the same block to .cursor/mcp.json. Restart the client, and the analytics tools appear.

How it works under the hood

The server is deliberately thin. It is a small wrapper over Logly's public HTTP API β€” the same API the dashboard itself uses. Each tool maps to one endpoint:

The server runs locally, on your machine. Your API key lives in your own client config and is sent only to Logly's API β€” never to a third party. The assistant calls a tool, the tool calls the API, the JSON comes back, and the model explains it in the context of your question.

The principle: the MCP server adds no new backend and no new data path. It is the public API you could already script against, repackaged so an AI assistant can call it directly. Anything the dashboard shows, you can now simply ask for.

A few workflows it is good for

The weekly review without the dashboard. Monday morning, ask for last week's numbers and the comparison. The assistant reads them back, you spot anything odd, you move on. No tab, no date picker.

Debugging a funnel. A funnel that converts badly is a question, not a chart. Ask which step leaks the most, then ask what the referrers for that step look like. The assistant chains the calls; you stay in the conversation.

The quick incident check. Deployed something risky? Ask how many visitors are active right now and whether pageviews look normal for the hour. Thirty seconds, no context switch.

Onboarding a new site. Ask the assistant to add Logly to a project β€” it can fetch the install snippet for the right site ID and place the tag for you.

Is it safe?

A Logly API key grants access to your own analytics β€” nothing else. The key sits in your local client configuration; it is not uploaded anywhere when you install the server, and it travels only to Logly's API on each call. If a key is ever exposed, you revoke it from the dashboard and it stops working immediately.

There is also less at stake here than with most analytics. Logly is privacy-first by design β€” no cookies, no personal data, no cross-site identifiers. The numbers an assistant reads back are aggregate traffic figures, not profiles of people. Querying them through an AI assistant does not change what is being collected, because the answer is: nothing personal was, to begin with.

Start asking

The dashboard is a fine place to look at a chart. But most analytics questions are not really chart questions β€” they are plain questions that deserve plain answers. Putting your analytics one sentence away, in the assistant you already use, is a small change that quietly makes you check your numbers far more often.

Analytics your AI assistant can read

Logly is privacy-first web analytics β€” under 1 KB, cookie-free, with a real public API and an open-source MCP server. Free up to 10,000 pageviews/month.

See the Logly MCP server β†’