Skip to content

BofAI/x402-recharge-server

Repository files navigation

x402-recharge-server

x402-recharge-server is the MCP payment service used by BANK OF AI to receive x402-based recharges.

Its public role is simple:

  • expose one MCP tool: recharge(amount, token)
  • return x402 payment challenges
  • support stablecoin recharge on supported production chains

In the full product flow, a companion skill can route end-user recharge requests to this MCP service.

This payment agent is used for BANK OF AI account recharge. BANK OF AI product entry: https://chat.bankofai.io/chat

Supported Routes

Current supported payment routes:

Network Tokens
TRON mainnet USDT, USDD
BSC mainnet USDT only

Production MCP endpoint:

https://recharge.bankofai.io/mcp

Install MCP

Tested with add-mcp for Codex, Claude Code, and OpenCode:

npx add-mcp https://recharge.bankofai.io/mcp

If you deploy this service on another BANK OF AI subdomain, replace the host accordingly.

Quick Start

Local

git clone https://github.com/BofAI/x402-recharge-server.git
cd x402-recharge-server
cp .env.example .env

npm install
npm run build
npm start

Local MCP endpoint:

http://127.0.0.1:8000/mcp

Docker

cp .env.example .env
./scripts/deploy.sh up
./scripts/deploy.sh smoke
./scripts/deploy.sh logs

Quick Check

curl -i http://127.0.0.1:8000/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":"check-402","method":"tools/call","params":{"name":"recharge","arguments":{"amount":"1","token":"USDT"}}}'

Expected:

  • 402 Payment Required
  • TRON mainnet route for USDT
  • BSC mainnet route for USDT

How It Is Used

An AI agent calls:

recharge(amount, token)

The service returns an x402 challenge. A compatible client signs the payment and retries the request. After settlement succeeds, the service returns the payment result and transaction reference.

Current Agent Registration

Chain Network Identity Registry Agent ID Status
TRON mainnet TFLvivMdKsk6v2GrwyD2apEr9dU1w7p7Fy 8 active
BSC mainnet 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 56:43970 active

Deployment

Operational deployment steps are in:

License

MIT

About

x402 recharge server of bankofai

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors