Sprites MCP · Google Analytics MCP server · Codex

Google Analytics MCP for Codex: setup in two minutes

Add https://mcp.sprites.ai/mcp as a custom MCP connector in Codex, sign in to Sprites, and Codex can read your Google Analytics 4 account and propose changes to it. Setup takes about two minutes and needs no API key. Every write comes back as an approval before it touches the account.

MCP server URLhttps://mcp.sprites.ai/mcp

5 steps · about 2 minutes

CodexSprites connected

What happened to conversions last week?

Spritesanalyzerunning
SpritesGA4Needs your approval
  • Organic search412 → 402 convFlat−2%
  • Paid search308 → 141 convCause−54%
  • Direct96 → 101 convFlat+5%
Paid search accounts for 94% of the dropDig in

Add Sprites to Codex

Available on Anywhere Codex CLI runs — a ChatGPT plan that includes Codex, or an API key. You need a Sprites account with Google Analytics 4 already connected — the connector acts on that connection, so Codex never handles a GA4 credential.

  1. Add the server

    One command writes the entry into ~/.codex/config.toml for you.

    Terminal
    codex mcp add sprites --url https://mcp.sprites.ai/mcp
  2. Or write the config by hand

    The same entry in ~/.codex/config.toml, or in .codex/config.toml inside a trusted project when you want the connector scoped to one repo.

    ~/.codex/config.toml
    [mcp_servers.sprites]
    url = "https://mcp.sprites.ai/mcp"
    auth = "oauth"
  3. Sign in

    Codex opens a browser for the Sprites consent screen and stores the token locally. Sprites supports dynamic client registration and client ID metadata documents, so there is nothing to pre-register.

    Terminal
    codex mcp login sprites
  4. Approve changes by name

    Codex renders results as text, so a pending change comes back written out rather than as a card you can click. Nothing is applied until you approve it, and the approval waits for you in Sprites — open it there and the same run continues.

    Pending change
    ChangeDaily budget $40 → $65Gategate_7f2c…

Run the first prompt

Ask Codex this. It routes to a Sprites door, which reads your Google Analytics 4 account and answers — no account to name, no confirmation to give first.

  • With Sprites, what happened to conversions last week and which channel caused it?
  • Ask Sprites for our top 10 landing pages by conversion rate this month.
  • Use Sprites to compare organic and paid revenue quarter over quarter in GA4.
  • Have Sprites break down ecommerce revenue by product for the last 30 days.
  • With Sprites, set up a Monday brief on traffic, conversions and the biggest change.

Run `codex mcp list` and confirm sprites shows as connected.

What Codex can do with Google Analytics 4

The same doors, whichever client you are in. Marketing work that belongs in a commit: Codex can read the landing page it is about to ship and brief Sprites on the campaign pointing at it, in one session.

Ask in English, get the report run

No explorations, no dimension picker. The question becomes a GA4 query and the answer comes back with the numbers attached.

Channel attribution that names a cause

The channel that accounts for the change, with its share of it stated, not a chart of everything that moved.

Item-scoped ecommerce

Revenue and units per product, not just per session — the breakdown GA4 buries.

Landing pages that earn and landing pages that leak

Entry page performance against conversions, ranked, with the drop-off stated.

Join it to the ad accounts

Because the same connector reads Google Ads and Meta, a GA4 answer can be checked against what the platforms claim.

A standing weekly read

A scheduled brief that runs against GA4 and messages you only when a number breaks trend.

How approvals work here

Codex renders tool results as text, so a GA4 change comes back written out rather than as a card. The approval waits for you in Sprites — open it there and the same run continues. Nothing is applied until you approve it.

What it reads

  • Sessions, users, engagement and conversions by any GA4 dimension
  • Channel, source, medium and campaign attribution
  • Landing pages, events and funnels
  • Item-scoped ecommerce: revenue and units per product

What it can change

  • Nothing. GA4 is read-only through this connector by design
  • Changes it recommends land on the ad or SEO channel they belong to, each with its own approval

When it does not work in Codex

Three things go wrong in this client specifically, and each has a one-line fix.

Codex says the tool is not found.

The config was edited while a session was open. Restart Codex — it reads config.toml at startup.

Login loops without ever completing.

The OAuth callback defaults to http://127.0.0.1/callback. If something else on the machine holds that port, set mcp_oauth_callback_url in config.toml and log in again.

Codex says a change was applied and nothing happened in the account.

It was proposed, not applied — that is the design. The approval is waiting in Sprites; open it there and the run continues from where it stopped.

Google Analytics 4 and Codex: questions

Which URL do I paste into Codex?

https://mcp.sprites.ai/mcp. There is one endpoint and every client uses it — every OAuth grant is bound to exactly that address, so a variant of it will not be honoured.

Can Codex change my Google Analytics 4 account without asking?

Codex renders tool results as text, so a GA4 change comes back written out rather than as a card. The approval waits for you in Sprites — open it there and the same run continues. Nothing is applied until you approve it.

Do I need a Google Analytics 4 API key or developer token?

No. Google Analytics 4 is connected once inside Sprites through Google Analytics 4, and the connector acts on that connection. Codex never sees a credential for it.

Why Codex for Google Analytics 4 specifically?

Marketing work that belongs in a commit: Codex can read the landing page it is about to ship and brief Sprites on the campaign pointing at it, in one session.

Can it change anything in GA4?

No. GA4 is read-only through this connector on purpose. If the answer implies a change, it is proposed on the channel that owns it — an ad account, a page — with its own approval.

Do I need to know GA4 dimensions and metrics?

No. You ask the question; Sprites picks the dimensions, runs the report and states what it queried so you can check the working.

Keep going

The same Codex connector reaches every other channel — nothing else to add.

All GA4 guides

Google Analytics 4, from Codex

Paste one URL, sign in once, and the next GA4 question you ask Codex gets answered from the live account.