show-connect-qrcode
Generate a QR code from a connection URI to enable secure blockchain interactions through MetaMask without exposing private keys.
Instructions
Show the connect QR code for a given connect URI.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"uri": "<uri>"
},
"name": "show-connect-qrcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uri | Yes | Connect URI |
Implementation Reference
- src/tools/connect.ts:36-44 (handler)The execute handler for the 'show-connect-qrcode' tool. Generates a QR code Data URL from the input URI using the QRCode library and returns it as an image content response.
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 defining the 'uri' parameter as a required string.
parameters: z.object({ uri: z.string().describe("Connect URI"), }), - src/tools/connect.ts:30-45 (registration)The server.addTool call that registers the 'show-connect-qrcode' tool with FastMCP, including name, description, schema, and 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, }); }, });