> ## Documentation Index
> Fetch the complete documentation index at: https://developers.autoplay.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Maven skill

> Connects an existing Maven AGI agent to Autoplay live activity through the Autoplay MCP server. Covers installing the MCP app on the agent, enabling Autoplay MCP tools, passing a verified user identity (signed JWT), and adding the proactive onboarding prompt that launches guided tours through Autoplay.js after explicit user consent. Use when the customer already uses Maven, Maven AGI, Agent Designer, or asks how to give Maven real-time Autoplay context.

# AI Support Agent — Maven

> Read `autoplay-core` first for install and credentials (`product_id`, `mcp_url`, `mcp_key`).
> This skill assumes the customer already has a Maven agent created in Agent
> Designer; do not guide them through adopting Maven from scratch.
>
> **Who does this: Mixed.** Installing the MCP app and the Chat app on the
> Maven agent (both must be done **from inside an agent**, not the global
> directory) is a user-only step — there's no API for it. Signing and
> encrypting the identity JWT on your backend, and wiring the Chat widget, is
> code you write yourself. `mcp_key` comes from your own `onboard_product`
> call, not from a user.
>
> **Stay inside this project's directory tree.** Every file this skill
> touches lives inside the current project root. Never search, list, or read
> outside it.
>
> **Wait for the real `mcp_key` before installing the MCP app.** Run
> `onboard_product` yourself first if it hasn't been run yet — never paste
> the literal `YOUR_MCP_KEY` placeholder into Maven's MCP auth token field.

## Scoping pattern for Maven

Maven discovers tools from any MCP server and registers them as agent
actions — install the MCP app (**MCP URL:** `https://mcp.autoplay.ai/mcp`,
**auth token:** your `mcp_key`) and Maven auto-registers the Autoplay
tools. No webhook, no session-linking, no listener process. Reads and tour
launches are keyed by `product_id` + `user_id`.

The tools Maven should see are:

| Tool                     | Purpose                                                                   |
| ------------------------ | ------------------------------------------------------------------------- |
| `get_live_user_activity` | Read the user's recent in-app activity before answering.                  |
| `get_onboarding_context` | Read the user's next onboarding step, completed steps, and stalled state. |
| `guide_next_step`        | Launch the next guided tour after the user explicitly says yes.           |
| `list_user_tours`        | List available tours when the user asks to browse or choose.              |
| `trigger_user_tour`      | Launch a specific tour selected by the user.                              |

For Step 2, do not guide the customer through MCP setup again. By then,
Maven already has the context and resources it needs from the MCP server.
Step 2 is only about adding the proactive prompt and connecting Autoplay.js
to the visual guidance provider.

After the MCP app is installed, the user must open the agent in Maven AGI,
go to **Settings** → **Response customization**, and paste this into
**Additional persona instructions**. Replace `<YOUR_PRODUCT_ID>` with the real
Autoplay `product_id` from `onboard_product`, replace `<YOUR_APP_NAME>` with the
customer's product name, and leave `user_id` session-derived. Set the
conversation persona to **Empathetic supporter**.

```text theme={null}
These instructions add live-activity awareness and proactive onboarding. They govern tool use and onboarding flow only. For identity, voice, scope, escalation, and content restrictions, follow your base persona above.

IDS (hardcoded — never ask the user for these)

product_id is ALWAYS "<YOUR_PRODUCT_ID>".
user_id comes from the session.

[AUTOPLAY LAYER 1 START] — activity-aware support

TOOL: get_live_user_activity — your live view of what this user is doing in <YOUR_APP_NAME>.

Call it at the start of every conversation, before your first substantive reply.
Re-call it whenever your next answer could depend on what the user has done, or the conversation has moved on since your last call — never reason from stale activity.
Skip it only for a pure pleasantry ("hi", "thanks") that needs no product context.
Never describe the tool call or its result. Use it only to ground your answer — reference what the user has done, not raw event data.
If it fails or returns empty, answer normally without mentioning it.

[AUTOPLAY LAYER 1 END]

[AUTOPLAY LAYER 2 START] — proactive onboarding (requires Layer 1 above)

Beyond answering questions, you also help the user reach their next onboarding win by launching a guided in-app tour — but ONLY after they say yes. You offer, you don't force; you show, you don't lecture.

TOOLS

get_onboarding_context — the ONLY source of truth for where the user is (next step, what's done, whether they're stalled). Never invent, recall, or guess a step.
guide_next_step — launches the tour for the next step. Call ONLY after an explicit yes in THIS conversation.
list_user_tours / trigger_user_tour — only if the user asks to browse or pick a specific tour.

STEP 1 — OFFER (never launch here)

Trigger: the user arrives, asks what's next, or a proactive opener fires.

Call get_onboarding_context.
Reply in <=2 warm lines: acknowledge what they just did, then OFFER the next step as a yes/no question — e.g. "Nice — account connected! Want me to walk you through setting your posting schedule?"
Do NOT call guide_next_step here. You are only offering.
If the user declines: acknowledge warmly ("No problem — just ask whenever!") and do not offer again this conversation.

STEP 2 — LAUNCH (only after an explicit yes: yes / sure / okay / go ahead / show me)

Call guide_next_step.
If it returns launched=true: reply in ONE short line naming the step it launched (use step_title, in your own words — no fixed template).
If it returns done=true: there's no next step — congratulate in one line.

NEVER

Call guide_next_step, or say a walkthrough is opening, without an explicit yes in THIS conversation.
Offer more than once per conversation.
Call get_onboarding_context more than once unless the user's situation changes.
Invent, recall, or assume step state.

VOICE

Warm, human, tight. One emoji max per line. Match your base persona's tone. Never answer onboarding questions from general knowledge — read context, offer, and launch only on a yes.

[AUTOPLAY LAYER 2 END]
```

Maven is not proactive by itself. For the proactive browser experience, the
customer must also install Autoplay.js and use either a user tour provider or
Autoplay's built-in nudge card to display the offer. Appcues is one supported
tour-provider example, but the same pattern can work with other providers that
Autoplay.js can trigger. Autoplay.js receives the nudge stream in the app and
displays the offer through the configured UI; Maven handles the conversation
after the user accepts; the tour provider renders the guided tour when one is
configured.

Identity is the one part that's more involved than the other MCP chatbot
platforms: Maven expects a **signed, encrypted** (JWE) identity token, not a
plain attribute. Sign the user's `id` (ES256) on your backend, encrypt it
(A128CBC-HS256), and hand it to `Maven.ChatWidget.load(...)` as
`signedUserData`; send the constant `product_id` as `unsignedUserData`. The
signed `id` must exactly equal the id your activity source identifies the
user with — Maven fills the tool's `user_id` argument from this verified
identity, not from anything you pass directly.

## Reference

* Full tutorial: [https://developers.autoplay.ai/recipes/maven/step-1-connect-real-time-events](https://developers.autoplay.ai/recipes/maven/step-1-connect-real-time-events)
* Proactive Maven step: [https://developers.autoplay.ai/recipes/maven/step-2-define-proactive-triggers](https://developers.autoplay.ai/recipes/maven/step-2-define-proactive-triggers)
* Appcues setup example: [https://developers.autoplay.ai/recipes/appcues/how-to-setup](https://developers.autoplay.ai/recipes/appcues/how-to-setup)
