Provides an economic security layer for autonomous agents to audit smart contract executions and financial actions before they occur.
Also known as APMC1/xaps-sdk, xaps-sdk
- Stars
- 2
- Tools
- —
- Downloads, 30 days
- 190
- Latest version
- 0.1.2
- Last commit
- Sep 17, 2026
- License
- MIT
What is Xaps MCP?
Xaps provides an economic security layer for autonomous agents to audit smart contract executions and financial actions before they occur.
Summary generated from the project's README
About Xaps MCP server
XAPS MCP Server acts as an economic security layer designed for autonomous AI agents. It provides a dual-agent audit mechanism to verify the intent and logic behind smart contract executions, transfers, or other financial actions before they are finalized. This differs from standard Web3 tools that only check signatures by ensuring the underlying logic of a transaction is safe.
Developers can integrate this server into MCP hosts like Claude Desktop or Cursor by installing the xaps-sdk and configuring the xaps-mcp command. The setup requires a XAPS_AGENT_KEY provided via environment variables to handle billing. The server offers tools such as xaps_audit to check specific contract addresses and amounts, as well as advanced functions like xaps_audit_then_query which combines auditing with structured data retrieval from sinks like GitHub or HTTP sources.
What you can do with it
- 1Audit smart contract transactionsAn AI agent can verify the safety of a contract interaction before sending funds.
- 2Prevent unauthorized financial actionsThe system can stop an agent from proceeding if an audit returns a rejected status.
- 3Combine auditing with data retrievalA developer can instruct an agent to perform a security audit and then immediately query structured data from a repository.
Written from the project's README. Every use case is checked against a quote from it.
How to install Xaps MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Xaps MCP in Claude Code
$ claude mcp add --env 'XAPS_AGENT_KEY=<YOUR_XAPS_AGENT_KEY>' xaps-sdk -- uvx xaps-sdkInstall Xaps MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"xaps-sdk": {
"command": "uvx",
"args": [
"xaps-sdk"
],
"env": {
"XAPS_AGENT_KEY": "<YOUR_XAPS_AGENT_KEY>"
}
}
}
}Install Xaps MCP in VS Code
.vscode/mcp.json
{
"servers": {
"xaps-sdk": {
"type": "stdio",
"command": "uvx",
"args": [
"xaps-sdk"
],
"env": {
"XAPS_AGENT_KEY": "<YOUR_XAPS_AGENT_KEY>"
}
}
}
}Install Xaps MCP in VS Code CLI
$ code --add-mcp '{"name":"xaps-sdk","type":"stdio","command":"uvx","args":["xaps-sdk"],"env":{"XAPS_AGENT_KEY":"<YOUR_XAPS_AGENT_KEY>"}}'Install Xaps MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"xaps-sdk": {
"command": "uvx",
"args": [
"xaps-sdk"
],
"env": {
"XAPS_AGENT_KEY": "<YOUR_XAPS_AGENT_KEY>"
}
}
}
}Install Xaps MCP in Codex
$ codex mcp add xaps-sdk --env 'XAPS_AGENT_KEY=<YOUR_XAPS_AGENT_KEY>' -- uvx xaps-sdkInstall Xaps MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.xaps-sdk] command = "uvx" args = ["xaps-sdk"] [mcp_servers.xaps-sdk.env] XAPS_AGENT_KEY = "<YOUR_XAPS_AGENT_KEY>"
Install Xaps MCP in Gemini CLI
$ gemini mcp add -s user -e 'XAPS_AGENT_KEY=<YOUR_XAPS_AGENT_KEY>' xaps-sdk uvx -- xaps-sdkInstall Xaps MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"xaps-sdk": {
"command": "uvx",
"args": [
"xaps-sdk"
],
"env": {
"XAPS_AGENT_KEY": "<YOUR_XAPS_AGENT_KEY>"
}
}
}
}Configuration
XAPS_AGENT_KEYRequiredSecretAgent billing key for the XAPS Tollbooth API
XAPS_API_URLXAPS API base URL
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachableapmc1/xaps-sdk is public and reachablegithub.com/apmc1/xaps-sdk ↗Pass
- Package names this repository as its sourcexaps-sdk names apmc1/xaps-sdk as sourcepypi.org/project/xaps-sdk/ ↗Pass
- Build provenance (Sigstore attestation)No build attestation published for this releaseNot checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-09-17github.com/apmc1/xaps-sdk ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from xaps-sdkPass
- No critical advisory in the package or its dependencies8 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubXaps 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
pip install xaps-sdk
Or install from this repository:
pip install "xaps-sdk @ git+https://github.com/APMC1/xaps-sdk.git@v0.1.3"
Quick Start
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
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
-
Install (exposes the
xaps-mcpconsole command):pip install xaps-sdk -
Set your agent key in the environment (recommended — avoid storing secrets in config files):
export XAPS_AGENT_KEY="your_agent_key" -
Add to Claude Desktop config (macOS:
~/Library/Application Support/Claude/claude_desktop_config.json):{ "mcpServers": { "xaps-audit": { "command": "xaps-mcp" } } }For local dev from a git clone, use
python /path/to/xaps_mcp_server.pywithXAPS_MCP_DEV=1instead.Full example: examples/mcp_claude_desktop_config.json
-
In your agent prompt:
Before any
send_transaction,approve, ordepositcall: invokexaps_auditwithaction,contract_address, andamount.
Agent rule templates: 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 |
# 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:
{
"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.
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
| 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
Development
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.
Xaps MCP questions
How do I add Xaps MCP to Claude Code?
Run claude mcp add --env 'XAPS_AGENT_KEY=<YOUR_XAPS_AGENT_KEY>' xaps-sdk -- uvx xaps-sdk in your terminal. Add --scope user to make it available in every project.
How do I add Xaps MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How much does an audit cost?
Each successful audit costs $0.01 USD, which is deducted from your prepaid balance.
How can I use Xaps with Claude Desktop?
You can install the xaps-sdk and add the xaps-mcp command to your Claude Desktop configuration file.
Is the Xaps Agent Key a cryptographic secret?
No, the Agent Key serves as a billing identifier rather than a cryptographic secret.