XAPS MCP Server

io.github.APMC1由 GitHub 帳號 APMC1 發布v0.1.2更新於 Nov 10, 2026

Pre-execution audit for autonomous agents. Independent receipt before irreversible actions.

概覽

AI 產生的概覽

XAPS MCP 伺服器讓助理在執行高風險金融或智慧合約操作前,先取得獨立的雙代理稽核與回執。

可以做什麼
  • 提交操作、合約地址與金額進行執行前稽核,回傳 APPROVED 或 REJECTED 結論、理由及剩餘餘額
  • 為以 asyncio 執行的代理提供非同步稽核
  • 一次呼叫完成稽核後向受補助的 Sink 查詢結構化的 GitHub 或 HTTP 資料
  • 以既有回執直接查詢 Sink,並檢查 Sink 健康狀態
適用情境
當自主代理即將送出交易、授權代幣、存入資金或其他不可逆的金融操作,並希望在執行前對意圖與邏輯做獨立查核時使用。
執行需求
以本機程序方式執行,從 PyPI 套件 xaps-sdk 安裝,提供 xaps-mcp 指令;需要 Python 環境,以及透過環境變數 XAPS_AGENT_KEY 提供的預付代理計費金鑰;可用 XAPS_API_URL 覆寫 API 基礎位址;需要連線至 XAPS API 的網路存取。
安裝前請注意
每次成功稽核收費 0.01 美元,從預付餘額扣除,因此金鑰需先儲值且呼叫會花錢;代理金鑰是計費識別碼,不應提交到版本控制;稽核請求會把合約地址、金額等操作細節送到 XAPS API,Sink 查詢則送往另一個 oracle 端點。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

Xaps SDK

The Cognitive Circuit Breaker for Autonomous Agents

Xaps is an economic security layer for autonomous AI agents. Before executing a smart contract, transfer, or financial action, your agent calls Xaps for an independent dual-agent audit. Standard Web3 tools verify signatures — Xaps verifies intent and logic.


Install

bash
pip install xaps-sdk

Or install from this repository:

bash
pip install "xaps-sdk @ git+https://github.com/APMC1/[email protected]"

Quick Start

python
from xaps import XapsClient, XapsRejectedError
client = XapsClient(api_key="your_agent_key")
receipt = client.audit(    action="execute_smart_contract",    contract_address="0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",    amount=1000.0,)
audit = receipt["audit"]if audit["status"] == "REJECTED":    raise XapsRejectedError(audit["beta_attack"], receipt=receipt)
print(f"Approved: {audit['alpha_defense']}")print(f"Balance remaining: ${receipt['remaining_balance']:.2f}")

Async

python
from xaps import XapsClient
async with XapsClient(api_key="your_agent_key") as client:    receipt = await client.audit_async(        action="execute_smart_contract",        contract_address="0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",        amount=1000.0,    )

MCP Integration

Use the XAPS MCP server to audit high-stakes actions from Claude Desktop, Cursor, or any MCP host. See docs/mcp-host-integration.md for full setup.

Start Using xaps_audit in 60 Seconds

  1. Install (exposes the xaps-mcp console command):

    bash
    pip install xaps-sdk
  2. Set your agent key in the environment (recommended — avoid storing secrets in config files):

    bash
    export XAPS_AGENT_KEY="your_agent_key"
  3. Add to Claude Desktop config (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

    json
    {  "mcpServers": {    "xaps-audit": {      "command": "xaps-mcp"    }  }}

    For local dev from a git clone, use python /path/to/xaps_mcp_server.py with XAPS_MCP_DEV=1 instead.

    Full example: examples/mcp_claude_desktop_config.json

  4. In your agent prompt:

    Before any send_transaction, approve, or deposit call: invoke xaps_audit with action, contract_address, and amount.

Agent rule templates: examples/.agentrc


Configuration

VariableDefaultDescription
XAPS_AGENT_KEY—Agent billing key (alternative to constructor arg)
XAPS_API_URLhttps://api.xaps.networkAPI base URL
python
# Or pass explicitlyclient = XapsClient(api_key="...", base_url="https://api.xaps.network")

API Reference

XapsClient(api_key=None, base_url=..., timeout=10.0)

Create a client. Raises ValueError if no API key is provided.

client.audit(action, contract_address, amount, payload_override=None)

Synchronous audit. Returns receipt dict:

json
{  "xaps_receipt": true,  "agent_key": "...",  "remaining_balance": 9.99,  "audit": {    "status": "APPROVED",    "alpha_defense": "...",    "beta_attack": "..."  }}

await client.audit_async(...)

Async variant for agents running on asyncio.

Sink adoption magnet — audit_then_query / query_sink

After a Tollbooth receipt, agents can call the subsidized Sink for real structured data (GitHub / HTTP). That is the integration carrot: rails → utility.

python
from xaps import XapsClient
with XapsClient() as client:    # One shot: fast/swarm audit for query_oracle, then sink    result = client.audit_then_query(        "github repo anthropics/anthropic-sdk-python",        oracle_url="http://localhost:8766",  # or XAPS_ORACLE_URL    )    print(result["sink"]["data"])
    # Or reuse an existing receipt    receipt = client.audit_auto("query_oracle", "", 0.01)    data = client.query_sink("search github MCP agents", receipt)

Env: XAPS_ORACLE_URL (sink base), XAPS_API_URL + XAPS_AGENT_KEY (tollbooth).

MCP: xaps_audit_then_query, xaps_sink_query, xaps_sink_health.

Exceptions

ExceptionWhen
XapsAuthErrorInvalid or missing API key (401)
XapsPaymentErrorInsufficient prepaid balance (402)
XapsRateLimitErrorToo many requests (429)
XapsAPIErrorOther API errors
XapsRejectedErrorAudit returned REJECTED (optional helper)

Billing

  • $0.01 USD per successful audit, deducted from prepaid balance
  • Fund your agent key at xaps.network

Development

bash
git clone https://github.com/APMC1/xaps-sdk.gitcd xaps-sdkpip install -e ".[dev]"pytest

The sovereign node (xap-sovereign-node) is private. This public repo contains only the SDK.


Security

Your Xaps Agent Key is a billing identifier, not a cryptographic secret. Do not commit it to version control.

License

MIT — see LICENSE.

來源:README.md,提交 79cc3b2

工具

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

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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