Give your AI agent a
Canton wallet

Self-custody payments, inside your AI app.

@ftptech/canton-x402-mcp is a local MCP server that lets an AI agent hold Canton Coin, fund itself, and pay for the x402-gated APIs it calls. The key is generated and held on the machine that runs the server. Spending is capped by the owner.

What it provides

Four properties define the server. It runs in any MCP host, the agent holds its own key, the owner caps every spend, and it pays any x402-gated API on Canton.

Any host01

Runs in any MCP host

Add the server to Claude Code, Claude Desktop, or any host that can run a local process. One connect command, with no account to sign in to.

Self-custody02

The agent holds its key

The Ed25519 key is generated and held on the machine that runs the server. It is never returned to the agent or sent to the relay.

Capped03

Owner-set spend policy

A daily cap, a per-transaction cap, and a domain allowlist bound what the agent can spend. The agent cannot change them.

x40204

Pays x402 APIs

The agent funds itself from the faucet, then pays any x402-gated endpoint and settles on-ledger in Canton Coin.

How it works

Connect the server once with the spend policy. The agent then funds itself, pays an x402-gated URL, and the on-ledger updateId proves it settled.

01

Connect

The owner adds the MCP server to the host with one command, setting the spend caps and the domain allowlist.

02

Fund

The agent calls get_address, then auto_fund to pull a faucet seed, or asks its owner to send Canton Coin.

03

Pay

The agent calls pay on an x402-gated URL. The server signs locally with the agent's key and settles on-ledger.

04

Verify

The tool returns the response and the on-ledger updateId. The wallet balance is the proof a payment landed.

The first payment takes about 60 to 90 seconds while Canton creates the payment counter. That is warm-up, not a failure; later payments are quick. A 200 response is never the proof a payment landed, the on-ledger balance is.

The building blocks

The server is a local process the agent's host runs, a self-custody key it holds on disk, and a facilitator relay that submits and pays gas without custody.

Server01

Local MCP server

Runs over local stdio and exposes the wallet as tools. Connect it once; the agent calls the tools and never runs an install.

@ftptech/canton-x402-mcp
Key02

Self-custody key

Generated on first use and held in the server's home directory. Never returned by any tool and never sent to the relay.

Ed25519, held on disk
Relay03

Facilitator relay

Onboards the party, submits the agent's signed transactions, and pays gas. It cannot move the funds.

facilitator.ftptech.xyz

Add the server to any host that can run a local process. The server runs over local stdio, so hosts that can only attach a remote MCP over a URL, including ChatGPT on the web, cannot run it; for those, use the hosted HTTP path on the agents page.

claude mcp add canton-x402 -- npx -y @ftptech/canton-x402-mcp \
  --relay-url https://facilitator.ftptech.xyz \
  --allow-domains api.cantrustai.xyz \
  --daily-cap 5 --max-per-tx 1

Replace the caps with your limits, then restart the client. The Claude Code command and the JSON config use the same flags: --relay-url is required, --allow-domains is the pay allowlist (comma-separated; empty denies all, * allows any), and --daily-cap and --max-per-tx are the spend limits in CC. After it connects, have the agent call get_address, then auto_fund.

MCP tools@ftptech/canton-x402-mcp
  • get_addressReturns the agent's Canton party id. Creates the wallet on first use.read
  • get_balanceReturns the on-ledger Canton Coin balance.read
  • request_fundingReturns the party id and a paste-ready funding message for the owner.read
  • auto_fundPulls a one-time 0.1 CC faucet seed onto the agent's party and accepts it. Falls back to a manual funding ask if the faucet is used or over budget.funds in
  • claimAccepts pending incoming transfers. Run after the owner sends Canton Coin.funds in
  • payPays an HTTP 402 / x402-gated URL and returns the response.money out
  • withdrawSends Canton Coin to another Canton party.money out

@ftptech/canton-x402-mcp v0.1.2 (Apache-2.0). Requires Node 18 or newer with npx. The key is never returned by any tool; back up the wallet with the canton-agent-wallet CLI against the same home directory.

Spend policy

The owner sets the spend policy at startup. The agent cannot change it.

--daily-cap <CC>

Rolling 24-hour limit on outbound spend across pay and withdraw. Default 5. Set 0 to freeze.

--max-per-tx <CC>

Per-transaction cap. Site default 1. Enforced on withdraw, where the amount is known before signing.

--allow-domains <csv>

The hosts pay may target. Empty denies all outbound. Use * to allow any host.

Caps are checked before a transaction is signed, except where the price is only known mid-request. A refusal sends nothing to the relay. Because pay learns the price mid-request, the per-transaction cap is not a pre-sign block on pay; a payment is bounded by the daily cap, the funded ceiling, the domain allowlist, and balance accounting.

Who it is for

The same server serves the builder shipping one agent, the long-running service that pays as it goes, and the institution that needs self-custody and on-ledger settlement.

AI-agent builders

Give a desktop or IDE agent its own Canton wallet so it can pay for the tools it calls, bounded by a policy you set at startup.

Autonomous services

A long-running agent funds itself from the faucet and settles payments with no human in the loop, capped by the daily limit and the allowlist.

Institutions

Deploy agent payments with self-custody, on-ledger settlement on Canton MainNet, and a relay that controls no funds.

Giving your agents a wallet inside your app

FTP Tech LLC publishes the MCP server and runs the facilitator relay it settles through. Reach out to discuss an integration.

Talk to us
Non-custodial by design

The Ed25519 key is generated and held locally by the MCP and is never sent to the agent or to the relay.

The facilitator relay at facilitator.ftptech.xyz onboards the party, submits the agent’s signed transactions, and pays gas. It cannot move the funds. Settlement is verifiable on the ledger: every paid request resolves to an updateId on Canton MainNet.

Let’s build something
that stays online

Launching a network, need a battle-tested validator, or want a community that actually shows up? Talk to us.