# Connect An Agent

Canonical URL: https://magiccard.ai/docs/guides/connect-agent
Markdown URL: https://magiccard.ai/docs/guides/connect-agent.md
Summary: Use this guide to install the MagicPay skill, let setup choose the right branch, verify status, and run the first Memory-managed workflow.
Description: Connect MagicPay to a supported personal AI agent runtime and prepare the protected checkout steps.

## Canonical Answer

Use this guide to install the MagicPay skill, let setup choose the right branch, verify status, and run the first Memory-managed workflow. Connect MagicPay to a supported personal AI agent runtime and prepare the protected checkout steps. Protected payment and identity data stays behind MagicPay requests instead of entering LLM-visible context.

## Before You Start

You need one supported runtime where the agent can install skills or persistent instructions. A raw API key is no longer the normal first-run path for landing setup; the MagicPay skill should ask `magicpay setup next` what to do and follow the returned instructions.

## Install The Right Surface

Every runtime needs the MagicPay skill for setup, Memory-managed payment, login, identity, and confirmation flows. The MagicPay CLI bundles the product workflow and installs the browser support it needs.

```ts
npx skills add MercuryoAI/skills --skill magicpay --global --yes --copy
magicpay --help
magicpay setup next --intent landing --platform <runtime> --agent-name "<runtime> Agent" --api-url https://durcottggsiesxxqzvbb.supabase.co/functions/v1/api --env production
```

## Verify

Confirm the installed CLI exposes the current setup surface and that MagicPay can read the local setup state before starting a real checkout flow.

1. `magicpay --help` must include `setup next`.
2. Follow the `instructions` returned by `magicpay setup next`; do not map debug states to your own prompts.
3. After setup, run `magicpay status`.
4. Restart the runtime if newly installed skills are not visible.
5. Begin with a browser-only task, then move to a protected form such as a shipping address.

Note: Done when: both commands succeed, the agent can open a page with MagicBrowse, and a MagicPay request shows up in your approval channel.

## Related

- Agent Skills: https://magiccard.ai/docs/integrations/agent-skills
- Claude App: https://magiccard.ai/docs/integrations/claude
- ChatGPT App: https://magiccard.ai/docs/integrations/chatgpt