@aipayagnet/mcp
v0.1.0
Published
AiPay Protocol MCP server for agent-safe USDC escrow workflows
Downloads
129
Maintainers
Readme
AiPay MCP Server
Agent-safe MCP server for AiPay Protocol — verifier-backed USDC escrow on Polygon.
Install
npm install -g @aipayagnet/mcp
# or run without installing
npx -y @aipayagnet/mcpClaude Desktop / Cursor / Hermes config
{
"mcpServers": {
"aipay": {
"command": "npx",
"args": ["-y", "@aipayagnet/mcp"],
"env": {
"AIPAY_BASE_URL": "https://aipay.work",
"AIPAY_EVIDENCE_API_KEY": "your-developer-key"
}
}
}
}AIPAY_EVIDENCE_API_KEY is only required for aipay_upload_evidence. Read/query tools work without it.
Safe Mode by default
This MCP server defaults to Safe Mode:
- never stores private keys
- never signs messages
- never broadcasts real USDC transactions
- returns EIP-712 typed data or calldata previews for the user's wallet/signer to execute
Signer mode is intentionally not implemented in v0.1. Use wallet-owned execution for real transactions.
Tools
| Tool | Purpose |
|---|---|
| aipay_get_status | Return AiPay deployment/API/chain status |
| aipay_upload_evidence | Upload config/evidence bundle to Evidence API |
| aipay_get_evidence | Read config/evidence bundle by hash |
| aipay_prepare_order | Build a standard AiPay order from plain task terms |
| aipay_build_acceptance_typed_data | Build EIP-712 data for payee acceptance signature |
| aipay_build_signed_order_package | Combine order + payee signature into transfer package |
| aipay_verify_signed_order_package | Verify package before payer funds it |
| aipay_get_order | Query one escrow/order by task ID |
| aipay_list_orders | List orders by address/state |
| aipay_build_transaction_preview | Build calldata preview for deposit/result/release actions |
Example flow
- Agent calls
aipay_upload_evidencefor verifier config or task evidence. - Agent calls
aipay_prepare_orderwith payer, payee, amount, and task description. - Payee signs data from
aipay_build_acceptance_typed_datain their wallet. - Agent calls
aipay_build_signed_order_package. - Payer calls
aipay_verify_signed_order_packagebefore funding. - Payer's wallet executes calldata from
aipay_build_transaction_preview. - Agents poll
aipay_get_order/aipay_list_orders.
Environment
| Variable | Default | Description |
|---|---|---|
| AIPAY_BASE_URL | https://aipay.work | AiPay web/API base URL |
| AIPAY_EVIDENCE_API_KEY | unset | Developer key for Evidence API writes |
| AIPAY_CHAIN_ID | 137 | Polygon mainnet |
| AIPAY_ESCROW_ADDRESS | current V1 deployment | AiPay escrow contract |
| AIPAY_USDC_ADDRESS | Polygon USDC | USDC contract |
| AIPAY_EXPLORER_TX_URL | Polygonscan tx URL | Explorer link prefix |
License
MIT
