⭐ MCP is the integration path. Connect your existing agent to Autoplay over MCP — you don’t build or host an event pipeline, a context store, or a trigger system. If your platform can’t speak MCP but can call an HTTP endpoint, there’s a limited REST API fallback for the activity read only.
1. 🔌 Connect to the server
YOUR_MCP_KEY is the mcp_key from your Quickstart product registration. Keep it server-side.
Every tool takes a product_id, and auth is checked against it on each call:
- Invalid or missing token → the call fails with “Invalid or missing API key”.
- Token valid but scoped to another product → it fails with “API key does not match product_id”. The key’s
external_idmust equal theproduct_idyou pass, so a key for product A can’t read product B.
Authorization header:
mcp-session-id.
2. 🔑 Satisfy identity
Make your agent send the sameuser_id that activity is stored under — your activity source’s stable user id (the id you pass to posthog.identify(...), the Amplitude user_id, …). This is the step that most often gets skipped, and it’s why an active user comes back looking idle.
See Identity for the full rule and the per-agent mechanisms for passing a verified id.
3. 🛠️ Call the tools
Once connected, your agent has the tool surface documented on MCP tools — reading activity and onboarding progress, checking whether it may interrupt, launching tours, and recording confirmed completions.Start with
get_recommendation_context. When the agent is deciding what to recommend next, that one call returns recent activity, onboarding progress, the next step, and the matching tour together — instead of three separate blocking reads. See MCP tools.4. 🤖 Follow the per-agent recipe
Each agent platform has its own way of registering an MCP server and passing a verified user identity. The endpoint, the tools, and the identity rule don’t change — only the wiring does.Intercom Fin
Connect Fin to this server, plus the Messenger JWT identity verification Fin needs to pass a trusted
user_id.Other agents
Inkeep, Crisp, Plain, Rasa, Tidio and more — same endpoint, same tools, their own identity mechanism.
🧪 Test it with the MCP Inspector
The quickest way to confirm the server is reachable and your token works:- Set Transport Type to Streamable HTTP.
- Set URL to
https://mcp.autoplay.ai/mcp. - Under request headers, add
Authorization=Bearer YOUR_MCP_KEY. - Click Connect. The tool list appears.
- Call
get_live_user_activitywith a realproduct_idand auser_idyou’ve identified — you should get the activity envelope back.
⏳ Before activity appears
The activity tools return something only once Autoplay has recorded activity for that user: your activity source must be wired up and the user must have generated events. With PostHog (the source used in the Quickstart): complete Quickstart Steps 1–3 — the snippet,posthog.identify(...), product registration, and the ingest webhook. Other sources (e.g. Amplitude) follow the same path through their own ingestion.
Retention — live activity is short-lived memory, not an archive:
- 4-hour TTL (
ACTIVITY_TTL_S=14400) — older activity expires. - 50 actions max per user (
ACTIVITY_MAX_EVENTS=50) — older ones are trimmed.
get_onboarding_context and get_recommendation_context.