agentlytics (by measuremy.site)

เว็บวิเคราะห์แบบไม่มีคุกกี้สำหรับเอเจนต์ AI เอเจนต์เขียนโค้ดของคุณอ่านทราฟฟิก หาสาเหตุที่พุ่งสูง สร้างฟันเนล และทำลิงก์ติดตาม ผ่าน MCP

เซิร์ฟเวอร์ MCP แบบโฮสต์

npx add-mcp 'https://a.measuremy.site/mcp'

ติดตั้งลง Claude Code, Codex, Cursor และอื่นๆ

เอกสาร

Not set up yet? Paste this and your agent does everything below

Add measuremy.site analytics to this project: connect the measuremy.site MCP server at https://a.measuremy.site/mcp (it signs in with OAuth, no key), then tell me how to sign in. Details: measuremy.site/llms.txt

Sign in with OAuth (no key)

Add the server by its URL, with no key. The first time your agent uses it, its MCP client opens measuremy.site in your browser, where you sign in and choose the site. Each agent you connect this way gets its own access, so connecting one never disconnects another.

Claude Code

Install the plugin: the server plus an add-analytics skill and /measuremysite:make-public, in every project:

/plugin marketplace add developeron29/measuremysite-plugin
/plugin install measuremysite@measuremysite

Or add just the server, for all your projects:

claude mcp add --scope user --transport http measuremysite https://a.measuremy.site/mcp

Restart Claude Code (claude -c keeps the conversation), then /mcp → measuremysite → Authenticate. One sign-in covers every site in your account; in each project your agent picks the site by its domain.

Cursor

{
  "mcpServers": {
    "measuremysite": {
      "url": "https://a.measuremy.site/mcp"
    }
  }
}

In ~/.cursor/mcp.json. Then press Login next to measuremysite in Cursor's MCP settings.

VS Code (Copilot)

{
  "servers": {
    "measuremysite": {
      "type": "http",
      "url": "https://a.measuremy.site/mcp"
    }
  }
}

In .vscode/mcp.json, or MCP: Add Server → HTTP. VS Code asks to sign in when the server starts.

Codex

[mcp_servers.measuremysite]
url = "https://a.measuremy.site/mcp"

In ~/.codex/config.toml, then run codex mcp login measuremysite.

Gemini CLI

{
  "mcpServers": {
    "measuremysite": {
      "httpUrl": "https://a.measuremy.site/mcp"
    }
  }
}

In ~/.gemini/settings.json, then /mcp auth measuremysite.

Claude.ai and Claude Desktop

Add a custom connector with the URL https://a.measuremy.site/mcp and sign in. Good for asking about your traffic; installing the snippet needs a coding agent that can edit your project.

Other MCP clients work too if they support remote servers with OAuth sign-in (the MCP authorization spec, with dynamic client registration).

Or set it up from a terminal

npx measuremysite init --agent claude

Run it in your project's folder (--agent cursor or --agent codex for those). It signs you in through the browser, writes the MCP config with your site's read key (never printed), and prints the script tag. Restart your agent to load the tools.

Or use the site's read key

Each site has a read key. Your agent uses it to read that site's analytics over MCP (Model Context Protocol) and to create campaign links. It can't change your account or billing. The key is shown once when you add a site; generate a new one any time from the site's Setup tab, which also shows these commands with your key filled in.

Try it without an account

This read-only demo key connects your agent to the live analytics of measuremy.site itself. It can read traffic, spikes, funnels and campaigns, but not change anything. Use it in any of the configs below in place of your own key, or in Claude Code:

claude mcp add --transport http measuremysite-demo https://a.measuremy.site/mcp --header "Authorization: Bearer demo_e1e0c94c09a0f00d24be4cbb9c24fc24"

Then ask: "What caused the biggest traffic spike on measuremy.site this month?" To use it on your own site, start a free trial and swap in your site's read key.

Claude Code

claude mcp add --scope user --transport http measuremysite https://a.measuremy.site/mcp --header "Authorization: Bearer YOUR_READ_KEY"

Restart Claude Code, or run /mcp to reconnect. claude mcp list should show measuremysite as connected. --scope user makes it available in every project.

If a tool call says the server rejected the Authorization header, the read key in your config is out of date (it changes when you rotate it on the Setup tab or re-run agent setup for the same domain). Run claude mcp remove measuremysite, add it again with the new key, then /mcp to reconnect. A running session keeps the old key until you do.

Cursor

Add to .cursor/mcp.json in your project, or ~/.cursor/mcp.json for all projects:

{
  "mcpServers": {
    "measuremysite": {
      "url": "https://a.measuremy.site/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_READ_KEY"
      }
    }
  }
}

Codex

Add to ~/.codex/config.toml:

[mcp_servers.measuremysite]
url = "https://a.measuremy.site/mcp"
bearer_token_env_var = "MEASUREMYSITE_READ_KEY"

