A

Agentpay Vn

phuocdu
๐Ÿ’ฐ Finance & Fintech
0 Views
0 Installs

๐Ÿ โ˜๏ธ - VietQR payments for AI agents in Vietnam. Agents generate a VietQR code, send it to the user, and auto-confirm settlement from the bank feed. Non-custodial โ€” money flows directly to the merchant's bank account, never held by the platform. pip install agentpay-vn, ships an MCP server for Claude Desktop/Code.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "phuocdu-agentpay-vn": {
      "command": "npx",
      "args": [
        "-y",
        "phuocdu-agentpay-vn"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

AgentPay VN

PyPI version License: MIT MCP Registry phuocdu/agentpay-vn MCP server

VietQR payment infrastructure for AI agents โ€” collect money inside any conversation.

AgentPay VN lets AI agents (Claude, GPT, custom bots) generate payment QR codes, send them to users, and automatically confirm when the money arrives โ€” all without ever holding or touching funds. Money flows directly from the payer's bank account into the merchant's account; AgentPay only reads the bank transaction feed to confirm settlement.

Status: Early access / self-hosted โ€” running on the same swarm as Sแป• Nแปฃ AI.


How it works

AI Agent                   AgentPay API              Bank feed (SePay)
   |                            |                           |
   |-- create_payment_request ->|                           |
   |<- { qr_image_url, id } ----|                           |
   |                            |                           |
   |-- send QR to user -------->|                           |
   |                            |      user scans & pays    |
   |                            |<-- webhook (bank txn) ----|
   |                            |-- match AP* pay_code      |
   |                            |-- status โ†’ settled        |
   |<-- await_settlement done --|                           |
   |                            |                           |
   |-- deliver order / unlock ->|                           |
  1. Create โ€” agent calls POST /v1/payment-requests โ†’ gets a VietQR image URL and a checkout page.
  2. Send โ€” agent embeds the QR image or sends the checkout link to the user in chat.
  3. Await โ€” agent calls await_settlement() (or the MCP tool) to poll until status = settled.
  4. Deliver โ€” only after confirmed settlement does the agent release the goods/service.

AgentPay never holds money. The QR points directly at the merchant's bank account number. The platform only monitors the bank transaction feed to detect matching transfers.


Quick start

1. Install

pip install agentpay-vn

2. Set your API key

export AGENTPAY_API_KEY=ap_test_xxx   # sandbox key for testing

Get a key from the admin dashboard (self-hosted) or contact the platform operator.

3. Collect a payment (3 lines)

from agentpay.client import AsyncAgentPayClient, await_settlement
import asyncio

async def main():
    async with AsyncAgentPayClient("ap_test_xxx") as client:
        pr = await client.create_payment_request(amount=50_000, description="Order #1")
        print(pr["checkout_url"])          # send this link to your user
        result = await await_settlement(client, pr["id"], timeout=120)
        assert result["status"] == "settled"

asyncio.run(main())

See examples/quickstart.py for the full runnable version.


MCP server setup

AgentPay ships an MCP server so any MCP-compatible AI agent can call it as a tool โ€” no extra code needed.

Claude Desktop / Claude Code

Add to claude_desktop_config.json (or use examples/claude_desktop_config.json):

{
  "mcpServers": {
    "agentpay": {
      "command": "python",
      "args": ["-m", "agentpay.mcp_server"],
      "env": {
        "AGENTPAY_API_KEY": "ap_test_xxx",
        "AGENTPAY_BASE_URL": "https://agentpay.servicesai.vn/v1"
      }
    }
  }
}

Or use the installed console script:

{
  "mcpServers": {
    "agentpay": {
      "command": "agentpay-mcp",
      "env": { "AGENTPAY_API_KEY": "ap_live_xxx" }
    }
  }
}

Available MCP tools

ToolDescription
create_payment_requestGenerate a VietQR code for a given amount
check_paymentGet current status of a payment request
await_settlementPoll until payment arrives or timeout (max 600 s)
list_recent_paymentsList last N settled transactions

Python SDK

Synchronous

from agentpay.client import AgentPayClient

with AgentPayClient("ap_live_xxx") as client:
    # Create
    pr = client.create_payment_request(
        amount=150_000,
        description="Consulting session 30 min",
        ttl_minutes=30,
        idempotency_key="session-abc-123",
    )

    # Poll manually
    import time
    for _ in range(60):
        pr = client.get_payment_request(pr["id"])
        if pr["status"] != "pending":
            break
        time.sleep(5)

    # Reconcile
    txns = client.list_transactions(limit=10)

Asynchronous

from agentpay.client import AsyncAgentPayClient, await_settlement

async with AsyncAgentPayClient("ap_live_xxx") as client:
    pr = await client.create_payment_request(amount=75_000, description="eBook download")
    result = await await_settlement(client, pr["id"], timeout=300)
    if result["status"] == "settled":
        send_download_link(result["metadata"].get("email"))

Webhook verification

import hashlib, hmac

def verify_webhook(raw_body: bytes, signature_header: str, secret: str) -> bool:
    expected = hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature_header)

