verify-message
Verify digital signatures to confirm message authenticity and sender identity using address, message, and signature data.
Instructions
Verify that a message was signed by the provided address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | ||
| message | Yes | ||
| signature | Yes |
Implementation Reference
- The execute handler that performs the message verification using wagmi's verifyMessage function with the provided address, message, and signature.execute: async (args) => { const address = args.address as Address const message = args.message const signature = args.signature as `0x${string}` const result = await verifyMessage(wagmiConfig, { address, message, signature, }) return { content: [ { type: "text", text: result.toString(), }, ], } },
- Zod schema for the tool's input parameters: address (string), message (string), signature (string).parameters: z.object({ address: z.string(), message: z.string(), signature: z.string(), }),
- packages/metamask-mcp/src/tools/verify-message.ts:8-34 (registration)The server.addTool call that registers the "verify-message" tool including its name, description, parameters schema, and execute handler.server.addTool({ name: "verify-message", description: "Verify that a message was signed by the provided address", parameters: z.object({ address: z.string(), message: z.string(), signature: z.string(), }), execute: async (args) => { const address = args.address as Address const message = args.message const signature = args.signature as `0x${string}` const result = await verifyMessage(wagmiConfig, { address, message, signature, }) return { content: [ { type: "text", text: result.toString(), }, ], } }, });
- Helper function to register the verify-message tool on the FastMCP server.export function registerVerifyMessageTools(server: FastMCP): void { server.addTool({ name: "verify-message", description: "Verify that a message was signed by the provided address", parameters: z.object({ address: z.string(), message: z.string(), signature: z.string(), }), execute: async (args) => { const address = args.address as Address const message = args.message const signature = args.signature as `0x${string}` const result = await verifyMessage(wagmiConfig, { address, message, signature, }) return { content: [ { type: "text", text: result.toString(), }, ], } }, }); };
- packages/metamask-mcp/src/index.ts:58-58 (registration)Top-level registration call in the main index.ts file that invokes the helper to add the tool to the MCP server.registerVerifyMessageTools(server);