Skip to main content

⚡ Add this skill

One command

Add the Autoplay Maven skill for an existing Maven AI support agent setup.
View the docs →

Agent onboarding

Fetch this skill when a customer already uses Maven and wants its AI support agent to consume Autoplay live user activity.
View the skill →
Maven pulls a user’s recent in-app activity on demand via the Autoplay MCP server — it calls the tool the moment it needs context to answer. You’ll do four things:
1

Connect Maven to the MCP server

So Maven can call the Autoplay MCP tools.
2

Tell Maven when to use live activity

So the agent checks user activity before it answers.
3

Embed the Maven chat widget

So your users can talk to Maven inside your app.
4

Pass a verified user identity

So Maven knows which user is asking, and pulls the right activity.
This guide assumes you already have a Maven agent created in Agent Designer. If you don’t have one yet, see Maven AGI’s Agent Designer docs to create one first, then come back here.
What Autoplay needs from your Maven setup:
  • product_id and mcp_key — printed by your own onboard_product call (see Quickstart), not something Maven issues.
  • Organization ID and Agent ID (Chat app → Settings → Instructions tab) — only needed if you haven’t embedded the widget yet; skip if it’s already running.

🎬 Watch the walkthrough

Prefer to watch first? This short Loom covers Part A below — installing the MCP app on your Maven agent, configuring it with your MCP URL and token, and testing it in the Simulator.

🔌 Part A — Add the Autoplay MCP server to Maven

Maven discovers tools from any MCP server and registers them as actions your agent can call.
1

Open your agent's Apps

In Maven AGI, open your agent, go to Apps, and find the MCP app (Browse & Install → search “MCP”).
2

Configure the connection

Install the MCP app and enter:
  • MCP URL: https://mcp.autoplay.ai/mcp
  • MCP auth token: your mcp_key (from your product registration)
3

Install

Click Install. Maven connects to the server and registers the Autoplay MCP tools as actions automatically.
Maven should show these Autoplay actions under Capabilities:
Install the MCP app from inside an agent (your agent → Apps → MCP), not from the global directory. Installing without an agent fails the post-install step.
Tool definitions are captured at install time. If the tool’s description ever changes, reinstall the MCP app so Maven picks up the update.
Verify it now in the Simulator. Open Simulator and ask: “My product_id is your-product-id and my user_id is a-real-user-id. What have I done recently?” Maven calls get_live_user_activity and answers with that user’s activity. (In the Simulator you pass the ids in the message; Parts C and D wire identity automatically so your real users never have to.)

🧠 Part B — Add the live-activity instructions

Open your agent in Maven AGI, go to SettingsResponse customization, and paste this into Additional persona instructions. Replace <YOUR_PRODUCT_ID> with the real product_id printed by your own onboard_product call (see Quickstart). Replace <YOUR_APP_NAME> with your product name.
Do not paste the placeholder literally. Maven should see your actual Autoplay product_id, while user_id stays session-derived through the verified identity setup below.

💬 Part C — Embed the Maven chat widget

This is the surface your users talk to. Maven distributes it as a Chat app.
1

Install the Chat app

In your agent → AppsBrowse & Install → search “Chat” → install the Chat app.
2

Allow your domain

Open the Chat app → SettingsSecurityAllowed domains and add the domain your app runs on (e.g. localhost for local testing, then your production domain).
3

Copy your snippet

Open the Chat app → SettingsInstructions tab to find your snippet with your real organizationId and agentId.
4

Add it to your app

Drop the widget script into your site, just before the closing </body> tag:
If your site uses a Content Security Policy, allow chat.onmaven.app in your script-src, connect-src, and frame-src directives.
At this point the widget loads — but Maven doesn’t yet know who the user is. That’s Part D.

🔐 Part D — Pass a verified user identity

Maven only pulls the right user’s activity if it sends the correct user_id to the tool. The secure way is signed user data: your backend cryptographically signs the logged-in user’s identity, so it can’t be forged.

1. Configure the keys — in Maven

In the Chat app → SettingsSecurity, set:
  • JWT Public Key — the public half of a signing keypair you generate (Maven uses it to verify the signature).
  • Encryption secret — a shared secret (Maven uses it to decrypt the token).
Generate them once:
The private key and the encryption secret are server-side only. Never ship them to the browser or commit them.

2. Sign the user’s identity — on your backend

Add an endpoint your frontend calls for the logged-in user. It signs the user’s data (ES256), then encrypts the signed token (JWE):
Set id to the same stable id your analytics identifies the user with (the value you pass to posthog.identify(...) / Amplitude setUserId(...)). Maven fills the tool’s user_id argument from this verified identity — so make sure id is your canonical user id, not just an email.

3. Hand the token to the widget — in your frontend

Fetch the token and pass it as signedUserData. Send your constant product_id as unsignedUserData:
Replace YOUR_ORGANIZATION_ID, YOUR_AGENT_ID, and YOUR_PRODUCT_ID with the real values from your Chat app’s Instructions tab and your own onboard_product call — don’t paste the placeholder text literally.
The single most important rule: the user_id Maven sends must equal the id your activity is stored under — the same stable id you pass to posthog.identify(...) / Amplitude setUserId(...). If they don’t match, lookups come back empty. Pick one canonical user identifier and use it everywhere: your analytics identify(), the signed user_id, and the connector.

✅ Test it

  1. Log in to your app as a user and click around a few pages.
  2. Wait a few seconds for the events to reach the connector.
  3. Open the Maven widget and ask: “What have I done recently?”
Maven should answer with the pages and actions that user just took.
Almost always an identity mismatch — the user_id Maven sent doesn’t match the id your activity is stored under. Confirm your analytics identify() id, the signed user_id field, and the connector’s stored id are all the same value.
Check Allowed domains in the Chat app settings includes your domain, and that your CSP allows chat.onmaven.app.
Verify the MCP URL and token are correct, and that you installed the MCP app inside an agent. Reinstall to re-discover tools.

Once Maven can pull a user’s activity on demand, you’re done with Step 1. Next: Step 2 — Add proactive layer.