A2apay

io.github.groundhogday2011-bytev0.1.0更新於 Oct 8, 2026

Pay-per-call AI query and versioned task memory for agents. No account, no API key, via x402.

已驗證STDIO僅桌面AI & MLKnowledge & Memory

概覽

AI 產生的概覽

讓助理呼叫付費 AI 查詢服務並儲存帶版本的工作檢查點,附帶少量每日免費額度。

功能
以 MCP 工具形式提供 ask 和 remember。ask 會回傳 a2apay 服務產生的 AI 回答;remember 儲存帶可選標籤的扁平文字鍵值記錄。底層用戶端還支援 checkpoint 和 resume,用於帶版本、依工作區分的狀態,但 MCP 伺服器只暴露 ask 和 remember,而且 remember 只寫不可讀,沒有回讀工具。
適用情境
適合在助理需要偶爾取得 AI 回答或簡單依工作儲存文字、又不想註冊帳號或申請 API 金鑰,且每日免費額度夠用時使用。若需要透過 MCP 讀回已存內容,或需要真正的文件資料庫,則不太適用。
執行需求
以本機 Python 程序執行(pip install a2apay-io[mcp],然後 python mcp_server.py)。免費額度不需要錢包或憑證。超出免費額度後需設定環境變數 A2APAY_PRIVATE_KEY,填入 Base 主網錢包私鑰並持有少量 USDC,同時安裝付費附加依賴 eth-account。需要連線至 a2apay 服務的網路。
安裝前請注意
付費呼叫會從 A2APAY_PRIVATE_KEY 對應的錢包在 Base 主網花費真實 USDC;README 稱該私鑰僅在本機用於簽署付款授權、不會傳送到任何地方,但它仍是錢包私鑰,應視為高度敏感資訊。呼叫會把查詢內容與儲存值傳送給第三方服務。remember 會寫入資料且沒有回讀工具,因此無法透過 MCP 取回已存記錄。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

a2apay

Python client for a2apay.io — pay-per-call AI answers and persistent memory for autonomous agents. No account, no API key.

bash
pip install a2apay-io          # free-tier onlypip install "a2apay-io[paid]"  # adds real payment support (eth-account)

(The PyPI distribution is named a2apay-io — an unrelated package already holds the bare a2apay name. The importable module is still a2apay.)

Quick start (free tier, zero setup)

Every call tries the free tier first automatically — 5 requests/day per caller, no wallet needed:

python
from a2apay import Agent
agent = Agent()answer = agent.ask("What's 7 times 8?")print(answer)
agent.remember("last_task", "processed invoice #4471", tags=["billing"])

With real payment (once the free tier is used up)

python
from a2apay import Agent
agent = Agent(private_key="0x...")  # or set A2APAY_PRIVATE_KEYanswer = agent.ask("What's 7 times 8?")

The wallet needs a small USDC balance on Base mainnet ($0.028/call). The private key is used only to sign a payment authorization locally — it is never sent anywhere.

Checkpoint / resume (task memory)

Write versioned, task-scoped state and read it back later — even from a different process. Each checkpoint() to the same key adds a new version rather than overwriting, and resume() always returns the latest.

python
from a2apay import Agent
agent = Agent(private_key="0x...")agent.checkpoint("invoice-batch-7", key="status", value="processed rows 1-400")
# ...process dies, or a second process picks up later...
agent2 = Agent(private_key="0x...")  # same walletrecords = agent2.resume("invoice-batch-7")print(records[0]["value"])  # "processed rows 1-400"

resume() always requires payment ($0.014/call) — there's no free tier for reads yet, so it needs a configured wallet even for your first call. checkpoint() follows the same free-tier-then-paid behavior as remember().

What this honestly does and doesn't do

  • ask() returns a real AI-generated answer.
  • remember() stores a flat key/value record with optional tags — this is simple text storage, not a document database. Values are stored as text.
  • Falls back to a real payment only when the free tier returns a 402; if no private_key is configured at that point, it raises a clear A2ApayError rather than failing silently.
  • Payment signing uses eth-account (maintained by the Ethereum Foundation ecosystem), implementing the real x402 "exact" EVM scheme per the x402 protocol spec.

MCP server

An MCP server (mcp_server.py) exposes ask and remember as MCP tools for any MCP-aware agent or framework (Claude Desktop, etc.):

bash
pip install "a2apay-io[mcp]"python mcp_server.py

Add to an MCP client config:

json
{  "mcpServers": {    "a2apay": {      "command": "python",      "args": ["/absolute/path/to/mcp_server.py"],      "env": {"A2APAY_PRIVATE_KEY": "0x..."}    }  }}

Honest scope note: remember is write-only — there's no memory read-back tool because the live API doesn't have a read-back route yet.

Full API reference

See a2apay.io/openapi.yaml for the underlying HTTP API this wraps.

來源:README.md,提交 685aa4c

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v0.1.0最新Oct 8, 2026