monad-agent-payAgent-native secure payment system on Monad. Session-key vault + dual-layer policy engine (hard rules + AI risk) + full audit trail.Quick Start# 1. Deploy contract
cd contracts && forge build && forge script script/Deploy.s.sol --rpc-url $RPC --broadcast --private-key $KEY
# 2. Build SDK + CLI + MCP
pnpm install && pnpm build
# 3. Create agent
agent-pay create-agent --label "my-bot" --type long_lived --user me --owner-key 0x...
# 4. Make payment
agent-pay request-payment --agent-id <id> --task-id t1 --reason "API fee" \
--recipient 0x... --token 0x... --amount 1000000 --session-key 0x...For AI Agents (MCP)Add to your MCP config:{
"mcpServers": {
"monad-agent-pay": {
"command": "node",
"args": ["packages/mcp-server/dist/server.js"],
"env": { "VAULT_ADDRESS": "0x...", "MONAD_NETWORK": "monad-testnet" }
}
}
}Then any Agent can call create_agent, request_payment, get_audit_log, etc.Agent DemoThis repo includes a minimal wallet agent demo in two modes: MCP mode and skill mode.Demo ConfigCreate a local .env from .env.example and fill in your real key locally only.Important values in the current testnet setup:FACTORY_ADDRESS=0x4082E3BdCA42aee2233aF7c30bD5bF4aa59Cb66BREGISTRY_ADDRESS=0xc09Ee0F656943B3D768503cFCEA5149Bf95F0170VAULT_ADDRESS=0x0000000000000000000000000000000000000000Use the zero address for VAULT_ADDRESS when you want the demo to deploy a fresh vault through the factory.MCP DemoRead-only smoke test:pnpm demo:agent:mcpWrite-path smoke test that deploys a vault and creates a temporary agent:pnpm demo:agent:mcp:createThe MCP demo script is located at packages/mcp-server/examples/wallet-agent-demo.mjs.Expected output includes:available MCP toolscurrent user vaultswallet reputation check resultlocal agentsoptionally deployedVault, createdAgent, and sessionInfoSkill DemoThere is also a workspace skill for agent-driven testing:.github/skills/wallet-agent-demo/SKILL.mdThat skill defines a CLI-based path for testing the same wallet flow directly:pnpm build
node packages/cli/dist/index.js list-vaults --user <OWNER_ADDRESS>
node packages/cli/dist/index.js check-wallet-reputation --wallet <OWNER_ADDRESS>
node packages/cli/dist/index.js deploy-vault --owner-key <OWNER_PRIVATE_KEY>
node packages/cli/dist/index.js create-agent --label skill-demo --type temporary --user skill-user --owner-key <OWNER_PRIVATE_KEY>
node packages/cli/dist/index.js session-info --agent-id <AGENT_ID>Local NoteOn machines where better-sqlite3 native bindings are unavailable, the SDK now falls back to in-memory storage automatically. That is enough for demos and smoke tests, but it is not persistent storage.SecurityVault pattern — funds stay in contract, session keys are just authorized signersDual-layer policy: deterministic hard rules + AI behavioral analysisAI can only restrict permissions, never expand themEmergency pause stops everything instantlyFull structured audit trail for every payment attemptLicenseMIT