Google Analytics MCP compared with AgentFirstStack

The Google Analytics MCP server, published by Google, lets an AI agent read reports from GA4 properties you already have. It runs locally and needs a Google Cloud project, two enabled APIs and read-only credentials. AgentFirstStack's MCP lets the agent create the analytics itself: one request for a key, then a site, the snippet, a verify check and the numbers.

Updated

Set it up with one prompt

Paste this into your coding agent. It reads the manual, gets a key, creates the site, installs the snippet and checks its own work.

Paste this into Claude Code, Cursor or Codex

Set up AgentFirstStack analytics for this project. It's free, open-source analytics built for agents, and you can do all of it yourself: there is no signup form, and no email or verification is needed. 1. Read https://agentfirststack.com/llms.txt and https://analytics.agentfirststack.com/llms.txt. 2. If this project's .env already has AGENTFIRSTSTACK_API_KEY, use it. Otherwise get a key with one request: curl -X POST https://agentfirststack.com/v1/signup Save api_key in .env as AGENTFIRSTSTACK_API_KEY, and in the production environment's secrets. 3. Create a site for the production domain, add the tracking snippet to the site's layout, deploy, then run verify until it passes. If the site already has Google Analytics, leave it in place. 4. Create goals for sign-ups and purchases. Send the ones only the server knows about (paid orders) as server events. 5. If you support MCP, add https://agentfirststack.com/mcp with the header "Authorization: Bearer <key>" so you can call the analytics tools directly. 6. Write the site id and the env var that holds the key (never the key itself) in AGENTFIRSTSTACK.md at the repo root. 7. Create a claim link for me with POST https://agentfirststack.com/v1/claim-link, so I can see the numbers in a dashboard. When you're done, tell me what you set up, how you verified it, and give me the claim link.

What the Google Analytics MCP server does

Google publishes it as the Python package analytics-mcp, with the source at googleanalytics/google-analytics-mcp. From Google's setup page:

  • It runs on your machine through pipx or uvx and needs Python 3.10 or later.
  • You enable the Google Analytics Admin API and Data API in a Google Cloud project.
  • It signs in with Application Default Credentials and the analytics.readonly scope, as a user or service account with at least the Viewer role on the property.
  • Its tools list accounts, properties, Google Ads links, annotations and custom dimensions, and run standard, realtime and funnel reports (run_report, run_realtime_report, run_funnel_report).

Google's page says the server can't create, modify or delete your Analytics configuration. So a person creates the account, the property and the web data stream, adds the Google tag (Google's setup steps) and sets up credentials before the agent asks its first question. The Admin API can create properties (properties.create, with the analytics.edit scope), but the MCP server doesn't expose that.

That fits its job: read access to an analytics setup that already exists.

How AgentFirstStack does it

AgentFirstStack is hosted analytics (plus tag management, inboxes and session replay) that an agent sets up from nothing. There's no account to create first. One request returns a key, and the same key works over REST and one MCP server:

curl -s -X POST https://agentfirststack.com/v1/signup
# -> { "api_key": "afs_...", "account_id": "acct_...", "next_steps": [ ... ] }

A=https://analytics.agentfirststack.com
H="Authorization: Bearer $AGENTFIRSTSTACK_API_KEY"
J="content-type: application/json"
curl -s -X POST $A/v1/sites -H "$H" -H "$J" -d '{"domain":"example.com"}'
# -> site.id and the snippet to put in <head>. Deploy, load the site once, then:
curl -s -X POST $A/v1/sites/$SITE/verify -H "$H"
curl -s "$A/v1/sites/$SITE/stats?period=7d&breakdown=channel" -H "$H"

To use it over MCP, add the gateway once:

claude mcp add --transport http afs https://agentfirststack.com/mcp \
  --header "Authorization: Bearer $AGENTFIRSTSTACK_API_KEY"

The same steps are then tools. analytics_create_site returns the snippet and install code for HTML, Next.js, Astro, React and WordPress. analytics_verify_install fetches the page and lists what to fix. analytics_get_stats, analytics_get_breakdown, analytics_get_funnel and analytics_query_sql answer questions. Creating a site for a domain that already has one returns the existing site, so retries are safe. At the end the agent calls afs_create_claim_link, and you sign in with Google to see the dashboard. Every endpoint and tool is in the analytics manual.

Side by side

Google Analytics MCP serverAgentFirstStack
Who creates the property or siteA person, in Google AnalyticsThe agent, with analytics_create_site
Before the first tool callA Google Cloud project, two APIs enabled, credentials, a Viewer roleOne POST /v1/signup
Where it runsOn your machine (Python)Hosted at agentfirststack.com/mcp
AuthGoogle credentials, analytics.readonlyAn API key; OAuth 2.1 for chat apps
WritesNone, per Google's pageSites, goals, funnels, annotations, server events, payments
Install checkThe Realtime report, or run_realtime_reportanalytics_verify_install, with fixes
DataGA4's reports, history and Google Ads linksCookieless counts, channels including AI assistants, UTM tags, goals, funnels, revenue from Stripe or any provider
LicenseApache-2.0 (the MCP server)MIT (the whole service)

What about a Plausible MCP?

Plausible's docs point to an MCP server built by the Sentry team and describe it as community-built, not an official Plausible integration. It connects with a Plausible Stats API key, and its query tools are read-only. Creating sites by API goes through Plausible's Sites API, which Plausible lists as an Enterprise plan feature.

If you already use Plausible, that server is the direct way to let an agent read it. AgentFirstStack covers similar ground (cookieless counting, sources, pages, countries, goals), and the agent can create the site as well.

When to choose which

Use the Google Analytics MCP server if

  • You already run GA4 and want an agent to read its history.
  • Your team reports from GA4, or your Google Ads account is linked to it.
  • Read access is all you need, and a local server with Google credentials is fine.

Use AgentFirstStack if

  • It's a new site or app, and you want the agent to do the whole setup and check it.
  • You want goals, server events and revenue attribution that the agent defines in code.
  • You'd rather not create a Google Cloud project to give an agent access.
  • You also want ad conversion tracking, inboxes or session replay on the same key.

You can run both. The tags service sends conversions to GA4 too (the browser tag plus the Measurement Protocol), so GA4 keeps working while the agent runs the rest. The home page has the full setup prompt for all four services.

FAQ

Is there an official Google Analytics MCP server?

Yes. Google documents analytics-mcp on its developer site and publishes the source in the googleanalytics GitHub organization. It runs locally and reads GA4 data through the Admin and Data APIs.

Can the Google Analytics MCP server create a GA4 property?

No. Google's page says it can't create, modify or delete your Analytics configuration. Create the property and data stream in Google Analytics first, or call the Admin API directly with the analytics.edit scope.

Can AgentFirstStack import my GA4 history?

No. It counts from the moment its snippet is live. If you need the history, keep GA4 running; both scripts can be on the same page.

What does AgentFirstStack cost?

The hosted service is free, with fair-use limits such as 10 analytics sites per account. The code is MIT licensed, so you can also run it yourself on Cloudflare Workers.

Product names belong to their owners. AgentFirstStack isn't affiliated with Google, Plausible or Sentry.