Ap2 Iso20022

io.github.sebastienrousseau由 GitHub 帳號 sebastienrousseau 發布v0.0.7更新於 Oct 24, 2026

Bridge AP2 / x402 agent-payment mandates into wire-valid ISO 20022 pain.001 / pacs.008 records.

已驗證STDIO僅桌面金融開發者工具

概覽

AI 產生的概覽

將 AP2 與 x402 代理支付授權轉換為 ISO 20022 pain.001 / pacs.008 記錄,並提供檢核護欄,支援 stdio 或 HTTP 傳輸。

可以做什麼
  • 把 AP2 與 x402 支付載荷正規化為標準授權物件
  • 檢查授權的必填欄位、消費上限、有效期限與授權證明
  • 將標準授權轉換為 pain.001 客戶貸記轉帳或 pacs.008 金融機構間記錄
  • 輸出欄位名稱與型別與 pain001、pacs008 產生器一致,可直接用於產生 XML
適用情境
當助理處理 AP2 或 x402 代理支付,需要把支付授權轉成銀行通道的 ISO 20022 訊息,或在執行前檢核授權是否合規時使用。它只做轉換與檢核,不產生也不送出實際付款。
執行需求
需要本機 Python 3.10 以上執行環境,從 PyPI 安裝 ap2-iso20022 或以 uvx 直接執行。MCP 伺服器預設走 stdio,也可用 streamable HTTP 或 SSE 在 127.0.0.1:8000 上執行,並可指定 host 與 port。未宣告任何帳號、API 金鑰或環境變數。
安裝前請注意
HTTP 傳輸本身不帶驗證,應只綁定回環位址,或置於可信任的閘道之後。授權載荷包含付款方與收款方帳戶資訊及簽章,會傳給本機程序。伺服器本身不轉移資金,但其輸出會用於產生支付訊息,轉換結果應謹慎看待。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Ap2 Iso20022,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

ap2-iso20022: Agent-payment mandates → wire-valid ISO 20022

[Glama MCP server score]

Bridge AP2 (Google's Agent Payments Protocol) and x402 (Coinbase's HTTP-402) mandates into ISO 20022 pain.001 / pacs.008 records — with spending-cap, expiry and authorisation guardrails, and an MCP server. These agentic-payment protocols authorise a payment; this library turns that authorisation into the bank-rail message that actually settles it — the rail the card networks and stablecoins don't cover.

Latest release: v0.0.7: 11 MCP tools over stdio, streamable HTTP or SSE, pure-Python (only mcp), 100% branch coverage, for Python 3.10+. Output feeds straight into pain001 / pacs008 to generate wire-valid XML. Part of the ISO 20022 MCP suite.

[ap2-iso20022 Demo]


Why

An agent with a signed AP2 mandate (or an x402 payment authorisation) can prove it's allowed to pay — but nothing in those protocols emits the pain.001 a bank needs to move the money. ap2-iso20022 is that missing hop. And because moving money is consequential, it only transforms and validates — producing the ISO record is deliberately separate from generating and sending it, so the actual payment stays an explicit, guarded step.

Install

sh
pip install ap2-iso20022# or run the MCP server without installing:uvx --from ap2-iso20022 ap2-iso20022-mcp

MCP client config (e.g. Claude Desktop):

json
{  "mcpServers": {    "ap2-iso20022": {      "command": "ap2-iso20022-mcp"    }  }}

Transports

One command line, three transports:

CommandTransportEndpointProtocol revisions
ap2-iso20022-mcpstdiothe client spawns the process2026-07-28, 2025-11-25
ap2-iso20022-mcp --transport streamable-httpStreamable HTTPhttp://127.0.0.1:8000/mcp2026-07-28 (stateless, server/discover) and 2025-11-25 (initialize, Mcp-Session-Id) on the same endpoint; responses stream as server-sent events, GET opens the server-to-client stream
ap2-iso20022-mcp --transport sseHTTP+SSE (2024-11-05)http://127.0.0.1:8000/sse and /messages/for clients that still expect the older transport

--host and --port change the bind address (defaults 127.0.0.1 and 8000). The HTTP transports carry no authentication of their own: bind loopback, or put the server behind a gateway you trust before binding a routable address. Every release is verified over streamable HTTP with scout in both protocol eras and over SSE with the MCP SDK client; see ADR 0001.

json
{  "mcpServers": {    "ap2-iso20022": { "url": "http://127.0.0.1:8000/mcp" }  }}

Flow: normalise → guardrail → convert

python
from ap2_iso20022 import bridge
# 1. Normalise the protocol payload into a canonical mandate.mandate = bridge.from_ap2({    "intent_id": "AP2-CoffeeRun-7",    "payer": "Alice's Shopping Agent",    "payer_account": "DE89370400440532013000",    "merchant_name": "Blue Bottle Coffee",    "payee_account": "GB29NWBK60161331926819",    "amount": "12.50", "currency": "EUR", "memo": "oat latte",    "spending_limit": "50.00",    "signature": "eyJ...", "signature_type": "jws",})
# 2. Guardrail before it becomes a payment.check = bridge.check_mandate(mandate, as_of="2026-03-02T09:00:00")assert check["ok"]          # required fields ok, within cap, not expired, signed
# 3. Convert to a pain.001 record that feeds pain001 -> wire-valid XML.record = bridge.to_pain001(mandate)   # exact pain001 field names + JSON number amounts

Tools

  • normalize_ap2 — AP2 mandate payload → canonical mandate.
  • normalize_x402 — x402 payment payload → canonical mandate.
  • check_mandate — Guardrail: required fields, spending cap, expiry (with as_of), authorisation proof.
  • to_pain001 — Canonical mandate → pain.001 record (customer credit transfer).
  • to_pacs008 — Canonical mandate → pacs.008 record (FI-to-FI).

The output field names and types match what pain001 / pacs008 expect (validated against their JSON schemas), so to_pain001(mandate) → pain001 generate_message → XSD-valid pain.001 with no glue.

Guardrails

check_mandate returns {ok, violations, warnings}:

  • required fields — payer/payee name + account, amount, currency
  • spending cap — amount <= max_amount when a cap is present
  • expiry — refuses an expired mandate when you pass as_of
  • authorisation proof — warns when no proof_type/proof_value is present

It never moves money; it tells you whether the mandate is safe to act on.

The suite

Part of a family of vendor-neutral, Python-native ISO 20022 MCP servers:

Development

sh
git clone https://github.com/sebastienrousseau/ap2-iso20022cd ap2-iso20022python -m venv .venv && . .venv/bin/activatepip install -e . && pip install pytest pytest-cov ruff black mypypytest                      # 100% branch coverage gateruff check ap2_iso20022 tests && black --check ap2_iso20022 tests && mypy ap2_iso20022

License

Licensed under the Apache License, Version 2.0 (LICENSE).


mcp-name: io.github.sebastienrousseau/ap2-iso20022

來源:README.md,提交 9fe3b15

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

3
  1. v0.0.7最新Oct 4, 2026
  2. v0.0.6Oct 4, 2026
  3. v0.0.5Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分