show-connect-qrcode
Generate a QR code to connect MetaMask wallets securely for blockchain interactions without exposing private keys, enabling simplified user onboarding.
Instructions
Show the connect QR code for a given connect URI
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uri | Yes |
Implementation Reference
- Handler function that takes a URI, generates a QR code data URL using qrcode.toDataURL, and returns it as image content via imageContent.execute: async (args) => { const uri = args.uri; const qrCode = await QRCode.toDataURL(uri); return imageContent({ url: qrCode, }) },
- Zod schema defining the input parameter 'uri' as a string.parameters: z.object({ uri: z.string(), }),
- packages/metamask-mcp/src/tools/connect.ts:29-42 (registration)Registration of the 'show-connect-qrcode' tool with FastMCP server.addTool, including name, description, parameters, and execute handler.server.addTool({ name: "show-connect-qrcode", description: "Show the connect QR code for a given connect URI", parameters: z.object({ uri: z.string(), }), execute: async (args) => { const uri = args.uri; const qrCode = await QRCode.toDataURL(uri); return imageContent({ url: qrCode, }) }, });