show-connect-qrcode
Generate a QR code from a connect URI to securely link MetaMask with blockchain operations, ensuring private keys remain protected in your wallet.
Instructions
Show the connect QR code for a given connect URI.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uri | Yes | Connect URI |
Implementation Reference
- src/tools/connect.ts:36-44 (handler)Handler function that takes a connect URI, generates a QR code data URL using QRCode.toDataURL, and returns it wrapped in imageContent.execute: async (args) => { const uri = args.uri; const qrCode = await QRCode.toDataURL(uri, { width: 200, }); return imageContent({ url: qrCode, }); },
- src/tools/connect.ts:33-35 (schema)Zod input schema requiring a 'uri' string parameter.parameters: z.object({ uri: z.string().describe("Connect URI"), }),
- src/tools/connect.ts:30-45 (registration)Tool registration via server.addTool, defining name, description, input schema, 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().describe("Connect URI"), }), execute: async (args) => { const uri = args.uri; const qrCode = await QRCode.toDataURL(uri, { width: 200, }); return imageContent({ url: qrCode, }); }, });