Guides

Connect a wallet

metamask-mcp connects to MetaMask Mobile with a QR code. Once connected, the agent can read your address and send prompts to your wallet.

Connect#

Just ask:

prompt
Connect my MetaMask wallet.

Behind the scenes, the agent follows these steps:

  1. Check for an existing connection

    get-account returns the connected address, or nothing if no wallet is connected yet.

  2. Create a connect link

    get-connect-uri starts a MetaMask connection and returns a one-time URI.

  3. Show the QR code

    show-connect-qrcode turns that URI into a QR code image in the chat. Open MetaMask Mobile, tap the scan icon, scan the code, and approve the connection.

  4. Confirm

    get-account now returns your address and get-chain-id the network your wallet is on.

Note. If your client can't display images, ask the agent for the connect URI instead and open it on the phone that has MetaMask installed.

Choose a network#

metamask-mcp is configured for two networks:

  • Ethereum Mainnet — chain ID 1
  • Sepolia testnet — chain ID 11155111
prompt
Switch to Sepolia.

The agent calls switch-chain and MetaMask asks you to approve the switch. Use get-chains to see the configured networks at any time.

Disconnect#

prompt
Disconnect my wallet.

disconnect ends the session. The session also ends whenever the server stops, for example when you quit your MCP client, so you'll scan a fresh code next time.

Next#

With a wallet connected, try sending tokens or deploying a contract.