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 分