Virtuals Plugin
[!IMPORTANT] Complete the short Base MCP onboarding flow defined inVirtuals (ACP — Agent Commerce Protocol) is a platform for creating and operating autonomous AI agents that can transact onchain, hold payment cards, and own email identities. The Virtuals MCP server prepares and executes agent management, agent card, and agent email operations. The Base MCP wallet is used only to sign the SIWE login challenge — Virtuals does not route onchain transactions through Base MCP after auth. The exact list of Virtuals tools, their parameters, and the capabilities they expose are advertised by the Virtuals MCP itself — read the tool descriptions rather than relying on a fixed catalog in this file. Tools may be added, renamed, or removed.SKILL.mdbefore calling any Virtuals tool. Virtuals is session-authenticated: every tool requires a JWTtokenparameter obtained via a SIWE login that the user must approve through Base MCP. Run the Auth flow once per session and reuse the token for subsequent calls.
MCP Server
URL:https://mcp.acp.virtuals.io/
Detection
If no Virtuals tools (e.g.login_start, agent_list, agent_card_*, agent_email_*) are exposed to the harness, the Virtuals MCP isn’t installed — don’t try to reach Virtuals’ HTTP API directly, the SIWE auth and most tool paths require the MCP. Instead, help the user install it for their current surface. Detect the harness from environment signals (available CLIs like claude / codex / cursor, working directory, tool names) and walk through the matching step:
- Claude Code:
claude mcp add virtuals --transport http https://mcp.acp.virtuals.io/ - Codex:
codex mcp add virtuals --url https://mcp.acp.virtuals.io/(or add[mcp_servers.virtuals] url = "https://mcp.acp.virtuals.io/"tocodex.toml) - Cursor / JSON-config harnesses: add the snippet from Installation to the harness’s MCP config (e.g.
~/.cursor/mcp.jsonor the project’s.cursor/mcp.json) and restart it. - Claude.ai web / Claude Desktop / iOS / Android: Customize → Connectors → Add custom connector, name
virtuals, URLhttps://mcp.acp.virtuals.io/. - ChatGPT: Settings → Connectors → Create, name
virtuals, MCP Server URLhttps://mcp.acp.virtuals.io/, AuthenticationOAuth(enable Developer Mode if prompted). - Other / unknown harness: show the JSON snippet from Installation and ask the user where their MCP config lives.
Capabilities Overview
Three main capability groups (consult the MCP tool catalog for the current exact tool names):- Agent management — create agents, list your agents, prepare and poll the launch flow.
- Agent cards — sign agents up for payment cards, issue cards, set spend limits, manage 3DS codes, update card profile, set up payment methods.
- Agent email — give agents an email identity, read/search the inbox, fetch threads/attachments, compose and reply to emails, extract OTPs or links from messages.
Auth Flow
Virtuals authentication is stateless from the MCP’s perspective — no session is stored server-side. Every authenticated tool requires the JWTtoken from login_complete as an explicit parameter. Run this flow once at the start of the session and reuse the token until it expires (~1 hour); use login_refresh with the refresh token thereafter.
Step-by-step
- Fetch the wallet address. Call Base MCP
get_walletsand usebaseAccount.address. - Start login. Call Virtuals
login_startwith that address. Returns the SIWEmessageto sign and anoncevalid for 30 minutes. - Sign with Base MCP. Call
signwithtype: "personal_sign"anddata: { message: <SIWE message verbatim> }. Returns anapprovalUrlandrequestId. - Present the approval link. Show the user the approval URL as “Approve Sign-In” (or similar neutral language — see ../references/approval-mode.md). Wait for them to confirm.
- Poll for the signature. Call Base MCP
get_request_statusonce after the user confirms; the result includes thesignaturevalue. - Complete login. Call Virtuals
login_completewith the exactmessagefrom step 2 and thesignaturefrom step 5. Returns{ token, refreshToken, walletAddress }. - Store and reuse the token. Pass
tokenas thetokenparameter on every subsequent Virtuals tool call. Refresh withlogin_refreshonce the JWT expires.
Troubleshooting
The Base MCP wallet is a Base Account smart wallet (contract account, not a plain EOA). The SIWE signing path has a few sharp edges — these are the failure modes we’ve observed.1. Invalid SIWE signature (401) on login_complete
Start with wallet identity, not signature format. The most frequent root cause is that the user is approving the sign-in with a different wallet than the one named in the SIWE message — not signature wrapping. Virtuals fully supports Base Account smart wallets (contract accounts), so smart-wallet support is not the issue.
Typical address-mismatch scenarios:
- Cross-device cache drift. Base MCP was authenticated on one device (e.g. desktop) and
get_walletsreturned the address cached there, but the user is approving the sign-in popup on another device (e.g. phone) — or vice versa. The wallet that actually signs is different from the one named in the SIWE message. - Multiple wallets in the same client. The active wallet in the approval popup isn’t the one Base MCP
get_walletsreturned. - Stale
get_walletsresult. You fetched the address earlier in the session and the user has since switched the active wallet in Base MCP, sologin_startwas called with a stale address.
- Re-run
get_wallets(Base MCP) to refreshbaseAccount.address. - Confirm with the user which wallet and which device they intend to sign with. If they don’t match the refreshed address, ask them to switch to the right wallet/device before retrying.
- Restart from
login_startwith the confirmed address so the SIWE message names the wallet the user will actually approve.
Less common: ERC-6492 wrapped signature
In some Base Account smart wallet flows, Base MCPsign returns an ERC-6492 wrapped signature (used for counterfactual or contract-deployment-attached signing), and the Virtuals verifier expects a plain ERC-1271 signature.
Recognize ERC-6492 wrapped signatures by:
- Length: thousands of hex characters (the inner ERC-1271 signature is much shorter).
- They end with the magic suffix
6492649264926492649264926492649264926492649264926492649264926492.
login_start. Subsequent approvals from the same wallet can produce a plain ERC-1271 signature that Virtuals accepts; the wrapping behavior isn’t deterministic from one approval to the next. If it keeps returning ERC-6492 wrapped signatures, ask the user to confirm via the same approval URL again — repeated retries typically resolve to a plain ERC-1271 signature within a few attempts.
Do not try to unwrap the ERC-6492 envelope manually and submit just the inner bytes — Virtuals rejects that too, because the inner Base Account smart wallet signature format isn’t a vanilla ERC-1271 (r, s, v) either.
2. Address case mismatch
Pass the wallet address tologin_start exactly as returned by Base MCP get_wallets. The returned address is lowercase, which is fine — Virtuals normalises it. But when calling login_complete, the message you pass must be the verbatim string returned by login_start (which uses the EIP-55 checksummed address). Do not lowercase or otherwise reformat the message. A single character change in casing inside the message hashes to a different value than what was signed and the server will return Invalid SIWE signature.
Verified working pattern:
login_startinput: lowercase address (e.g.0xca8f1eb...) → finelogin_completemessage: verbatim string from thelogin_startresponse (contains the checksummed0xCa8F1eB...) → required
3. Nonce expired
SIWE nonces expire 30 minutes afterlogin_start. If the user took a long time to approve, or you waited and tried again later, login_complete will fail. Restart from login_start to get a fresh nonce — do not reuse an old one.
4. Message whitespace / newlines
The SIWEmessage field in sign (as data.message) and the message field in login_complete must be byte-identical to what login_start returned. JSON-escape \n correctly when embedding in the sign tool’s data payload. When passing the message to login_complete, use real newlines (the same characters the JSON \n escapes decoded to). Any mismatch — extra trailing whitespace, CRLF vs LF, etc. — breaks the hash and yields Invalid SIWE signature.
5. Wallet not deployed on Base
ERC-1271 verification calls the wallet contract on Base. If the Base Account smart wallet has never been activated on Base mainnet, the contract isn’t deployed and verification will fail even with a structurally correct signature. Confirm deployment by checkingeth_getCode for the address on Base mainnet — non-empty bytecode means it’s deployed. Most Base MCP users will already have a deployed wallet; if not, ask the user to perform a no-op transaction first (any Base transaction will deploy the wallet).
6. Token expired mid-session
JWTs returned bylogin_complete expire after about an hour. When a Virtuals tool returns a 401, call login_refresh with the stored refreshToken to get a new access token; only re-run the full SIWE flow if the refresh token is also rejected.
Example Prompts
get_wallets(Base MCP) →baseAccount.address.login_start(Virtuals) with that address → SIWE message.sign(Base MCP) withtype: "personal_sign",data: { message }→ approval URL.- Show the user the approval link; wait for confirmation.
get_request_status(Base MCP) → signature.login_complete(Virtuals) with the message + signature → token.- Confirm: “You’re signed in. Your Virtuals session is good for about an hour.”
- Ensure session token is current (run Auth flow if not).
- Call the Virtuals agent-list tool with
token.
- Ensure session token.
- Call the Virtuals agent-create tool.
- For email: call the email-identity creation tool with the new
agentId. - For a card: call the card signup tool, poll until verified, then issue a card and set spend limits.
Important Notes
- Stateless auth. The token must be passed to every Virtuals tool — the MCP server doesn’t remember it between calls.
- Session scope. Only one wallet can be authenticated per token. To switch wallets, run the full SIWE flow again with the new address.
- No onchain operations through Base MCP after auth. The Base MCP wallet is only used for the SIWE signature. Virtuals’ tools (card issuance, email, agent ops) operate against Virtuals’ own backend.
- Sensitive outputs. Agent card details and email contents can include private information. Don’t echo card numbers, 3DS codes, OTPs, or email bodies to chat unless the user has clearly asked for them.
- Wallet vs Base Account. Use
baseAccount.addressfromget_walletsfor SIWE — not the agent wallets (agentWallets[]), which are session-scoped delegations for transactional flows.