mcpField
A
AgentFirstStack

AgentFirstStack

Remote
agentfirststack.comData & Analytics1Updated 1d ago

About AgentFirstStack

AgentFirstStack provides website infrastructure that AI agents can configure, spanning analytics, tag management, email, and session replay. Services are available through APIs and MCP tools, with self-hosting on Cloudflare Workers supported.

Key features

  1. 01Signup in one request without forms
  2. 02Cookieless web analytics
  3. 03Tag management and conversion routing
  4. 04Email handling and verification extraction
  5. 05Session replay and behavior signals
  6. 06Self-hosted deployment

Use cases

  1. 01Set up infrastructure for a new website
  2. 02Analyze website visits and conversions
  3. 03Send conversions to multiple ad platforms
  4. 04Receive account verification emails

MCP support

Exposes MCP tools for analytics, tags, mail, and replay services, accessible through a unified endpoint or separate service endpoints.

Configuration

Remote servers need no local install. Pick your client, then copy the config or install in one click.

Endpointhttps://agentfirststack.com/mcp
Copy install command
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.

All endpoints
Streamable HTTPhttps://agentfirststack.com/mcpAuth required

Tools

Details

From the project README

README image

AgentFirstStack

Analytics, tag management, email inboxes and session replay that an AI agent sets up by itself.
No signup form, no verification email, no dashboard to click through. Free to use, and open source.

agentfirststack.com · Manual · Self-host · Architecture

CI AGPL-3.0 license


Every new website needs the same infrastructure: analytics, a tag manager with conversion tracking, and an email address to sign up for everything else. The usual tools all start with a signup form, a verification email and a dashboard. Coding agents can't get past those steps alone.

AgentFirstStack is that infrastructure, rebuilt so an agent can do the whole job:

  • One request gets an account. POST /v1/signup returns a key that works on every service.
  • Everything is an API call and an MCP tool. Nothing is hidden behind a settings page.
  • The manual is a text file. Each service serves /llms.txt with every endpoint, tool and field.
  • Every step can be verified. The agent checks its own work instead of guessing.
  • Humans optional. When it's done, the agent hands its person a claim link. They sign in with Google to see the project in a dashboard, manage keys and teammates, and connect Claude or ChatGPT over OAuth (docs/accounts.md).

Services

What it doesInstead of
AnalyticsCookieless web analytics. Country, region and city from Cloudflare's edge; channels including AI assistants; UTM and ad click ids; goals, revenue, funnels, realtime; server-side events; read-only SQLGoogle Analytics, Plausible
TagsA tag manager and server-side conversion router. Define a conversion once; the browser pixel and the server both send it to GA4, Google Ads, Meta and TikTok with one event id, so each platform counts it once. Scan, validate, preview, test and publishGoogle Tag Manager, server-side GTM
MailInboxes in one request. wait_for_email returns the moment a message arrives, with verification codes and links already extracted. Read, reply, send, custom domains, webhooksA Gmail account per project, AgentMail
ReplaySession recordings masked in the browser by default. Sessions come back as readable transcripts; rage, dead and error clicks, heatmaps and JS errors as data; a share link opens a player for peopleHotjar, Microsoft Clarity

Quick start

Hosted (free)

Copy the prompt from agentfirststack.com into Claude Code, Cursor, Codex or any agent that can make HTTP requests. Or do it by hand:

curl -X POST https://agentfirststack.com/v1/signup
# { "api_key": "afs_...", "mcp": { ... }, "next_steps": [ ... ] }

curl -X POST https://analytics.agentfirststack.com/v1/sites \
  -H "Authorization: Bearer $AGENTFIRSTSTACK_API_KEY" -H 'content-type: application/json' \
  -d '{"domain":"example.com"}'

Add one MCP server for every service (tools prefixed analytics_, tags_, mail_, replay_):

claude mcp add --transport http afs https://agentfirststack.com/mcp --header "Authorization: Bearer $AGENTFIRSTSTACK_API_KEY"

Or one per service:

claude mcp add --transport http afs-analytics https://analytics.agentfirststack.com/mcp --header "Authorization: Bearer $AGENTFIRSTSTACK_API_KEY"
claude mcp add --transport http afs-tags https://tags.agentfirststack.com/mcp --header "Authorization: Bearer $AGENTFIRSTSTACK_API_KEY"
claude mcp add --transport http afs-mail https://mail.agentfirststack.com/mcp --header "Authorization: Bearer $AGENTFIRSTSTACK_API_KEY"
claude mcp add --transport http afs-replay https://replay.agentfirststack.com/mcp --header "Authorization: Bearer $AGENTFIRSTSTACK_API_KEY"

The hosted version has fair-use limits, listed in the manual.

Self-hosted

Everything runs on Cloudflare Workers in your own account:

git clone https://github.com/StartGlobal-AI/agentfirststack && cd agentfirststack
pnpm install
pnpm afs init mystack --domain example.com --account <cloudflare-account-id>
pnpm afs deploy mystack
CLOUDFLARE_API_TOKEN=... pnpm afs email mystack     # inbound + outbound mail
pnpm afs check mystack

See docs/self-hosting.md for requirements, signup modes, limits and updates.

How it's built

TypeScript on Cloudflare Workers with Hono and zod. Storage:

  • D1: configuration and the shared identity database.
  • SQLite Durable Objects: hot per-entity data (a site's events, a container's visitors, an inbox's waiters).
  • R2: mail blobs and replay recording chunks.
  • Queues: retried delivery to ad platforms and webhooks.
  • Email Routing and Email Sending: mail in and out.
site/        landing page, platform manual, platform signup      agentfirststack.com
analytics/   web analytics                                        analytics.agentfirststack.com
tags/        tag manager + conversion APIs                        tags.agentfirststack.com
mail/        inboxes, sending, domains, webhooks                  mail.agentfirststack.com
replay/      session replay, signals, heatmaps, share player          replay.agentfirststack.com
shared/      @afs/shared: auth, signup, errors, MCP handler
scripts/     pnpm afs: the deployment tool
deploy/      deployment profiles (yours; the agentfirststack.com one is kept private)
docs/        architecture, self-hosting, operations, development

More in docs/architecture.md.

Development

pnpm install
pnpm typecheck && pnpm test          # every package; integration tests run inside workerd
cd mail && pnpm db:migrate:local && pnpm dev

docs/development.md covers running services locally, tests, and adding endpoints, migrations and tag destinations. docs/operations.md covers releases, migrations, secrets, monitoring and abuse handling for a running deployment.

Contributing

Issues and pull requests are welcome. Read CONTRIBUTING.md first; it's short. Report security issues privately as described in SECURITY.md.

License

The services are AGPL-3.0; the browser scripts websites load (the analytics tracker, the tag manager runtime, the replay recorder and survey widget) are MIT, so adding them to a site puts no obligations on it. Self-hosting is free either way; if you offer a changed version as a service, publish your changes. Details: LICENSING.md. Built and hosted by StartGlobal.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.