# MCP for AI assistants

The **Zocton MCP** lets an AI assistant that supports MCP (the Model Context Protocol)
read your TraceFlow data: who visited, from which email or campaign, and what they looked
at. It is for anyone who would rather ask a question than open a report.

TraceFlow has **no public REST API**. The Zocton MCP is the way to read TraceFlow data from
outside the app.

## Where to find it

Connect your AI assistant to the Zocton MCP — see
[Connect to the Zocton MCP](https://www.zocton.com/docs/shared/mcp).

## Before you start

- An API key (it starts with `zk_`) or an MCP link that may **read TraceFlow** — see
  [API keys](https://www.zocton.com/docs/shared/api-keys).
- At least one website with visits in TraceFlow.

## Authenticate

Connecting is the same for every Zocton app: follow
[Connect to the Zocton MCP](https://www.zocton.com/docs/shared/mcp). The tools act as you,
and see only your own projects and websites.

## TraceFlow tools

All three only read. None of them returns a recording, a network address or a user agent.

| Tool | Inputs | What it does |
| --- | --- | --- |
| `tf_list_visitors` | `project_id` (required); `days`, `identified_only`, `limit`, `offset` (optional) | Recent visitors of the project's websites, newest first: email and name when known, visits, first and last seen, the latest visit's source, medium, campaign and `utm_email`, and country. Bots are left out. |
| `tf_visitor_journey` | `website_id`, `visitor_id` (both required, from `tf_list_visitors`) | One visitor's latest visits, with the pages seen in each in order, and each visit's source, medium, campaign, `utm_email` and place. |
| `tf_utm_stats` | `project_id` (required); `days` (optional) | Visits and visitors per source, medium and campaign on the project's websites, most first. |

`days` is how many days back to look; it is 30 when left out. `identified_only` set to
`true` lists only visitors with an email.

## Shared Zocton tools

These work the same in every Zocton app. Use them to find the ids the TraceFlow tools need.

| Tool | Inputs | What it does |
| --- | --- | --- |
| `zocton_whoami` | none | Who the connection acts as, its data centre, and which Zocton apps it may read or change |
| `zocton_list_projects` | `include_archived` (optional) | Your Zocton projects; their ids (`zp_…`) go into `project_id` |
| `zocton_project_summary` | `project_id` | Counts of what one project holds in each Zocton app, visitors included |
| `zocton_list_sites` | `project_id` (optional) | Your websites on Zocton: name, address, project, verified, and whether TraceFlow and ZuvoChat are on |
| `zocton_list_senders` | `include_archived` (optional) | Your senders on the Zocton Dashboard, never a secret |

## Worked example

You ask your assistant:

> Who came to our website from last week's newsletter, and what did they look at?

The assistant:

1. Calls `zocton_list_projects` and finds your project's id, for example `zp_…`.
2. Calls `tf_utm_stats` with that `project_id` and `days: 7` to find the newsletter's
   campaign and how many visits it brought.
3. Calls `tf_list_visitors` with the same `project_id`, `days: 7` and
   `identified_only: true`, and keeps the visitors whose latest visit came from that
   campaign.
4. Calls `tf_visitor_journey` with each visitor's `website_id` and `visitor_id` to list the
   pages they saw.

It answers with the people by email and the pages each one read, in order.

## Good to know

- **Read only.** No tool changes, names or deletes a TraceFlow visitor. Do that in TraceFlow.
- **Your key decides.** A key or link that may not read TraceFlow gets a refusal from the
  TraceFlow tools. Call `zocton_whoami` to see what it may do.
- **Answers are recent visits.** `tf_visitor_journey` returns a visitor's newest visits,
  not their whole history.

## Related

- [Connect to the Zocton MCP](https://www.zocton.com/docs/shared/mcp)
- [API keys](https://www.zocton.com/docs/shared/api-keys)
- [Identify visitors](https://gettraceflow.com/docs/features/identify-visitors)
- [Visitors](https://gettraceflow.com/docs/features/journey-timeline)