and run export MEASUREMYSITE_READ_KEY=YOUR_READ_KEY in the shell that starts codex.

Self-host it

measuremysite-mcp is the open-source (MIT) version: a single-site analytics server with the same MCP tools for traffic, spikes, funnels, growth actions and tracked links. It runs in your own Cloudflare account (Workers and D1, usually within the free tier), so the data never leaves it. Deploy it with one click from its README, then connect your agent with the key you chose. The hosted version adds the dashboard, AI explanations of spikes, mentions on Hacker News and Reddit, alerts, weekly summaries and sign-in without keys.

Share your analytics: /make-public

Agent setup can add two slash commands (the get_setup tool hands them to your agent). /make-public publishes a dashboard of your traffic, spikes and what caused them at https://measuremy.site/share/your-domain; growth actions, campaigns and setup stay private. /make-private turns it off. To add them by hand, save the text below as .claude/commands/make-public.md (Claude Code), .cursor/commands/make-public.md (Cursor) or ~/.codex/prompts/make-public.md (Codex, run as /prompts:make-public):

Make this site's measuremy.site analytics public: call the measuremy.site MCP tool set_public_dashboard with public=true. Then give me the public link and say in one line that it shows traffic, spikes and what caused them, while growth actions stay private.

Without the command, just ask: "make my analytics public". In Claude Code it's also available as /mcp__measuremysite__make-public.

What to ask

  1. Understand. "Give me an overview of the last 30 days and explain the biggest traffic spike."
  2. Ask about visitors. "How many iOS visitors from the US did we get last week?" "Where do my Firefox users come from?" "Show the last 10 signups with their country and browser." The agent calls query_visits and recent_visits.
  3. Plan. "Use the plan_marketing prompt" or "Plan this week's marketing from what's working."
  4. Execute. "Write the posts, make a tracked link for each, and log what we ship." The agent calls create_tracked_link and add_annotation, and can edit pages in your repo directly.
  5. Measure. A few days later: "Which campaigns worked?" The agent calls get_campaign_results and suggests what to repeat or stop.

Ask about your visits

Two tools answer questions about who visits and what they do. query_visits counts the pageviews (or custom events) and unique visitors that match your filters, and can break the result down. recent_visits lists the latest individual visits. Your agent picks the arguments from your question, so you can just ask in plain words.

ArgumentWhat it does
rangeHow far back: 24h, 7d, 30d (up to 90d). Default 7d.
countryA code such as US or a name such as United States. XX or Unknown is traffic whose country isn't known.
browser, osBrowser: Chrome, Firefox, Safari, Edge, Opera, Samsung Internet. System: Windows, macOS, iOS, Android, Linux, ChromeOS. Visits from before this was tracked are Unknown.
source, referrerThe UTM source (else the referring site, else (direct)), or just the referring site such as news.ycombinator.com.
pageAn exact path like /pricing, or a prefix ending in * like /blog/*.
event, typeA custom event name such as signup. type is pageview, event or any.
group_byquery_visits only: country, browser, os, source, referrer, page, event, day or hour.
limitRows to return, up to 50.

Examples: signups per country is event=signup, group_by=country. Where Safari visitors come from is browser=Safari, group_by=source. Daily views of the pricing page is page=/pricing, group_by=day.

Only counts and the details above come back. measuremy.site stores no IP addresses or user agents, so your agent can't see them. Each visit row has a short visitor code that changes every day: it shows which rows on the same day came from one browser, nothing more.

All tools

get_overviewVisitors, pageviews and change vs the previous period. Start here.
get_timeseriesTraffic by hour or day
find_traffic_spikes / explain_spikeEvery jump, with the sources, pages and events behind it, plus the AI explanation
top_sources / top_pages / list_eventsRanked breakdowns
top_countries / top_browsers / top_systemsWhere visitors are from and what they use, as on the dashboard
query_visitsCount visits and visitors that match filters (country, browser, OS, source, page, event), optionally grouped by one of them or by day or hour
recent_visitsThe latest individual visits, with the same filters. No IP addresses or user agents are stored
create_funnel / get_funnel / delete_funnelDefine a funnel of pages and events, then see how many visitors reach each step and where they drop off
get_whats_workingChannels ranked by conversions and growth, growing pages, recurring spike causes
get_growth_actionsA ranked action list built from your own numbers
create_tracked_linkA tracked link for every post, email or ad your agent ships
set_public_dashboardShare a public dashboard of traffic, spikes and their causes, or make it private again. Also available as the make-public and make-private prompts
get_campaign_resultsWhat each campaign actually brought in
add_annotationLog a deploy, launch, post, email or ad so spikes are attributed to it

Plus the plan_marketing prompt, which walks the agent through evidence → plan → execute → measure.