Labsco
0rkz logo

byte-mcp-server

โ˜… 1

from 0rkz

Per-byte USDC data feeds + oracles for AI agents on Arbitrum. 14 tools, EIP-712 attested payloads, no API keys, no token. MCP server for the BYTE Library catalog (18+ first-party publishers).

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedPaid serviceNeeds API keys

PayPerByte MCP Server

smithery badge 0rkz/byte-mcp-server MCP server

A Model Context Protocol server that gives AI agents direct access to PayPerByte โ€” verified, provenance-first data feeds for AI agents. Agents discover feeds, pay-per-call via x402 (settled in USDC on Base mainnet), or subscribe to on-chain streams (Arbitrum Sepolia testnet). Every paid x402 response carries an EIP-712 PayloadAttestation receipt (X-BYTE-Attestation header) the agent verifies before acting. No tokens, no API keys, no off-chain accounts.

Two rails โ€” read this before setting PRIVATE_KEY.

  • x402 pay-per-call (byte_buy_data): Base mainnet (eip155:8453), REAL USDC. Paid feeds settle real money โ€” the flagship Address Reputation Oracle is $0.05 per verdict. Use a dedicated wallet holding only what you intend to spend.
  • On-chain subscribe/publish/query layer (BYTE Library contracts + indexer): Arbitrum Sepolia testnet (chain 421614), MockUSDC. Mainnet for this layer is gated on an external security audit. The EIP-712 attestation signing domain stays anchored at 421614 regardless of which rail you paid on.

One PRIVATE_KEY serves both rails. Never reuse a key holding funds you can't afford to spend.

Verify before acting (ForeSeal)

See the whole verify-before-act loop in one command โ€” no install, no signup, no wallet:

npx @foreseal/demo

It runs locally (no real USDC) and shows an agent ACT on genuine bytes and REFUSE four attacks โ€” a tampered byte, a forged signature, a missing receipt, a forked signing domain โ€” in about a second.

The same primitive ships as two packages you can drop into your own stack:

  • Kit โ€” @payperbyte/sdk: the buyer verifies a receipt before acting.
  • Gate โ€” @foreseal/gate: a seller stamps a verifiable receipt on any x402 endpoint.

Two paradigms: subscribe vs. buy

ModeToolRailBest forPricing
Buy (x402)byte_buy_dataBase mainnet โ€” real USDCOne-off needs (single snapshot or verdict for this user query)Per-feed, quoted in the 402 challenge ($0.05 flagship; most feeds cents or less)
Subscribebyte_subscribeArbitrum Sepolia โ€” testnet MockUSDCContinuous streams (every weather update, every new earthquake)$0.003 / KB per delivery

Buy is zero-setup, pay-as-you-go, and live with real settlement; subscribe delivers every broadcast on the audit-gated testnet layer. Pick by access pattern.

Tools (15 total)

Discovery (read-only, no wallet)

ToolDescription
byte_search_publishersSearch publishers by topic and sort order
byte_list_feedsList the active feed catalog with prices and frequencies
byte_get_publisherOn-chain info for one publisher (status, subscribers, messages, USDC revenue, schema)
byte_get_network_statsNetwork-wide stats: publishers, messages, total fees settled
byte_check_subscriptionIs subscriber subscribed to publisher?
byte_list_my_subscriptionsAll active subscriptions for a wallet โ€” last 7d/30d messages + USDC spend
byte_subscription_healthContent-drift signal for a publisher: stable / moderate / significant / unknown
byte_get_token_balancesUSDC + ETH balances on Arbitrum Sepolia
byte_verify_payloadVerify-before-act. Recompute keccak256 of the bytes your agent received and check them against the publisher's on-chain EIP-712 PayloadAttestation โ€” anchor with an expectedHash you hold or the settlement txHash (which also recovers the signer and confirms it's the named publisher). If verified: false, the data was tampered/corrupted in transit โ€” don't act on it

Subscribe to a stream (requires PRIVATE_KEY)

ToolDescription
byte_subscribeSubscribe to a publisher's stream. Auto-bundles USDC approve(max) unless skipAllowance: true (closes a silent-payment-failure footgun where the contract's allowance-skip path delivered data with amount=0)
byte_unsubscribeUnsubscribe โ€” takes effect next block
byte_register_publisherRegister as a data publisher (schema + on-chain registration). v1 is first-party only; stake = 0
byte_publish_dataPublish a payload to a subscriber via DataStream (settles fee in USDC). See migration notice above re: r2

Buy on-demand (requires PRIVATE_KEY)

ToolDescription
byte_buy_dataBuy one packet from any feed via the x402 gateway โ€” real USDC on Base mainnet. No subscription, no allowance. Signs EIP-3009 transferWithAuthorization against the 402 challenge; the facilitator settles on-chain. Returns the data + tx hash inline
byte_query_factAsk a slashable fact-oracle publisher a question. Signed EIP-712 request (binds query to your wallet so leaked queries can't burn your escrow); the answer is broadcast on-chain to your address with citations

Network

Two rails, honestly stated:

  • x402 payment rail (byte_buy_data): Base mainnet (eip155:8453). Paid feeds settle real USDC through the gateway at x402.payperbyte.io; each paid 200 returns an X-BYTE-Attestation EIP-712 receipt over the exact response bytes.
  • On-chain layer (subscriptions, broadcasts, fact-oracle escrow, indexer): Arbitrum Sepolia (chain 421614). Mainnet for the BYTE Library contracts is gated on an external security audit. The EIP-712 PayloadAttestation signing domain is anchored on 421614 regardless of the payment rail.

Contract addresses are pinned in the bundled config; the npm release ships ready-to-use defaults. No token.

Development

git clone https://github.com/0rkz/byte-mcp-server.git
cd byte-mcp-server
npm install
npm run build && npm start