Week over week
Compare this week's traffic with last week's for every site.
One table across properties.
Short answer: connect your GA4 property to LopeBase with a Google sign-in, run npx lopebase login to sign this computer in, then run gemini mcp add lopebase npx -y lopebase mcp in your project folder. Start gemini, type /mcp to see LopeBase connected, and ask about your traffic. No Google Cloud project, no API key, and no token in settings.json.
Read only. Works on macOS, Linux, and Windows.
Six steps, about five minutes. Step 2 is the same for every app; the rest is specific to Gemini CLI.
Skip this if gemini --version already prints a version. Gemini CLI needs Node 20 or later (node -v to check). Install it with npm, or with Homebrew on macOS and Linux:
$ npm install -g @google/gemini-cli
$ brew install gemini-cli
Run gemini once and finish its own sign-in before you go on.
Start free and add your site. Open Connections, choose Google Analytics, and press Connect with Google. Pick the Google account that can see the GA4 property, allow the one read-only permission Google asks for, then pick the property and press Use this property. There is no Google Cloud project, enabled API, or credentials file. The full walkthrough is in Connect Google.
$ npx lopebase login
It opens LopeBase in your browser and shows a short code. Check that the code matches the one in your terminal and press Connect. The sign-in is saved in ~/.config/lopebase/auth.json, readable only by you, and lasts 30 days. You can revoke it any time under Settings, Agent access.
From your project folder, add LopeBase as an MCP server:
$ gemini mcp add lopebase npx -y lopebase mcp
This writes the server to .gemini/settings.json in the current folder, Gemini CLI's default project scope. To have LopeBase in every folder instead, add --scope user and it goes in ~/.gemini/settings.json:
$ gemini mcp add --scope user lopebase npx -y lopebase mcp
Either way the entry looks like this, and you can paste it under mcpServers by hand if you prefer. It holds no token: npx lopebase mcp reads the sign-in from step 3 each time it starts.
{
"mcpServers": {
"lopebase": {
"command": "npx",
"args": ["-y", "lopebase", "mcp"]
}
}
}
Run gemini in the same folder and type /mcp. LopeBase should be listed as connected, with its tools under it (get_digest, read_source, and the rest). From your shell, gemini mcp list shows the same status. If Gemini CLI asks whether to trust the folder, trust it: in an untrusted folder it does not connect MCP servers.
Paste a prompt that needs your GA4 numbers. Gemini CLI asks before it runs a tool; allow it.
Use LopeBase to compare this week's traffic with last week's for each of my sites.
Shortcut: npx lopebase on its own runs steps 3 and 4 for you, then starts Gemini CLI with a prompt to finish setting up the project. The same npx -y lopebase mcp command works in Claude, Codex, and Cursor.
The messages you are most likely to see, and what to do about each.
gemini mcp add in your home folder, which has no project settings. Change to your project folder, or add --scope user./permissions in Gemini CLI to change it. Then run npx -y lopebase mcp in a terminal yourself to see its error, or start gemini --debug for more detail.npx lopebase login, then restart Gemini CLI.npx lopebase login again; nothing in settings.json needs to change.gemini mcp remove lopebase and add it again.npx directly. Use "command": "cmd" with "args": ["/c", "npx", "-y", "lopebase", "mcp"], which is what npx lopebase registers on Windows.One question, one tool call, and an answer built on your own GA4 numbers.
How did traffic change this week compared with last week, for all my sites?
get_digest
| property | this week | last week | change |
|---|---|---|---|
| acme.com | 18,420 | 16,990 | +8% |
| acme.shop | 6,210 | 7,480 | −17% |
| acme.dev | 3,105 | 3,020 | +3% |
Two sites are steady or up. acme.shop fell 17%. Want me to read its traffic sources and see which channel dropped?
No project, no enabled APIs, no credentials file. Connect with Google in LopeBase covers it.
Compare all your GA4 properties in one answer, with the digest or per property.
Type /mcp in Gemini CLI to see LopeBase and its tools listed.
Quick checks that fit in a terminal between other work.
Compare this week's traffic with last week's for every site.
One table across properties.
acme.shop traffic fell. Which channel lost the most visitors?
Narrow a drop to its source.
What were the ten most viewed pages in the last 7 days?
A quick look before you write or ship.
List the goal events and how many people triggered each in the last 7 days.
Make sure tracking still works after a deploy.
Seven datasets per GA4 property. Breakdowns cover the last 28 days and the trend up to 90. Pass any event as a goal to count conversions.
More on each dataset: Google Analytics MCP. Connecting in the console: the GA4 connector. Running several sites: Google Analytics for multiple websites. The same setup in other assistants: ChatGPT, Claude, Codex, and Cursor.
LopeBase is not the only route. Here is how it compares with the usual one.
| Topic | Google's Analytics MCP server | LopeBase |
|---|---|---|
| Setup | Python and pipx, a Google Cloud project, two Analytics APIs, local credentials, and an entry in settings.json. | npx lopebase and Connect with Google. |
| Credentials | A credentials path and project ID in your settings. | Kept by LopeBase, encrypted. |
| Flexibility | Any GA4 report you describe, including custom dimensions. | Seven shaped datasets, with goals built in. |
| Other data | GA4 only. | Search Console, Bing, PostHog, Stripe, and uptime too. |
| Best when | You already work in Google Cloud and need custom reports. | You want GA4 in Gemini CLI in a few minutes. |
Looking at Google's own Google Analytics MCP server? See how it compares with LopeBase. New to all of this? Ask AI about your website traffic covers the basics.
Google's server is described from its own README, checked October 2026. It is labeled experimental there, and its README covers Gemini CLI setup.
Something else? Contact us.
Connect your GA4 property to LopeBase with Connect with Google, run npx lopebase login to sign this computer in, then run gemini mcp add lopebase npx -y lopebase mcp in your project folder. Start gemini and type /mcp to check that LopeBase is connected.
Project settings are in .gemini/settings.json inside the project folder, and user settings are in ~/.gemini/settings.json in your home folder. gemini mcp add writes to the project file unless you add --scope user.
No. LopeBase connects to GA4 with a Google sign-in and read-only access. You do not enable the Analytics APIs, create a service account, or download a credentials file.
No. You pick the property when you connect with Google, and Gemini CLI asks by name.
Only in the folder where you ran gemini mcp add, unless you added it with --scope user. The folder also has to be trusted, since Gemini CLI does not connect MCP servers in an untrusted folder.
30 days. When it runs out, Gemini CLI's tool calls return a message asking you to run npx lopebase login again. You can revoke it sooner under Settings, Agent access.
Yes. They are separate MCP servers with different names in settings.json. Use Google's for custom reports and LopeBase for the everyday questions and your other sources.
This page is about Gemini CLI. LopeBase works in any client that can add a remote MCP server with sign in.
No. It gets counts and rates, never a visitor, an IP address, or a user ID.
Free for one property. No card. Agent access is on every plan.