erc8128_sign_request
Sign HTTP requests with ERC-8128 signatures to authenticate and secure API calls using wallet-based cryptography.
Instructions
Sign an HTTP request using ERC-8128 (RFC 9421 + EIP-191). Returns Signature-Input, Signature, and Content-Digest headers for the given HTTP method, URL, headers, and body.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | Yes | HTTP method | |
| url | Yes | Target URL to sign for | |
| headers | No | HTTP headers to include in signature | |
| body | No | Request body (used for Content-Digest) | |
| wallet_id | No | Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet. | |
| network | No | Network ID (e.g., evm-ethereum-mainnet) | |
| preset | No | Covered Components preset (default: standard) | |
| ttl_seconds | No | Signature TTL in seconds (default: 300) |
Implementation Reference
- The handler function for the erc8128_sign_request tool that prepares the request and calls the backend API.
async (args) => { const requestBody: Record<string, unknown> = { method: args.method, url: args.url, }; if (args.headers) requestBody['headers'] = args.headers; if (args.body) requestBody['body'] = args.body; if (args.wallet_id) requestBody['walletId'] = args.wallet_id; if (args.network) requestBody['network'] = args.network; if (args.preset) requestBody['preset'] = args.preset; if (args.ttl_seconds !== undefined) requestBody['ttlSeconds'] = args.ttl_seconds; const result = await apiClient.post('/v1/erc8128/sign', requestBody); return toToolResult(result); }, ); - packages/mcp/src/tools/erc8128-sign-request.ts:14-24 (registration)The registration function registerErc8128SignRequest that adds the tool to the MCP server.
export function registerErc8128SignRequest( server: McpServer, apiClient: ApiClient, walletContext?: WalletContext, ): void { server.tool( 'erc8128_sign_request', withWalletPrefix( 'Sign an HTTP request using ERC-8128 (RFC 9421 + EIP-191). Returns Signature-Input, Signature, and Content-Digest headers for the given HTTP method, URL, headers, and body.', walletContext?.walletName, ), - The Zod schema definition for the input parameters of the erc8128_sign_request tool.
{ method: z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH']).describe('HTTP method'), url: z.string().url().describe('Target URL to sign for'), headers: z.record(z.string()).optional().describe('HTTP headers to include in signature'), body: z.string().optional().describe('Request body (used for Content-Digest)'), wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'), network: z.string().optional().describe('Network ID (e.g., evm-ethereum-mainnet)'), preset: z.enum(['minimal', 'standard', 'strict']).optional().describe('Covered Components preset (default: standard)'), ttl_seconds: z.number().optional().describe('Signature TTL in seconds (default: 300)'), },