The official Python SDK for Xaps: A Cognitive Circuit Breaker that protects autonomous AI agents from executing fatal smart contract errors and hallucinations.
claude mcp add xaps-sdk -- python -m xaps-sdk{
"mcpServers": {
"xaps-sdk": {
"command": "python",
"args": ["-m", "xaps-sdk"],
"env": {
"XAPS_AGENT_KEY": "<xaps_agent_key>"
}
}
}
}XAPS_AGENT_KEYMCP Servers overview
# 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**.
<!-- mcp-name: io.github.APMC1/xaps -->
---
## Install
```bash
pip install xaps-sdk
```
Or install from this repository:
```bash
pip install "xaps-sdk @ git+https://github.com/APMC1/xaps-sdk.git@v0.1.2"
```
## 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](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](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](examples/.agentrc)
---
## Configuration
| Variable | Default | Description |
|----------|---------|-------------|
| `XAPS_AGENT_KEY` | — | Agent billing key (alternative to constructor arg) |
| `XAPS_API_URL` | `https://api.xaps.network` | API base URL |
```python
# Or pass explicitly
client = 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`.
### Exceptions
| Exception | When |
|-----------|------|
| `XapsAuthError` | Invalid or missing API key (401) |
| `XapsPaymentError` | Insufficient prepaid balance (402) |
| `XapsRateLimitError` | Too many requests (429) |
| `XapsAPIError` | Other API errors |
| `XapsRejectedError` | Audit returned `REJECTED` (optional helper) |
---
## Billing
- **$0.01 USD** per successful audit, deducted from prepaid balance
- Fund your agent key at [xaps.network](https://xaps.network)
---
## Development
```bash
git clone https://github.com/APMC1/xaps-sdk.git
cd xaps-sdk
pip 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](LICENSE).What people ask about xaps-sdk
What is APMC1/xaps-sdk?
+
APMC1/xaps-sdk is mcp servers for the Claude AI ecosystem. The official Python SDK for Xaps: A Cognitive Circuit Breaker that protects autonomous AI agents from executing fatal smart contract errors and hallucinations. It has 2 GitHub stars and was last updated today.
How do I install xaps-sdk?
+
You can install xaps-sdk by cloning the repository (https://github.com/APMC1/xaps-sdk) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is APMC1/xaps-sdk safe to use?
+
APMC1/xaps-sdk has not been audited yet by our security agent. Review the original repository on GitHub before using it in production.
Who maintains APMC1/xaps-sdk?
+
APMC1/xaps-sdk is maintained by APMC1. The last recorded GitHub activity is from today, with 0 open issues.
Are there alternatives to xaps-sdk?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy xaps-sdk to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/apmc1-xaps-sdk)<a href="https://claudewave.com/repo/apmc1-xaps-sdk"><img src="https://claudewave.com/api/badge/apmc1-xaps-sdk" alt="Featured on ClaudeWave: APMC1/xaps-sdk" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。