Guide

Google Analytics MCP server

craft mcp · part of the Anacrafter Elite plan · --demo needs no account
What it does

craft mcp serves a Google Analytics 4 property over the Model Context Protocol, so Claude Desktop, Claude Code or any MCP client answers how is the site doing without a human reading a dashboard.

Twelve tools. One command to wire in. Eleven of them only read, and one of them — audit_site — tells the assistant whether the other eleven are worth quoting.

01Wire it up

Claude Desktop is one command. It merges into the config and leaves any other servers alone.

# sign in, pick a property, then install
$ craft login
$ craft use 397412345
$ craft mcp --install

# or try it first — synthetic data, no account
$ craft mcp --install --demo

# and take it back out again
$ craft mcp --uninstall

Restart the client and ask it how the site is doing. For Claude Code the command is claude mcp add anacraft -- craft mcp; any other client takes the same command and argument. Writing a config by hand, use an absolute path — a desktop app is not launched from a shell and does not inherit the PATH where craft works. which craft gives the value to paste.

{
  "mcpServers": {
    "anacraft": {
      "command": "/usr/local/bin/craft",
      "args": ["mcp"]
    }
  }
}

02The twelve tools

ToolAnswers
site_statusHow the site is doing — every headline metric against the period before it, the daily user series, and the milestones the numbers crossed
audit_siteWhether those numbers can be trusted — twelve graded checks on how the property is measuring. What it checks →
live_visitorsWho is on the site right now, by country. Realtime, so it ignores the window
list_pagesMost-visited pages, by views
list_eventsEvents by count, with the per-day total against the previous period
list_referrersThe URLs sending traffic, by sessions
list_traffic_sourcesGA4 source / medium pairs, by sessions
list_countriesTraffic by country
list_propertiesEvery property this account can read, and which is the default
search_pagesPages whose path contains a substring
search_eventsEvents whose name contains a substring
configure_siteThe one write — creates the property and web stream for a domain and returns the tag to paste

Every report tool takes an optional property and falls back to the saved default, so an assistant that knows nothing about your config still gets answers. Each carries its own days default rather than sharing one, because the window a question needs is part of the question: seven days is the right answer to how are we doing and the wrong one to is anything broken, so audit_site advertises twenty-eight.

03What comes back

Labelled JSON, not rendered panels. Every answer carries the property id and the exact window it covers, so an assistant can attribute the numbers it quotes rather than reporting a figure with no period attached to it.

The window is reported as the first and last day the API actually returned, rather than computed locally: last 7 days resolves in the property's reporting time zone, which is not necessarily the machine's. Identical reports are cached for a minute — and say so in the answer, so an assistant watching a number that will not move knows why rather than concluding the site went quiet.

04One writer, and it is obvious which

configure_site takes a domain, creates the Google Analytics property and web stream for it, and hands back the tag with its real measurement id. It is annotated in the schema as the one tool that is not read-only, which is what makes a client show it differently and think before calling it.

Nothing here signs in, writes credentials to disk, or moves your default property. login and use stay human-only commands, and configure_site never changes what the dashboard opens on. If no credentials are stored, the tools say to run craft login rather than opening a browser inside your client's subprocess.

05What it will not do

It serves one property at a time and it serves Google Analytics. There is no Search Console, no Google Ads and no Meta here, so an assistant asked to explain a drop can say which channel carried it and not which campaign paid for it.

And it will not pretend a broken property is a quiet one. That is what audit_site is for: a site with nothing marked as a key event reports zero conversions perfectly truthfully, and saying nothing here is marked as a conversion is a different answer from conversions fell.

06Try it without an account

# synthetic data over the same twelve tools
$ craft mcp --demo

No Google account, no subscription. The wiring can be tested and the answers looked at first.

The live server is part of the Anacrafter Elite ($9.99) plan. Without a login or a subscription it still starts, and its tools say which one is missing — so the client never reports it as disconnected, and the answer arrives where you asked the question.

Building with Lovable? anacraft × Lovable adds GA4 to your app, then reads the numbers back from Claude or any MCP client.

09Questions

What is an MCP server for Google Analytics?

The Model Context Protocol is a standard way for an AI assistant to call tools. An MCP server for Google Analytics exposes the reporting API as tools the assistant can call, so it can read a property's real numbers instead of being pasted a screenshot. craft mcp is one: a single command that speaks the protocol on stdin and stdout, which the client spawns as a child process.

How do I connect Claude to Google Analytics?

Run craft login to sign in with Google, craft use to pick a property, then craft mcp --install to write the server into Claude Desktop's config, and restart it. For Claude Code the command is claude mcp add anacraft -- craft mcp. Any other MCP client takes the same command and argument.

Can the assistant change anything in my Analytics account?

Eleven of the twelve tools only read. The exception is configure_site, which creates a property and web data stream for a domain the account does not measure yet and returns the tag to paste. Nothing signs in, writes credentials to disk, or changes which property the dashboard opens on — login and use stay human-only commands.

Does it work without a Google account?

craft mcp --demo serves synthetic data over the same twelve tools, so the wiring can be tested and the answers looked at before any account is connected. It needs no login and no subscription.

What does the assistant get back?

Labelled JSON carrying the property id and the exact date window the numbers cover, so an assistant can attribute what it quotes rather than reporting a figure with no period attached. Identical reports are cached for a minute, so a chatty agent does not burn the API quota the dashboard needs.