Skip to main content

Auto-pay MCP server for the TWZRD Trust API (Solana x402). Free preflight/lookup/receipt-verify + auto-paid trust intel with spend caps. Payment path mainnet-proven via the official x402 SDK.

Project description

twzrd-mcp-server - auto-pay MCP for the TWZRD Trust API

Payment mechanism is mainnet-verified via the official x402 SDK (Python path, $0.001 moved 2026-06-26 - see Status). The bundled TypeScript path stays fail-closed until its hand-rolled header is replaced with the x402 JS SDK.

Auto-pay MCP server for TWZRD's Trust API, matching the competitor GTM shape (anchor-x402, Br0ski777, BitBooth all ship one). An agent adds one mcpServers entry; paid tool calls auto-handle the x402 challenge. Free tools never pay.

Why this is a corrected rebuild

A first draft signed EIP-3009 on Base (EVM/viem). TWZRD settles x402 on Solana (scheme:"exact", USDC, sponsored feePayer) — the EVM scheme never matches the challenge, so that draft could not pay TWZRD at all (it would tsc-pass yet fail every real call). This version is Solana-native and refuses any non-Solana challenge instead of mis-signing.

Safety guardrails (enforced before any signature)

  • Per-call cap TWZRD_MAX_USDC_PER_CALL (default 0.05)
  • Cumulative session cap TWZRD_MAX_USDC_TOTAL (default 1.00)
  • Free discovery tools never enter the payment path
  • No cross-chain fallback — a non-exact/non-solana: challenge is rejected
  • Paid calls run the free preflight first; decision=block aborts the pay

Status — payment path VERIFIED on mainnet 2026-06-26

Two authorized settles from dev wallet 2pHjZLqs…:

  1. Hand-rolled X-Payment (this MCP's original approach): FAILED — HTTP 402, no USDC moved. The intel host validates via the official x402 lib's PaymentPayload, so a hand-built header is rejected. (Green tsc ≠ settles — fail-closed default was correct.)
  2. Official x402 SDK: SUCCEEDEDGET /v1/intel/quick/CqtQPaAuQ5UR…HTTP 200, "paid":true,"charged_amount_usdc":0.001, tier Silver score 53.6. USDC balance moved 0.057236 → 0.056236 (exactly $0.001). A second call against a no-data pubkey returned 422 charged:false — the server's no-charge-on-empty guard works.

Conclusion: auto-pay works ONLY via the official x402 SDK, not a hand-rolled header. Proven client wiring (Python):

from x402.client import x402ClientSync
from x402.mechanisms.svm.signers import KeypairSigner
from x402.mechanisms.svm.exact import register_exact_svm_client
from x402.http.clients.requests import x402_requests
client = x402ClientSync()
register_exact_svm_client(client, KeypairSigner(keypair), rpc_url=RPC)
session = x402_requests(client)
session.get("https://intel.twzrd.xyz/v1/intel/quick/<wallet>")  # auto-pays $0.001

Remaining work for THIS (TypeScript) MCP

Replace the hand-rolled payAndRetry with the x402 JS SDK (SVM support) so the TS path matches the verified Python path. Note the x402 lib also ships an MCP module (x402.mcp) — a thin Python MCP over the proven client is the fastest route to a shippable auto-pay server. Keep the spend caps + preflight gate + free/paid split. Until the TS path is re-tested with the SDK it stays fail-closed; the payment mechanism itself is now proven.

Install & Config

Python (recommended — the mainnet-proven path)

pip install twzrd-mcp

MCP client config (mcpServers):

{ "mcpServers": { "twzrd": {
  "command": "twzrd-mcp",
  "env": {
    "TWZRD_RPC_URL": "<your Solana RPC url>",
    "TWZRD_WALLET_KEYPAIR": "/path/to/solana-keypair.json",
    "TWZRD_MCP_PAYMENTS_ENABLED": "1",
    "TWZRD_MAX_USDC_PER_CALL": "0.05",
    "TWZRD_MAX_USDC_TOTAL": "1.00"
  }
}}}

The free tools (preflight, wallet_lookup) need no wallet and no flags — leave TWZRD_MCP_PAYMENTS_ENABLED unset and they work read-only. Only the paid tools need the keypair + TWZRD_MCP_PAYMENTS_ENABLED=1.

Node (npx twzrd-mcp-server) — not yet shippable

The bundled TypeScript path is fail-closed until its hand-rolled X-Payment header is replaced with the x402 JS SDK (see Status). Use the Python package above for working auto-pay today.

Tools

  • preflight (free) — allow/warn/block + trust_score before you pay a seller you're about to transact with
  • wallet_lookup (free) — facilitators + counterparty breadth for a Solana wallet
  • verify_receipt (free) — independently verify a wallet's cNFT Receipt offline (Ed25519 vs the genesis authority 2ELSDx); no trust in any TWZRD server
  • quick_trust ($0.001, auto-pay) — quick tier + score for any wallet
  • full_trust ($0.05, auto-pay) — full trust intel + signed V6 receipt

Note: quick_trust/full_trust pay TWZRD a fixed micro-fee for intel on any wallet — they do not refuse "risky" targets (you look those up on purpose). Use preflight to vet a counterparty you're about to pay elsewhere.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twzrd_mcp-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twzrd_mcp-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file twzrd_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: twzrd_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for twzrd_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 009434679531c859cf4d81b54563ef0e1e7a52ca245b0679b3be64ef55174de8
MD5 8986801291ed8c83bb6bb40e7436f1db
BLAKE2b-256 4df6e9dae57b92ee04e119aae6cb6a6759e494db8740c927a757fc7e0e29a8a5

See more details on using hashes here.

File details

Details for the file twzrd_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: twzrd_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for twzrd_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd54527a5f60c528e32e457edb187d906a06bb86b1ba594ea4cb379ae3fd90f8
MD5 07169d950dfd871d1d0b7d97abff603e
BLAKE2b-256 6a000a8353b2f836ba92da998bdea4627f872deeb32216ee3670a2d6078d6ee5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page