This page is about giving an agent access to your analytics data. To give an
assistant these documentation pages instead — so it can help you write an
integration — see Use docs with AI. To teach
an agent the procedure for setting up and operating TinyAnalytics, see
Agent Skills, which pair well with this server.
What can an agent do through MCP?
The complete server catalog contains 66 tools in eleven domains. A full-access key receives the 58 default tools. A restricted key receives only the tools allowed by its selected resources; an explicit matching write grant can also expose the catalog’s gated configuration or delete tool for that resource.
The analytics-report tools also accept a
trait:<key> filter — for example
“breakdown by page for users whose plan is pro” — which scopes the report to identified users by a
trait’s current value. Trait filters need a key with Users: Read and never match anonymous
traffic.
Every tool runs with both your key’s scopes and your account access. The agent sees only the
sites you can see, a restricted key sees only granted tools, and writes are refused unless your
organization role also allows them.
Can an agent read Google Search Console data through MCP?
Useget_gsc_status to check the connection and selected Google property, then
get_gsc_data to read search queries, pages, countries, devices, or daily performance.
Both tools require Analytics: Read and membership with access to the site.
A public dashboard or shared link does not grant access to Search Console data.
Connect Google and select a property in the site’s Search Console
report first. A disconnected or unfinished
connection returns guidance and a link to that report.
After resolving your numeric site ID with list_sites, call get_gsc_data with:
Each row includes
name, clicks, impressions, ctr (a fraction from 0 to 1),
and average position. Results also identify the source, date range, Pacific
timezone, applied limit, and whether TinyAnalytics cropped rows (truncated).
Daily rows are oldest first, with missing days filled with zeros. Other dimensions
return top rows by clicks. If a daily result is truncated, split the range into
smaller windows before summing clicks or impressions. Google may omit rows even
when truncated is false, so query or page totals must not be treated as site totals.
Recent data can be delayed. Use dimension: "date" for daily clicks and impressions;
never sum CTR or average position.
Verify the connection with get_gsc_status: connected: true and a non-null
gscPropertyUrl mean a property is selected. Then verify that get_gsc_data returns
a successful result; an empty result may mean Google has no data for that window.
Search Console data remains outside run_query and its SQL views.
TinyAnalytics does not expose index coverage or URL inspection results; use
Google Search Console for indexation checks. These tools read data only; connection,
property selection, and disconnection stay in the dashboard.
To analyze the visitors who arrived from search, use get_landing_pages with
filters: [{"dimension":"channel","op":"equals","value":["Organic Search"]}],
your site_id, start_date, and end_date. The filter uses each session’s entry
channel and the report retains its original landing page and full session metrics.
How do I keep tool responses small?
Three tools that return whole rows accept an optionalfields argument — list_sessions,
list_users, and get_events_log. Pass the row fields you actually need (for example
["country", "entry_page"]) and each row comes back with only those fields, pruned on the server
before it reaches your agent’s context. The row’s identity fields are always kept — session_id
for sessions, id for users, and event_id, session_id, and timestamp_ms for the event log —
so follow-up calls like get_session still work. An unknown field name is an error that lists
every valid field name, so the agent corrects itself on the next call instead of guessing.
List and breakdown reads are capped at 100 rows (get_breakdown, landing and exit pages,
journeys, and the dimension-split limits included). When a capped read returns a full page, the
response says so: it gains truncated: true, the limit that was applied, and guidance on how
to narrow — for example with filters or a shorter date window, or by requesting the next page.
An agent that reads the response knows it saw a partial answer rather than mistaking the top 100
for the whole picture.
Which AI clients can connect today?
The requirement is simple: the client must speak Streamable HTTP and let you set a request header. Clients that only support OAuth cannot connect yet.How do I connect my agent?
1
Create an API key
In TinyAnalytics, open Settings → Account and create a key from the API keys card. For least privilege, turn on Restrict permissions and grant only what the agent needs. A traffic-reading agent usually starts with Sites: Read and Analytics: Read; add Sessions, Events, Users, Goals, Funnels, Dashboards, or Custom SQL only for those tasks.Copy the key immediately—it is shown only once. The key can never reach a site that its owner cannot access.
2
Add the server to your client
Use the configuration for your client below, replacing Cursor reads
YOUR_API_KEY with the key you just created.~/.cursor/mcp.json (or .cursor/mcp.json in a project), VS Code reads .vscode/mcp.json, and Codex CLI reads ~/.codex/config.toml.3
Keep the key out of your repository
If the configuration file is committed, read the key from your environment instead of pasting it. In Claude Code, a project
.mcp.json supports ${VAR}. Export TINYANALYTICS_API_KEY before starting Claude Code:.mcp.json
4
Ask your agent to list your sites
Start a new session so the client picks up the server, then ask:
The agent returns your organization and its sites, each with a numeric
site ID. That ID is what every other tool uses, so a successful
list_sites call confirms both the connection and the key.What should I ask first?
Once connected, ask in plain language — the agent picks the tool:- “What were my top pages last week?”
- “How much traffic came from AI assistants this month?”
- “Which AI assistant is growing fastest — chart sessions per assistant by week.” (
get_timeserieswithdimension: "ai_assistant"; with adimensionset, the metric must besessionsandcompareis not accepted — the tool returns an error rather than silently ignoring either) - “When did Perplexity first send us traffic?” (
get_breakdownwithfirst_seen: true, which adds each value’s all-time first appearance; session dimensions only) - “Which pages do people land on and immediately leave?”
- “Create a goal for anyone who reaches /pricing.”
- “Build me a dashboard of signups per day.”
Do I need to give dates?
Yes, for anything over a date range. Every date-ranged report requires a start and end date inYYYY-MM-DD, read in the time zone you pass (UTC by default). Agents supply these automatically from your question — “last week” becomes concrete dates — but there is no relative range like 7d, and there is no “all time” shortcut. For all of your history, ask for a range starting before the site existed.
The time_zone argument takes an IANA time zone name. The MCP server validates it before calling the API: an unknown zone is rejected immediately with examples (UTC, America/New_York, Europe/Istanbul) and the database link, not a bare API error.
Live visitors, saved funnels, saved dashboards, and annotations don’t take dates.
How many requests can an agent make?
MCP calls are limited to 120 requests per minute per API key. Beyond that the server returns429 Too Many Requests with a Retry-After header, and the agent should wait for the window to reset.
That budget suits normal agent work: building a dashboard, where each card is previewed before saving, is typically 30–60 calls over a couple of minutes. Browser tracking uses the keyless client API and is separate from the MCP request budget.
Is it safe to connect an agent?
Connecting an agent gives it your key’s access. Understand these points before you do.- Prefer a restricted key. Grant only the resources and read/write actions the agent needs. The MCP tool list and direct REST calls enforce the same scopes, while your organization and team permissions remain an additional boundary.
- Write scopes can include permanent actions. A restricted key with an explicit matching write grant can receive configuration or delete tools for Sites, Goals, Funnels, Dashboards, Annotations, or Users. Do not grant those write scopes to an agent that only needs reads. The 50 tools on a full-access key omit these seven gated actions by default.
- Analytics text is untrusted input. Page titles, referrers, and event names come from anonymous visitors to your site, which makes them a channel for prompt injection. TinyAnalytics strips control and bidirectional characters from every value it returns and tells the model explicitly that returned text is data, never instructions. Keep that assumption in your own prompts too.
- Revoke a key any time. Deleting the key in your account settings cuts off the agent immediately.
Troubleshooting
Frequently asked questions
What is the TinyAnalytics MCP server?
What is the TinyAnalytics MCP server?
It’s an endpoint at
https://dash.tinyanalytics.io/api/mcp that exposes a
66-tool catalog over the Model Context Protocol. A full-access key receives
58 default tools; a restricted key receives the subset allowed by its
scopes and may receive matching gated actions when you explicitly grant
write access. Connect Claude Code, Cursor, VS Code, or Codex CLI with your
API key, then ask questions in plain language.Do I need a special key or a paid plan for MCP?
Do I need a special key or a paid plan for MCP?
No. MCP uses the same API key as the rest of the API, created under Settings → Account, and it reaches exactly the sites that key’s owner can reach.
Can I connect claude.ai or ChatGPT?
Can I connect claude.ai or ChatGPT?
Not yet. Both require OAuth for custom connectors, and the TinyAnalytics MCP server currently authenticates with an API key sent as a request header. Support for OAuth is planned. Today the endpoint works with developer clients that let you set a header: Claude Code, Cursor, VS Code, and Codex CLI.
Can an agent delete my analytics data?
Can an agent delete my analytics data?
Only if you explicitly give a restricted key the matching write scope. For
example, Sites: Write can expose site configuration and deletion, while
Users: Write can expose user erasure. A full-access key receives 58
default tools that omit the eight gated configuration/delete actions. Use a
restricted read-only key for analysis-only agents.
How is this different from Ask AI inside TinyAnalytics?
How is this different from Ask AI inside TinyAnalytics?
Ask AI lives in the TinyAnalytics dashboard and answers questions there. The MCP server brings the same data into the AI tool you already work in, so an agent can combine your analytics with your codebase — for example, checking whether a page you just changed is losing visitors.
Do I still need the HTTP API?
Do I still need the HTTP API?
Only if you’re writing code. MCP is for AI agents working on your behalf; the HTTP API is for applications and scripts you build. Both use the same key and return the same data.
Related
API keys
Create the key your agent will use.
API reference
The HTTP API behind every MCP tool.
Ask AI
Ask questions inside the TinyAnalytics dashboard.
Use docs with AI
Give an assistant these documentation pages.
API access and CORS
Browser-origin rules and documented API limits.
SQL query API
The read-only SQL an agent runs for you.