show-connect-qrcode
Generate a QR code for a specified connect URI to enable secure blockchain interactions via MetaMask, facilitating user onboarding and AI-powered transactions without exposing private keys.
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 DataURL using qrcode library, and returns it wrapped in imageContent for display.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)Registers the 'show-connect-qrcode' tool on the FastMCP server instance.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, }) }, });