How the connection works
AI assistants reach outside data through MCP, the Model Context Protocol. An MCP server offers a small set of tools, and the assistant calls them when your question needs them. ChatGPT, Claude, Codex, Cursor and VS Code all support remote MCP servers.
QuerySail runs a hosted Google Analytics 4 MCP server. You approve read-only Analytics access on Google's consent screen once, add one URL to your AI app and sign in. There is no Google Cloud project, service account or API key, and nothing to install.
What you can ask
Ask in plain language. Your assistant picks the tool, dates, dimensions, metrics and filters, and the answer states the date range, time zone and filters it used.
| Question | Tool | What comes back |
|---|---|---|
| Which Google Analytics properties can you access? | list_properties | Each GA4 property's ID, such as properties/123456789, its display name and its Analytics account. |
| How many users and sessions did the site have in the last 28 days? | run_report | Active users, sessions and views for the 28 days ending yesterday, in the property's time zone. |
| Which channels brought the most sessions and key events last month? | run_report | Sessions and key events by default channel group, highest first. |
| Which landing pages from Organic Search have the best engagement rate? | run_report | Landing pages filtered to the Organic Search channel, with engagement rate as a fraction. |
| Which sources gained or lost the most sessions compared with the previous 28 days? | compare_report | Both periods' totals with absolute and percent changes, and the top gaining and losing source and medium pairs. |
| Compare organic search sessions with the same weeks last year. | compare_report | A comparison against 52 weeks earlier, so Mondays line up with Mondays. |
| Which custom dimensions and key events does this property have? | list_fields | The API names of the property's custom dimensions, custom metrics and key events, ready for a report. |
| What was revenue by country in September? | run_report | Total revenue per country in the property's currency. If your Google account cannot see revenue, Google withholds it. |
| How many people are on the site right now, and on which pages? | run_realtime_report | Active users in the last 30 minutes, by page or screen. |
Example: which channels changed
With no dates, compare_report compares the last 28 days ending yesterday with the 28 days before, in one Google request. With a breakdown such as channel, it returns the top gainers and losers.
Example answer, with made-up numbers. For Example Store (properties/123456789), 2026-09-08 to 2026-10-05 in the property's time zone, Europe/London, against the previous 28 days, sessions rose from 11,900 to 12,480, up 4.9%. Organic Search gained the most, up 610 sessions. Paid Search lost the most, down 240. Google applied data thresholds to this report, so some small rows are missing.
The data shows what changed, not why. When your assistant suggests a cause, treat it as a lead to check.
Example: who is on the site now
run_realtime_report covers the last 30 minutes and skips the cache, so each call reads fresh data.
Example answer, made up. In the last 30 minutes, Example Store had 37 active users: 14 in the United States, 9 in the United Kingdom and 6 in Germany. The page with the most active users was "Pricing". Realtime figures are preliminary.
Set up QuerySail
Setup takes about five minutes.
- Create a QuerySail account. The trial needs no card.
- Open Account → Connections, select Connect Google Analytics and approve read-only Analytics access. Every GA4 property that Google account can read becomes available. You can connect more than one Google account.
- Add the endpoint below to your AI app and sign in with your QuerySail account when it asks.
- Ask "Which Google Analytics properties can you access?" to check the connection.
https://mcp.querysail.com/ga4/mcp- Open Settings → Security and login and turn on Developer mode. Availability depends on your plan and workspace settings.
- Go to chatgpt.com/plugins and select the plus button.
- Name it QuerySail Analytics, paste the endpoint above as the connection URL and create it.
- Sign in with your QuerySail account when asked, then add QuerySail from the tools menu in a new chat.
Add the server, then sign in with your QuerySail account in the browser window the second command opens:
codex mcp add querysail-ga4 --url https://mcp.querysail.com/ga4/mcp
codex mcp login querysail-ga4The Codex app and IDE extension read the same ~/.codex/config.toml. To edit it by hand, add:
[mcp_servers.querysail-ga4]
url = "https://mcp.querysail.com/ga4/mcp"Add the server for all your projects:
claude mcp add --transport http --scope user querysail-ga4 https://mcp.querysail.com/ga4/mcpThen run /mcp in Claude Code, choose querysail-ga4 and sign in with your QuerySail account.
Leave out --scope user to add it to the current project only.
- In Claude Desktop or on claude.ai, open Customize → Connectors, select + Add, then Add custom connector.
- Name it QuerySail Analytics, paste the endpoint above as the server URL and select Continue.
- Keep the detected sign-in settings, add the connector and sign in with your QuerySail account.
- In a chat, select + → Connectors and turn on QuerySail.
On Team and Enterprise plans an owner adds the connector under Organization settings → Connectors, then each member selects Connect. Free plans allow one custom connector.
- Go to grok.com/connectors, select New Connector, then Custom.
- Paste the endpoint above as the MCP server URL and sign in with your QuerySail account when asked.
- Grok then uses the QuerySail Analytics tools in your chats when a question needs them.
On Grok Business and Enterprise plans a team admin first adds the server at console.x.ai under Grok Business → Connectors, with + Add Connector → Other. Members then connect on grok.com/connectors.
Add this to ~/.cursor/mcp.json for all projects, or .cursor/mcp.json in one project. If the file already lists servers, add the entry inside the existing mcpServers.
{
"mcpServers": {
"querysail-ga4": {
"url": "https://mcp.querysail.com/ga4/mcp"
}
}
}Then open Cursor's MCP settings, connect querysail-ga4 and sign in with your QuerySail account.
Run MCP: Add Server from the Command Palette, choose HTTP, paste the endpoint above and name it querysail-ga4. Or add this to your mcp.json:
{
"servers": {
"querysail-ga4": {
"type": "http",
"url": "https://mcp.querysail.com/ga4/mcp"
}
}
}Sign in with your QuerySail account when VS Code asks.
Add this to opencode.json in your project, or to ~/.config/opencode/opencode.json for all projects:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"querysail-ga4": {
"type": "remote",
"url": "https://mcp.querysail.com/ga4/mcp",
"enabled": true
}
}
}Then sign in with your QuerySail account in the browser window this opens:
opencode mcp auth querysail-ga4If your app accepts a remote MCP URL, add the endpoint above and sign in with your QuerySail account when asked.
If it only runs local commands, use the mcp-remote bridge (needs Node.js). It opens your browser so you can sign in:
{
"mcpServers": {
"querysail-ga4": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.querysail.com/ga4/mcp"
]
}
}
}Limits and accuracy
GA4 data has limits that are easy to miss when an assistant summarizes it. QuerySail adds notes about them to its answers, and your assistant should pass them on.
- Freshness. Google Analytics can take 24 to 48 hours to process events, so the most recent days may still change. The default window is the last 28 days ending yesterday.
- Time zone. Dates follow the property's time zone, and each answer names it.
- Thresholding. Google withholds rows or values when counts are small or Google signals is on. A missing row does not mean zero.
- Sampling. Google samples some large reports. Sampled values are estimates, and the answer says when this happened.
- The (other) row. When a breakdown hits Google's row limits, Google groups the rest into one "(other)" row.
- Restricted metrics. If your Google account cannot see revenue or cost data, Google withholds those metrics. QuerySail returns them as empty, not as zero.
- Report size. A report can use up to 9 dimensions and 10 metrics. Each call returns 20 rows by default and 100 at most, and your assistant can page through more. Fair-use limits are on the pricing page.
- Comparisons. Gainers and losers come from the top 500 rows of the breakdown across both periods.
- Realtime. Realtime reports cover the last 30 minutes, or 60 on GA4 360 properties. The figures are preliminary.
- Cache. QuerySail caches standard reports for up to 15 minutes, so asking the same question twice in a row does not call Google again.
- GA4 only. Universal Analytics properties are not supported.
- Read-only. The tools cannot change anything in Google Analytics: no edits to properties, data streams, key events, audiences or settings.
Other ways to get GA4 data into an AI assistant
QuerySail is one option. Depending on how often you ask and which app you use, one of these may suit you better.
Export a CSV and upload it
Export a report from Google Analytics and attach the file to a chat. It is free and works in any assistant that accepts files. The file holds only the dimensions and date range of that one report, and every new question about another breakdown or period needs a new export.
Use Google's own tools
The GA4 reports and explorations, the Looker Studio connector and the BigQuery export all read your Analytics data. Looker Studio suits dashboards you check regularly. The BigQuery export gives you event-level data, but it needs a Google Cloud project and SQL. None of them lets you ask questions in ChatGPT or Claude.
Run an open-source MCP server yourself
Google publishes an experimental, open-source Google Analytics MCP server, and others exist on GitHub. The software is free. Google's server runs on your machine with Python, and you set up a Google Cloud project, enable the Analytics Admin and Data APIs and sign in with your own credentials. It also has tools QuerySail does not offer, such as funnel reports and Google Ads links. A local server works with Claude Desktop, Claude Code, Cursor and VS Code. ChatGPT and claude.ai only connect to servers on the internet, so for them you also host the server and secure it. If you are comfortable with that, self-hosting is a good choice.
When QuerySail fits
QuerySail suits you if you want the same GA4 data in ChatGPT, claude.ai and your editor without running anything, or if you look after several properties or Google accounts. It costs $8 per month after the 7-day trial, and the same plan covers Search Console. See the Google Analytics MCP server page for every tool and option.