An interactive CLI playground for the MetaMask Connect SDK, demonstrating both multichain API and legacy EVM connector capabilities in a Node.js environment.
This playground provides a terminal-based interface for testing MetaMask connections from Node.js applications. It supports:
- Multichain API: Connect to multiple chains (Ethereum + Solana) with unified session management
- Legacy EVM Connector: Traditional EVM-only connection with chain switching support
- Message Signing: Test
personal_signon Ethereum andsignMessageon Solana - Chain Switching: Switch between networks when using the Legacy EVM connector
- Node.js (>=20.19.0)
- Yarn (v4.1.1+)
- nvm (recommended for Node version management)
From the monorepo root:
# Ensure correct Node version
nvm use
# Install all dependencies
yarn install
# Build workspace packages
yarn buildcp .env.example .envThen fill out the resulting .env file:
INFURA_API_KEY=your_infura_api_keyFrom the monorepo root:
yarn workspace @metamask/node-playground start connectOr from this directory:
yarn start connectWhen you start the playground, you can choose between:
- Multichain API - Connects to Ethereum Mainnet and Solana Mainnet simultaneously
- Legacy EVM Connector - Connects to Ethereum Mainnet with traditional EVM methods
Once connected, the available actions depend on your connector type:
Multichain API:
- Sign Ethereum Message (
personal_sign) - Sign Solana Message (
signMessage) - Disconnect
Legacy EVM Connector:
- Sign Ethereum Message (
personal_sign) - Switch Chain (Ethereum, Polygon, Linea, Sepolia)
- Disconnect
- Start the playground and select a connection type
- A QR code will appear - scan it with MetaMask Mobile
- Once connected, your accounts will be displayed grouped by chain
- Choose an action from the menu to test SDK functionality
- Signatures and results are displayed in the terminal
node-playground/
├── src/
│ └── index.ts # Main CLI application
├── package.json
├── tsconfig.json
└── README.md
The playground uses:
@metamask/connect-multichain- For multichain API connections@metamask/connect-evm- For legacy EVM connectionsinquirer- Interactive CLI promptschalk- Terminal stylingora- Loading spinners
See the main repository contributing guide for development setup and guidelines.