packages/mcp-server directory of the Vault repository.
Available Tools
The MCP server exposes the following tools to the agent:1. setup_spending_mandate
Generates a setup URL for the human user.
- Input:
maxAmountPerTxCents,maxMonthlySpendCents,railPreference - Output: A markdown link for the user to authorize.
2. check_mandate_balance
Allows the agent to see how much it can spend.
- Input:
mandateId - Output: Remaining monthly balance.
3. authorize_agent_payment
The core tool for making purchases.
- Input:
amountCents,currency,description,recipient - Output: A cryptographic Intent Mandate (SD-JWT-VC) or a success receipt if the server handles the execution.
4. delegare_fetch
A tool for scraping or fetching data from third-party APIs that may be monetized.
- Input:
url,method,body - Output: The fetched HTTP response content.
- x402 Auto-Payment: If the target URL returns a
402 Payment Requiredchallenge, this tool intercepts it, automatically signs the payment with the agent’s mandate, and resubmits the request to fetch the data.
MCP Authentication Guard
To prevent unauthorized tool calls, the MCP server implements anmcpAuthGuard.
- Every tool call must be authorized by an OAuth session.
- Credentials (
merchantId,apiKey) are never exposed to the LLM prompt. - The guard injects the required metadata into the tool context based on the bearer token in the request header.
Usage in Claude Desktop
Add Delegare to yourclaude_desktop_config.json: