Skip to content

MCP server

Nordtally has a hosted server for the Model Context Protocol, so an assistant or any other MCP client can read your statistics and answer questions like “which pages brought the most visits last month?”. It is a thin layer over the Stats API: the same keys, the same numbers, the same limits. It can only read, and it returns aggregates only.

Connect

Create an API key under Workspace → API keys (owners and admins). Use a key of its own for each client, limited to the sites that client should see, so you can revoke it without touching anything else. Then point the client at the endpoint and send the key as a bearer token:

Endpointhttps://app.nordtally.com/api/mcp
TransportStreamable HTTP (POST), JSON responses
AuthenticationAuthorization: Bearer nt_live_…

Most clients read a JSON file with an mcpServers entry. Keep the key out of files you commit: where the client can read it from an environment variable or a prompt, use that.

mcp.json
{
  "mcpServers": {
    "nordtally": {
      "url": "https://app.nordtally.com/api/mcp",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}

Cursor reads .cursor/mcp.json in a project (or ~/.cursor/mcp.json) and can take the key from the environment:

.cursor/mcp.json
{
  "mcpServers": {
    "nordtally": {
      "url": "https://app.nordtally.com/api/mcp",
      "headers": { "Authorization": "Bearer ${env:NORDTALLY_API_KEY}" }
    }
  }
}

VS Code reads .vscode/mcp.json, with servers instead of mcpServers, and can ask for the key once and store it:

.vscode/mcp.json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "nordtally-key",
      "description": "Nordtally API key",
      "password": true
    }
  ],
  "servers": {
    "nordtally": {
      "type": "http",
      "url": "https://app.nordtally.com/api/mcp",
      "headers": { "Authorization": "Bearer ${input:nordtally-key}" }
    }
  }
}

There is no OAuth sign-in yet: a client that only offers “connect with a browser login” and no custom header can’t connect. Clients that support only local (stdio) servers can’t either; there is nothing to install.

Tools

ToolReturns
list_sitesThe sites the key may read: site id, domain, compliance mode and time zone. The other tools take the site id.
get_aggregateTotals for a period: visitors, visits, pageviews, events, views per visit, bounce rate, visit duration, and revenue when asked for. Optionally compared with another period.
get_timeseriesVisitors, visits and pageviews per hour, day or month.
get_breakdownTop values of one property: source, page, entry or exit page, country, browser, a custom property…

The three statistics tools take the parameters of the matching Stats API endpoint and return its response unchanged: site_id, period or from and to, filters (a list such as ["page:contains:/blog"]), metrics (a list), compare, interval, property and limit. A wrong parameter is an error that names it, in the API’s words, so a typo never returns unfiltered numbers. Every tool is marked read-only, and there are no resources or prompts.

Every result carries what a reader needs to quote it honestly: the date range, the site’s mode, sampling (whether the numbers were read from a sample of visitors), margins on totals, privacy_floor and small_groups, and on comparisons has_data. The server tells clients to present sampled figures as estimates and withheld values as withheld, not as zero. See how Nordtally counts.

Limits

  • A tool call counts as one Stats API request on the key’s budget: 600 per hour and 30 per 10 seconds, shared with anything else that uses the key. Over the limit, the tool returns an error that says when to retry.
  • Listing tools and other protocol messages don’t count towards that budget; they have a ceiling of 300 requests per minute per key.
  • Request bodies may be at most 64 KB. Responses are JSON; nothing is streamed.
  • The server keeps no session and no memory of earlier calls. Revoking a key stops it at the next request.
  • It implements the 2026-07-28 revision of the protocol and also answers clients that still open with initialize (2025-11-25 and earlier).

What it can never return

  • Anything about a single visitor or visit. There are no visitor or visit identifiers, IP addresses or user agents to ask for, and no tool takes a query of your own.
  • A site the key isn’t allowed to read. A site of another workspace looks exactly like one that doesn’t exist.
  • Numbers under a site’s privacy floor: small breakdown values are combined, and filters that match too few visitors return an error instead of numbers. Revenue for too few buyers is left out.
  • Changes. No tool creates, edits or deletes anything.

The floor for your own numbers is off unless you switch it on, and an API key reads what members read. If page paths or property values on your site can carry names, switch the floor on under Settings → Privacy before connecting a client: whatever a tool returns goes to the model your client uses.

Treat results as untrusted text

Page paths, referrers, campaign tags and custom property values are whatever visitors’ browsers sent, and anyone can request a URL on your site that reads like an instruction. Nordtally returns these strings only as data fields (value, domain), never inside its own descriptions or summaries, and tells clients not to follow instructions found in them. Your client decides what the model does with tool results, so keep a person in the loop for any other tool the same assistant can call, and prefer a key limited to the sites it needs.