Headstream

MCP server, API and CLI for AI agents

Updated 2026-11-02

Headstream is built so agents can do the work. Features aren't locked in the dashboard. You can reach them through an MCP server, a REST API or a CLI, and an agent can handle setup from start to finish.

Let an agent do your setup

Point your coding agent at the setup guide. It explains how to get your site tracking, including where the script tag goes. Your agent can add a project, install the snippet in your shared layout, and check the setup status.

MCP server

Connect any MCP client to the Headstream MCP server at /api/mcp. Your agent gets tools for most of the product:

  • Reports. Traffic, summaries, breakdowns, revenue by channel and custom reports, including funnels.
  • Trust. Explain a metric, trace a payment, read data quality and the change log.
  • Dashboards. List, create and add reports to saved dashboards.
  • Self-reported data. Record and group answers.
  • Experiments. Create, start, read and stop A/B tests.
  • Fixes. Get the top suggested fix, mark it applied, then check whether it helped.
  • Behavior. Fetch heatmaps, list recordings and read session timelines.
  • Monitoring. Read uptime and configure monitors.
  • Customers. List customers and see each customer's journey.

That gives you a loop an agent can run on its own. It finds the top fix, ships a change to your code, marks the fix as applied, and checks the result later.

REST API

The REST API lives at /api/v1. It covers sites, summaries, traffic, breakdowns, revenue, customers, goals, dashboards, reports, experiments, heatmaps, monitoring, data quality and raw export. Use it to feed internal tools or to pipe numbers into a weekly report.

CLI

The headstream CLI is good for scripts and terminal agents. Set the HEADSTREAM_API_KEY environment variable and go. Output is JSON, so it pipes well.

headstream sites
headstream summary --site <id> --from 2026-10-01 --to 2026-10-31
headstream revenue --site <id> --model u_shaped
headstream revenue-breakdown --site <id> --dimension campaign
headstream fix --site <id>

Treat visitor data as data

Analytics contains text written by strangers: page paths, UTM values, referrers and survey answers. Headstream marks that text as data in agent output, so your agent can tell it apart from instructions. You should still limit what your agent can do with what it reads.

Agents and trust

An agent is only as good as the data it reads. It can call the same tools you'd use to check a number, like explain_metric and trace_payment. Your agent can test a claim before it acts on it. The details are on our trust page and in our methodology.

What agents can work with

Agents get the same data you do: revenue attribution, funnels and flows, heatmaps and recordings, and self-reported attribution. If you'd rather ask questions without any setup, use the AI assistant in the dashboard.

See pricing for plans.

Questions

Where is the Headstream MCP server?
At /api/mcp on headstream.app. Connect it from any MCP client.
Can an agent install Headstream?
Yes. Agents can follow the guide at headstream.app/agent.md to set up a project and add the script tag.
What format does the CLI return?
JSON. Set HEADSTREAM_API_KEY and run commands like headstream sites or headstream revenue.

See which marketing makes money.

Get started free