Overview
The MCP server exposes the canonical CAW runtime toolkit via the Model Context Protocol (MCP) stdio transport, powered by FastMCP. It can be used with Claude Desktop, Claude Code, Cursor, and other MCP-compatible clients. By default it exposes the full toolkit. For production runtimes, you can narrow the tool surface withinclude_tools / exclude_tools in code or with environment variables.
Running the Server
Tool Surface
The MCP server exposes 20 tools grouped around the real developer workflow:Wallet context
| Tool | Description |
|---|---|
list_wallets | Discover wallets accessible to the caller. |
get_wallet | Inspect wallet metadata and status. |
list_wallet_addresses | List on-chain addresses derived for a wallet. |
get_balance | Get wallet token balances, optionally filtered by chain or token. |
Scoped authority
| Tool | Description |
|---|---|
submit_pact | Submit a pact for owner approval so the runtime can obtain scoped authority. |
get_pact | Fetch the latest state of a pact. |
list_pacts | List pacts visible to the caller. |
create_delegation | Create a delegation directly when you need owner-side provisioning flows. |
Onchain and payment actions
| Tool | Description |
|---|---|
transfer_tokens | Submit a token transfer subject to policy enforcement. |
contract_call | Submit a smart-contract call subject to policy enforcement. |
message_sign | Sign a message or typed data without broadcasting a transaction. |
payment | Submit a payment request such as x402 or MPP. |
estimate_transfer_fee | Estimate the fee for a transfer before submitting it. |
estimate_contract_call_fee | Estimate the fee for a contract call before submitting it. |
Tracking and audit
| Tool | Description |
|---|---|
list_transactions | List live transactions associated with a wallet. |
list_transaction_records | List persisted transaction records across transfers, calls, deposits, and payments. |
get_transaction_record | Fetch a transaction record by record UUID. |
get_transaction_record_by_request_id | Look up a transaction record by idempotency request ID. |
list_recent_addresses | List recently used destination addresses. |
get_audit_logs | Query the audit trail of actions, decisions, and denials. |
Claude Desktop Configuration
Add this to your Claude Desktopclaude_desktop_config.json:
Environment Variables
| Variable | Default | Description |
|---|---|---|
AGENT_WALLET_API_URL | 'http://localhost:8000' | API base URL |
AGENT_WALLET_API_KEY | — | API key (required) |
AGENT_WALLET_TIMEOUT | 30.0 | Request timeout in seconds |
AGENT_WALLET_INCLUDE_TOOLS | — | include_tools |
AGENT_WALLET_EXCLUDE_TOOLS | () | exclude_tools |
Recommended Flow
For real developer workflows, the canonical MCP sequence is:list_walletsandget_walletsubmit_pact, then pollget_pactuntil the owner activates itestimate_transfer_feeorestimate_contract_call_feetransfer_tokens,contract_call,message_sign, orpaymentget_transaction_record_by_request_idorlist_transaction_recordsget_audit_logs
Error Contract
The MCP server handles errors with the following semantics:- Policy denials — Returned as normal tool content, not protocol errors. The payload includes
error,status_code,message,code,reason,details,suggestion,formatted, andretryable. - API errors — Raised as
RuntimeErrorwith JSON payload containingstatus_code,message, andresponse. These become MCP protocol errors (isError: true). - Missing API key — Raises
RuntimeErrorat tool invocation time with a descriptive message.