Sign inGet started
Your agent (MCP)

Let your agent set it up

View as MarkdownOpen in ChatGPTOpen in Claude
Connect your agent
Add to CursorAdd to VS Code

How your coding agent sets nextanalytica up inside an app: it makes the project, adds the tag, checks it and goes live, while you only sign in once.

Updated

Your coding agent can set nextanalytica up for an app it builds, from an empty folder to the first visit seen. You sign in once in the browser; your agent does the rest with five tools, and the server tells it what to do next.

What is the path?

  1. Your agent connects to https://mcp.nextanalytica.app/mcp, and you sign in once in the browser.
  2. It calls create_project with the app's name. No address is needed yet.
  3. It calls get_tag, which returns the line to add and where it goes for the app's framework, then adds the tag to the app's layout.
  4. If the app has a server, it calls make_server_key and puts the key in an environment variable.
  5. It runs the app and calls check_setup to see what has arrived.
  6. When the app is deployed, it calls add_domain with the address. The first page view from that address makes the project live.

Which tools does it use?

ToolWhat it does
create_projectMakes a project with a name, and optionally a domain and a time zone. Asking again with the same name, or the same domain and name, returns the same project.
add_domainGives the project the address the app is served from. Not for development addresses.
make_server_keyMakes the key the app's server uses to send events. Shown once. If the project has one, it refuses unless your agent passes replace: true, which it does only when you ask for a new key. The old one stops working at once.
go_liveSays the app is in real use. Needs confirm: true, which your agent passes only after you say so.
check_setupShows each host that sent something, what sent it, the project's domains, whether it is live and the next step.

create_project, add_domain and go_live return the project with its public tag key as tag_key. get_tag returns the line to add. Only make_server_key returns a secret, as key, and only once. Your agent can't delete a project, hand it over or change who has access. Those stay with you in the dashboard.

What happens to events from my own computer?

They are noted, never stored. While you build, the tag runs on localhost, in a cloud editor or behind a tunnel, and none of that belongs in your numbers. nextanalytica notes that the host was seen, and when, so check_setup can say so, and drops the event.

These hosts count as development:

  • localhost, 127.0.0.1 and [::1]
  • *.localhost and *.test
  • *.app.github.dev, *.stackblitz.io, *.webcontainer.io and *.gitpod.io
  • *.ngrok-free.app, *.ngrok.io and *.ngrok.app
  • 10.*, 192.168.* and 172.16.* to 172.31.*, the addresses of your own network

A port, as in localhost:3000, is ignored. A preview address such as shop-git-fix.vercel.app is a real domain, so the server tells your agent to ask you before it adds one.

When is a project live?

A project is live once its first domain is verified, or once your agent calls go_live after you say the app is in real use. Until then:

  • A page view from a real domain follows the usual rule: the first one proves the site is yours and is not stored.
  • Events your server sends are noted, not stored.

A project with no website, such as a backend for a mobile app, goes live with go_live.

How does my agent check the tag without a browser?

It can't: the tag runs only in a browser. Your agent opens the local page if it has a browser tool, or asks you to open it once. Until a page view arrives, check_setup reports what it has seen. If only your server's events have arrived, its next step is "Installed, not yet seen in a browser: open the local page, or ask the person to."

Where does the server key go?

In an environment variable, never in a file you commit. Your agent checks that the env file is in .gitignore before it writes the key. Your agent's own key for a server or script with no browser is a different thing: make it with Key for a server in Access, as agent keys explains.

How does each agent find this?

Every agent ends in the same place: the server's instructions. What differs is the short way in.

AgentIts way in
Claude CodeThe one-line command, or the plugin: Claude Code
CursorThe install link and a project rule: Cursor
CodexThe one-line command and a block in AGENTS.md: Codex
Any other agentsetup.md, the same steps in one page an agent reads

What's next

Related
  • Your agent: Connect your own agent to nextanalytica's MCP server and ask about your site in plain words, instead of reading a dashboard.
  • What is an analytics MCP server?: An analytics MCP server lets your agent read your site's visits and answer questions about them. What it is, what it can do and how to connect one.
  • Use cases: Questions to ask your agent, by task, with what comes back, and multi-step recipes that build on each answer.
  • MCP tools reference: Every tool your agent can call on the nextanalytica MCP server, with its arguments and example prompts.
  • FAQ and advanced setup: What people ask before they connect an agent: cost, clients, keys, projects, where data goes and safety, answered straight.
  • Agent keys and OAuth: Two ways your agent signs in as you: the browser sign-in, or a personal agent key for a server or script with no browser, and which to use.
Still have questions?
Was this page useful?