Register a webhook endpoint:

ep = client.register_webhook(
    url="https://your-server.com/webhooks/agentpay",
    events=["payment.settled", "payment.expired"],
)
print(ep["secret"])  # store this โ€” shown only once

API reference

  • OpenAPI spec: agentpay-openapi.yaml
  • Base URL: https://agentpay.servicesai.vn/v1
  • Authentication: Authorization: Bearer ap_live_xxx (or ap_test_xxx for sandbox)

Key endpoints

MethodPathDescription
POST/v1/payment-requestsCreate payment request
GET/v1/payment-requests/{id}Get status
POST/v1/payment-requests/{id}/cancelCancel pending request
GET/v1/transactionsList settled transactions
POST/v1/webhook-endpointsRegister webhook URL
POST/v1/sandbox/simulate-settlementSimulate payment (sandbox only)
GET/pay/{pay_code}Public checkout page (HTML, mobile-friendly)

Self-hosting

AgentPay runs as part of the Sแป• Nแปฃ AI FastAPI backend.

Requirements

  • Docker Swarm cluster (same as Sono)
  • MongoDB (shared with Sono)
  • SePay bank feed account (for live payments)
  • Nginx with an agentpay.servicesai.vn vhost

Environment variables

VariableDefaultDescription
AGENTPAY_BASE_URLhttps://agentpay.servicesai.vnPublic base URL for checkout links
MONGO_URImongodb://localhost:27017Inherited from Sono
BILLING_WEBHOOK_TOKENโ€”SePay webhook token (inherited)

Create an API key (admin)

curl -X POST https://sono.servicesai.vn/api/admin/agentpay/keys \
  -H "Authorization: Bearer <admin-jwt>" \
  -H "Content-Type: application/json" \
  -d '{"org_id": "<shop-user-id>", "name": "My bot", "livemode": true}'

The response includes the full key โ€” store it immediately; it is shown only once.


Rate limits

TierSettled payments/monthRequests/minute
Free50120

Design principles

  1. No money held โ€” QR codes point directly at the merchant's bank account. AgentPay only reads the transaction feed; it never touches the money.

  2. Idempotency โ€” pass an Idempotency-Key header on POST /payment-requests to safely retry without creating duplicates (24-hour deduplication window).

  3. HMAC webhook verification โ€” every outbound webhook is signed with HMAC-SHA256(whsec_..., raw_body) in the AgentPay-Signature header. Always verify before processing.

  4. Sandbox โ€” use ap_test_* keys and POST /v1/sandbox/simulate-settlement to develop and test without real transactions.

  5. Minimal trust surface โ€” the MCP server is a thin REST client with no local secrets beyond the API key. Compromising an agent key only exposes one tenant's payment-request creation ability.


License

MIT ยฉ 2026 ServicesAI โ€” see LICENSE.

Related MCP Servers

M
Mcp

๐Ÿ“‡ โ˜๏ธ - Fundraising infrastructure for AI agents on Solana โ€” campaigns, x402 donations, and on-chain reputation. MCP tools for registering agents, creating campaigns, and donating via the x402 pay-to-call flow, backed by Anchor programs (agentregistry, escrow, reputation). npx -y @agentfund/mcp

๐Ÿ’ฐ Finance & Fintech1 views
M
Mcp Server

๐Ÿ“‡ โ˜๏ธ - EUR settlement for AI agents via x402 protocol. Market data, AI tools, crypto analytics โ€” pay-per-call in USDC on Base. SEPA Instant EUR off-ramp.

๐Ÿ’ฐ Finance & Fintech1 views
C
Cnb

๐Ÿ“‡ โ˜๏ธ ๐Ÿ  ๐ŸŽ ๐ŸชŸ ๐Ÿง - Czech National Bank (ฤŒNB) daily FX rates: fetch official CZK exchange rates, convert between currencies, fetch historical rates. Cached 10 min to ease upstream load. npm @czagents/cnb or HTTP at cnb.cz-agents.dev/mcp.

๐Ÿ’ฐ Finance & Fintech1 views
M
Mcp Server

๐Ÿ“‡ โ˜๏ธ - Non-custodial on-chain escrow + AI dispute arbitration for agent-to-agent USDC payments on Base. Seven tools covering the full EscrowV1 contract surface: create escrow, mark delivered with on-chain content hash, confirm or dispute, arbiter resolves with signed verdict, cancel/escalate on timeout. npx @arbitova/mcp-server

๐Ÿ’ฐ Finance & Fintech0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

No check timestamp yet.

Unclaimed listing (imported or pending owner verification). Claim it โ†’
โ˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.