Docs
SiftMCP is one MCP server (the siftmcp CLI over stdio, or Streamable HTTP at https://siftmcp.xyz/mcp) and one HTTP gateway at https://siftmcp.xyz/v1. Both expose the same nine tools. Paid tools settle in USDG on Robinhood Chain, chain id 4663. Every response is signed with Ed25519 and with ML-DSA-65 (NIST FIPS 204).
Install
Point a client at the Streamable HTTP endpoint https://siftmcp.xyz/mcp, or install the siftmcp CLI, which this gateway serves itself. Every snippet below uses this gateway’s address. Node.js 22.12 or newer is required for the CLI.
npx -y https://siftmcp.xyz/dl/siftmcp-0.2.0.tgz --help# this gateway over Streamable HTTP: five free calls a day, then x402 quotes claude mcp add --transport http sift https://siftmcp.xyz/mcp # or the CLI, paying each quote in USDG from the agent's own wallet claude mcp add sift \ -e SIFT_API_URL=https://siftmcp.xyz \ -e SIFT_WALLET_KEY=0x<agent wallet private key> \ -- npx -y https://siftmcp.xyz/dl/siftmcp-0.2.0.tgz
Give the agent a wallet that holds only what it may spend: each payment is capped by SIFT_MAX_PAYMENT_USDG (default 0.01 USDG) and gas is paid in ETH on chain 4663. Without SIFT_API_URL the CLI runs every tool on your own machine at no charge.
CLI options: --transport stdio|http, --port, --remote https://siftmcp.xyz to forward calls to this gateway instead of running them locally, SIFT_WALLET_KEY to pay 402 quotes automatically, SIFT_MAX_PAYMENT_USDG to cap each payment, and SIFT_SESSION for a hold-gate session.
Tools and schemas
Input schemas are JSON Schema 2020-12, exactly what MCP clients receive from tools/list. Over HTTP, send the same object as the JSON body.
sift_sec_filings
POST /v1/sec/filings0.002 USDGFetch a 10-K / 10-Q / 8-K straight from SEC EDGAR and return clean Markdown for the requested sections (Item 1A Risk Factors, Item 7 MD&A, 8-K Item 2.02 + EX-99 earnings release, …) plus the list of recent filings. Raw HTML/iXBRL is reduced ~85-99%.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticker": {
"type": "string",
"minLength": 1,
"maxLength": 10,
"pattern": "^[A-Za-z][A-Za-z0-9.-]{0,9}$",
"description": "US stock ticker, e.g. NVDA, TSLA, PLTR"
},
"form": {
"default": "10-K",
"description": "Form type: 10-K, 10-Q, 8-K (amendments like 10-K/A also work)",
"type": "string",
"pattern": "^[0-9A-Z/ -]{1,12}$"
},
"sections": {
"description": "Sections to extract: risk_factors, mdna, business, legal_proceedings, results (8-K 2.02), item keys like \"1A\", \"7\", \"P2-1A\", \"2.02\", or \"*\" for all. Defaults: 10-K → 1A+7, 10-Q → MD&A + risk factors, 8-K → all items",
"maxItems": 12,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 40
}
},
"accessionNumber": {
"description": "Specific filing; defaults to the most recent filing of `form`",
"type": "string",
"pattern": "^\\d{10}-\\d{2}-\\d{6}$"
},
"maxCharsPerSection": {
"description": "Per-section character cap (default 24,000)",
"type": "integer",
"minimum": 1000,
"maximum": 400000
},
"includeExhibits": {
"description": "8-K only: also sift EX-99 press-release exhibits (default true)",
"type": "boolean"
},
"listLimit": {
"description": "How many recent filings of this form to list (default 10)",
"type": "integer",
"minimum": 0,
"maximum": 40
}
},
"required": [
"ticker"
]
}sift_sec_financials
POST /v1/sec/financials0.002 USDGStandardized quarterly metrics from SEC XBRL companyfacts: revenue, gross profit, operating income, net income, diluted EPS, operating cash flow, capex, free cash flow, cash and debt, with YoY / QoQ %. Values come from filed facts (quarters derived from YTD figures are flagged).
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticker": {
"type": "string",
"minLength": 1,
"maxLength": 10,
"pattern": "^[A-Za-z][A-Za-z0-9.-]{0,9}$",
"description": "US stock ticker, e.g. NVDA, TSLA, PLTR"
},
"quarters": {
"default": 8,
"description": "Number of most recent fiscal quarters (default 8)",
"type": "integer",
"minimum": 1,
"maximum": 12
}
},
"required": [
"ticker"
]
}sift_insider_trades
POST /v1/sec/insiders0.001 USDGParse the latest SEC Form 4 filings: who bought or sold on the open market vs option exercises, awards, tax withholding and gifts, share counts, average prices, 10b5-1 plans, and a 30-day cluster-buy signal.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticker": {
"type": "string",
"minLength": 1,
"maxLength": 10,
"pattern": "^[A-Za-z][A-Za-z0-9.-]{0,9}$",
"description": "US stock ticker, e.g. NVDA, TSLA, PLTR"
},
"limit": {
"default": 15,
"description": "Most recent Form 4 filings to parse (max 40)",
"type": "integer",
"minimum": 1,
"maximum": 40
},
"days": {
"description": "Only filings from the last N days",
"type": "integer",
"minimum": 1,
"maximum": 365
}
},
"required": [
"ticker"
]
}sift_rh_stock_parity
GET /v1/rh/parity/:ticker0.001 USDGRead the live Uniswap v3 pool prices and liquidity of a Robinhood Chain (4663) stock token, adjust for its ERC-8056 multiplier, compare with the latest US market price and session (REGULAR / PRE / POST / OVERNIGHT / CLOSED_WEEKEND / CLOSED_HOLIDAY), and report the on-chain premium/discount in % and bps.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticker": {
"type": "string",
"minLength": 1,
"maxLength": 10,
"pattern": "^[A-Za-z][A-Za-z0-9.-]{0,9}$",
"description": "Ticker of a Robinhood Chain stock token, e.g. NVDA, TSLA, SPY, QQQ"
}
},
"required": [
"ticker"
]
}sift_web_page
POST /v1/web/sift0.003 USDGFetch a public web page (static or JavaScript-rendered in an isolated, SSRF-guarded Chromium) and return readable Markdown, JSON tables and absolute links. Private and internal network targets are refused.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"url": {
"type": "string",
"maxLength": 2048,
"format": "uri",
"description": "Public http(s) URL (private/internal addresses are blocked)"
},
"render": {
"default": "auto",
"description": "auto: static first, isolated Chromium for JavaScript apps; static; browser",
"type": "string",
"enum": [
"auto",
"static",
"browser"
]
},
"maxChars": {
"description": "Markdown character cap (default 40,000)",
"type": "integer",
"minimum": 1000,
"maximum": 200000
},
"includeLinks": {
"type": "boolean"
},
"includeTables": {
"type": "boolean"
}
},
"required": [
"url"
]
}sift_filing_diff
POST /v1/sec/diff0.004 USDGCompare a section across two consecutive filings (default: latest vs previous 10-Q Risk Factors) sentence by sentence: new risk language added, guidance removed, and modified sentences with word-level inline diffs.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticker": {
"type": "string",
"minLength": 1,
"maxLength": 10,
"pattern": "^[A-Za-z][A-Za-z0-9.-]{0,9}$",
"description": "US stock ticker, e.g. NVDA, TSLA, PLTR"
},
"form": {
"default": "10-Q",
"type": "string",
"enum": [
"10-Q",
"10-K"
]
},
"section": {
"default": "risk_factors",
"description": "Section alias or key: risk_factors, mdna, 1A, 7, P2-1A …",
"type": "string",
"minLength": 1,
"maxLength": 40
},
"baseAccession": {
"description": "Older filing (default: second most recent)",
"type": "string",
"pattern": "^\\d{10}-\\d{2}-\\d{6}$"
},
"compareAccession": {
"description": "Newer filing (default: most recent)",
"type": "string",
"pattern": "^\\d{10}-\\d{2}-\\d{6}$"
},
"maxItems": {
"default": 40,
"description": "Max added/removed/modified sentences returned per list",
"type": "integer",
"minimum": 1,
"maximum": 200
}
},
"required": [
"ticker"
]
}sift_pqc_readiness
POST /v1/sec/pqc0.003 USDGScan the latest 10-K (Item 1 Business, 1A Risk Factors, 1C Cybersecurity, plus the EX-13 annual report when incorporated by reference), the latest 10-Q and recent 8-Ks on SEC EDGAR for post-quantum and quantum-computing disclosures (post-quantum, ML-KEM, ML-DSA, Kyber, Dilithium, Shor, qubits, quantum-safe, crypto-agility, harvest-now-decrypt-later). Returns verbatim excerpts with form, filing date, section and URL, and a posture classified from that evidence alone: quantum_builder, pqc_migrating, risk_acknowledged or undisclosed.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticker": {
"type": "string",
"minLength": 1,
"maxLength": 10,
"pattern": "^[A-Za-z][A-Za-z0-9.-]{0,9}$",
"description": "US stock ticker, e.g. NVDA, TSLA, PLTR"
},
"maxExcerpts": {
"default": 25,
"description": "Most verbatim excerpts to return (default 25)",
"type": "integer",
"minimum": 1,
"maximum": 60
}
},
"required": [
"ticker"
]
}sift_qday_exposure
POST /v1/chain/qday0.001 USDGCheck whether an address on Robinhood Chain (4663) has exposed its secp256k1 public key: an account with nonce 0 has only published a hash of it, while any signed transaction makes the full key recoverable (and, with a large enough quantum computer, the private key). Recovers the key from a real outgoing transaction, reports the account type (EOA, EIP-7702, contract, ERC-4337), the live USD value at stake (ETH, USDG and Robinhood stock tokens at pool or reference prices) and factual remediation.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"address": {
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$",
"description": "Address on Robinhood Chain (4663), e.g. 0xBf2D994a6B9e4b45e1463387A9adfc66A6FB2E36"
}
},
"required": [
"address"
]
}sift_verify_receipt
POST /v1/receipts/verifyfreeIndependently verify a SiftMCP receipt: the Ed25519 signature and the ML-DSA-65 (NIST FIPS 204) post-quantum signature, each with its own verdict, and optionally that the output/target hashes match the data you hold and the signers are the expected keys. Free.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"receipt": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {},
"description": "The `receipt` object (or decoded X-Sift-Receipt header) to verify"
},
"output": {
"description": "The `data` the receipt covers; when given, its sha256 must match outputHash"
},
"target": {
"description": "The request target; when given, its sha256 must match targetHash"
},
"expectedPubKey": {
"description": "Require this Ed25519 signer, e.g. signerPubKey from GET /v1/pubkey",
"type": "string",
"pattern": "^ed25519:[0-9a-f]{64}$"
},
"pqPubKey": {
"description": "ML-DSA-65 public key to check pqSignature against (pqSignerPubKey from GET /v1/pubkey). Defaults to this gateway key when pqKeyId matches",
"type": "string",
"pattern": "^ml-dsa-65:[A-Za-z0-9_-]{2600,2610}$"
},
"requirePq": {
"description": "Fail unless the ML-DSA-65 signature is present and valid",
"type": "boolean"
}
},
"required": [
"receipt"
]
}Response and receipt
Every successful call returns the same envelope. meta reports what was fetched and how much was cut; receipt signs sha256 hashes of the request (targetHash) and of data (outputHash) twice: with the gateway’s Ed25519 key and with its ML-DSA-65 key, a lattice signature standardised in NIST FIPS 204 that a quantum computer is not known to break. Both public keys are at GET /v1/pubkey.
{
"data": {
"…": "tool output"
},
"meta": {
"sourceUrl": "https://www.sec.gov/Archives/edgar/data/1045810/…/nvda-20260726.htm",
"sourceUrls": [
"…"
],
"rawBytes": 2684322,
"siftedBytes": 31801,
"rawTokensEst": 671081,
"siftedTokensEst": 7951,
"tokenSavingsPct": 98.8,
"latencyMs": 2878
},
"receipt": {
"v": 1,
"id": "rcpt_…",
"chainId": 4663,
"tool": "sift_filing_diff",
"targetHash": "sha256:…",
"outputHash": "sha256:…",
"timestamp": 1796491370,
"signerPubKey": "ed25519:…",
"signature": "0x… (64 bytes, Ed25519)",
"pqAlgorithm": "ml-dsa-65",
"pqKeyId": "16 hex: first 8 bytes of sha256(ML-DSA-65 public key)",
"pqSignature": "… (3,309 bytes, base64url, ML-DSA-65)"
}
}The signed message is the UTF-8 string sift-receipt-v1\n followed by the canonical JSON of the eight v1 fields (v, id, chainId, tool, targetHash, outputHash, timestamp, signerPubKey): object keys sorted, no whitespace, undefined fields dropped. Ed25519 and ML-DSA-65 (pure mode, empty context) sign exactly these bytes, so a verifier that only knows Ed25519 keeps working. Hashes use the same canonical JSON.
The PQ fields sit outside the Ed25519 signature, so a middleman could strip them and leave a valid Ed25519-only receipt. If you want the post-quantum guarantee, pin the ML-DSA-65 key and require its signature (requirePq: true on the verify tool). The X-Sift-Receipt header carries only pqKeyId and pqSigHash; the signature itself is in the body.
{
"signerPubKey": "ed25519:<64 hex>",
"algorithm": "ed25519",
"domain": "sift-receipt-v1",
"pqAlgorithm": "ml-dsa-65",
"pqStandard": "NIST FIPS 204",
"pqKeyId": "<16 hex>",
"pqSignerPubKey": "ml-dsa-65:<1,952 bytes, base64url>",
"pqPublicKeyBytes": 1952,
"pqSignatureBytes": 3309
}Verify a receipt
Paste a response here to check both signatures twice: in your browser with @noble/ed25519 and @noble/post-quantum, and by the free verify tool on this gateway. Both pin the keys to GET /v1/pubkey and report Ed25519 and ML-DSA-65 separately.
The same check in your own code:
import * as ed from '@noble/ed25519';
import { ml_dsa65 } from '@noble/post-quantum/ml-dsa.js';
import { sha256 } from '@noble/hashes/sha2.js';
import { bytesToHex, hexToBytes, utf8ToBytes } from '@noble/hashes/utils.js';
// Sorted keys, no whitespace, undefined dropped: the same bytes the gateway hashed.
function canonical(v: unknown): string {
if (Array.isArray(v)) return `[${v.map((x) => (x === undefined ? 'null' : canonical(x))).join(',')}]`;
if (v && typeof v === 'object') {
const o = v as Record<string, unknown>;
const keys = Object.keys(o).filter((k) => o[k] !== undefined).sort();
return `{${keys.map((k) => `${JSON.stringify(k)}:${canonical(o[k])}`).join(',')}}`;
}
return JSON.stringify(v ?? null);
}
const b64url = (s: string): Uint8Array =>
Uint8Array.from(atob(s.replace(/-/g, '+').replace(/_/g, '/') + '='.repeat((4 - (s.length % 4)) % 4)), (c) => c.charCodeAt(0));
// keys = await (await fetch(ORIGIN + '/v1/pubkey')).json(): pin both, once.
export async function verifySift(
res: { data: unknown; receipt: Record<string, any> },
keys: { signerPubKey: string; pqSignerPubKey: string },
) {
const r = res.receipt;
const fields = { v: r.v, id: r.id, chainId: r.chainId, tool: r.tool, targetHash: r.targetHash,
outputHash: r.outputHash, timestamp: r.timestamp, signerPubKey: r.signerPubKey };
const message = utf8ToBytes(`sift-receipt-v1\n${canonical(fields)}`); // both algorithms sign these bytes
const ed25519 = await ed.verifyAsync(hexToBytes(r.signature.slice(2)), message, hexToBytes(r.signerPubKey.slice(8)));
const mlDsa65 = typeof r.pqSignature === 'string' &&
ml_dsa65.verify(b64url(r.pqSignature), message, b64url(keys.pqSignerPubKey.slice('ml-dsa-65:'.length)));
const output = r.outputHash === `sha256:${bytesToHex(sha256(utf8ToBytes(canonical(res.data))))}`;
return { ed25519, mlDsa65, output, signer: r.signerPubKey === keys.signerPubKey };
}import base64
import hashlib
import json
from nacl.exceptions import BadSignatureError
from nacl.signing import VerifyKey # pip install pynacl
from dilithium_py.ml_dsa import ML_DSA_65 # pip install dilithium-py (FIPS 204)
def canonical(v) -> str:
return json.dumps(v, sort_keys=True, separators=(",", ":"), ensure_ascii=False)
def b64url(s: str) -> bytes:
return base64.urlsafe_b64decode(s + "=" * (-len(s) % 4))
def verify_sift(res: dict, keys: dict) -> dict:
"""keys = requests.get(ORIGIN + "/v1/pubkey").json(): pin both, once."""
r = res["receipt"]
fields = {k: r[k] for k in ("v", "id", "chainId", "tool", "targetHash",
"outputHash", "timestamp", "signerPubKey")}
message = ("sift-receipt-v1\n" + canonical(fields)).encode() # both algorithms sign these bytes
try:
VerifyKey(bytes.fromhex(r["signerPubKey"].removeprefix("ed25519:"))).verify(
message, bytes.fromhex(r["signature"][2:]))
ed25519 = True
except BadSignatureError:
ed25519 = False
ml_dsa_65 = "pqSignature" in r and ML_DSA_65.verify(
b64url(keys["pqSignerPubKey"].removeprefix("ml-dsa-65:")), message, b64url(r["pqSignature"]))
output = r["outputHash"] == "sha256:" + hashlib.sha256(canonical(res["data"]).encode()).hexdigest()
return {"ed25519": ed25519, "ml_dsa_65": ml_dsa_65, "output": output,
"signer": r["signerPubKey"] == keys["signerPubKey"]}Python’s json.dumps and JavaScript’s JSON.stringify agree on strings and plain decimals; numbers written in exponent form (1e-7) are the one case to normalise before hashing. Any FIPS 204 library works for the ML-DSA-65 half (liboqs, BoringSSL, Bouncy Castle); use the pure variant with an empty context string.
Paying with x402
A paid call without payment gets HTTP 402 and a quote. Send the quoted amount to recipient on chain 4663, then repeat the identical request with the transaction hash. The gateway reads the transfer over RPC (token, recipient, amount, confirmation and age) and stores the hash, so each transfer pays for one call.
{
"x402Version": 1,
"error": "payment_required",
"tool": "sift_insider_trades",
"resource": "/v1/sec/insiders",
"chainId": 4663,
"network": "robinhood-mainnet",
"recipient": "0x… treasury",
"quoteId": "q_…",
"expiresAt": 1796500300,
"priceUsd": "0.001",
"accepts": [
{
"symbol": "USDG",
"token": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
"amount": "1000",
"decimals": 6,
"amountFormatted": "0.001"
},
{
"symbol": "SIFT",
"token": "0x…",
"amount": "…",
"decimals": 18,
"amountFormatted": "…",
"discountPct": 30
}
],
"tab": {
"minDepositUsdg": "0.10"
},
"freeAlternatives": {
"playgroundRemaining": 0,
"holdGateHint": "Sign wallet ownership holding >= 500,000 SIFT for 200 free daily calls"
},
"paymentsEnabled": true
}Request headers
- X-Payment
- Transaction hash of a USDG (or $SIFT) transfer to the quoted recipient. Raw hash, JSON {"txHash"} or base64 JSON are all accepted.
- X-402-TxHash
- Same as X-Payment, as a bare 0x hash.
- X-Sift-Wallet
- Wallet whose metered tab or Sift Credit pays for this call.
- X-Sift-Wallet-Sig
- EIP-191 signature of the tab debit message below (EOA, ERC-1271 or ERC-6492).
- X-Sift-Nonce
- Single-use nonce inside the signed message.
- X-Sift-Issued-At
- Unix seconds inside the signed message; accepted within 300 s.
- X-Sift-Session
- Hold-gate session from POST /v1/hold/verify.
Response headers
- X-Sift-Receipt
- base64url JSON of the compact receipt: body.receipt without pqSignature, plus pqSigHash (sha256 of the raw ML-DSA-65 signature). Proves the Ed25519 half on its own.
- X-Sift-Paid-Via
- x402, tab, sift-credit, hold-gate, trial, free or open.
- X-Payment-Response
- base64 JSON {success, txHash, payer, chainId} after an x402 payment.
- X-402-Version
- 1, on every 402 quote.
Payment sources are tried in this order: X-Sift-Session (hold-gate), X-Sift-Wallet-Sig (Sift Credit first, then the tab), X-Payment or X-402-TxHash. If the tool itself fails after payment, the charge goes back to the payer’s tab.
Metered tab
Waiting a block for every call is slow for an agent making fifty in a row. Pay more than the price once (or POST the deposit to /v1/tab/deposit) and the surplus is credited to your wallet’s tab; it opens once deposits reach 0.10 USDG. After that, each call carries a signed debit instead of a transfer:
SiftMCP metered tab debit wallet: <your address, lowercase> tool: sift_sec_filings nonce: <8-128 url-safe chars, single use> issuedAt: <unix seconds, within 300 s of the server clock> chainId: 4663
Check the balance and the last 20 ledger lines at GET /v1/tab/:wallet. A nonce is burned on first use; a replay returns 409.
Hold-gate
Wallets holding at least 500,000 $SIFT get 200 free calls a day. POST /v1/hold/challenge with {"wallet"} returns a sign-in message; sign it and POST /v1/hold/verify with {"nonce", "signature"} to receive a session token. Send it as X-Sift-Session. Balances are re-read on chain while the session lives. The hold-gate switches on when $SIFT launches; until then the challenge endpoint answers hold_gate_disabled.
TypeScript and Python clients
Both clients pay a 402 quote once, wait for the transfer to confirm, and retry with X-402-TxHash. They refuse quotes on another chain, without a recipient, or above a cap you set.
import { createWalletClient, defineChain, http, parseAbi, publicActions } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
const ORIGIN = 'https://siftmcp.xyz';
const robinhood = defineChain({
id: 4663,
name: 'Robinhood Chain',
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: { default: { http: ['https://rpc.mainnet.chain.robinhood.com'] } },
});
const wallet = createWalletClient({
account: privateKeyToAccount(process.env.SIFT_WALLET_KEY as `0x${string}`),
chain: robinhood,
transport: http(),
}).extend(publicActions);
const erc20 = parseAbi(['function transfer(address to, uint256 amount) returns (bool)']);
const MAX_ATOMIC = 10_000n; // 0.01 USDG at 6 decimals: refuse anything above
export async function sift(path: string, body: unknown) {
const call = (headers: Record<string, string> = {}) =>
fetch(ORIGIN + path, {
method: 'POST',
headers: { 'content-type': 'application/json', ...headers },
body: JSON.stringify(body),
});
let res = await call();
if (res.status === 402) {
const quote = await res.json();
const usdg = quote.accepts.find((a: { symbol: string }) => a.symbol === 'USDG');
if (quote.chainId !== 4663 || !quote.recipient || BigInt(usdg.amount) > MAX_ATOMIC) {
throw new Error('quote refused');
}
const hash = await wallet.writeContract({
address: usdg.token,
abi: erc20,
functionName: 'transfer',
args: [quote.recipient, BigInt(usdg.amount)],
});
await wallet.waitForTransactionReceipt({ hash });
res = await call({ 'X-402-TxHash': hash });
}
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
return res.json(); // { data, meta, receipt }
}
const nvda = await sift('/v1/sec/insiders', { ticker: 'NVDA', limit: 10 });import os
import requests
from eth_account import Account
from web3 import Web3
ORIGIN = "https://siftmcp.xyz"
w3 = Web3(Web3.HTTPProvider("https://rpc.mainnet.chain.robinhood.com"))
acct = Account.from_key(os.environ["SIFT_WALLET_KEY"])
ERC20 = [{"name": "transfer", "type": "function", "stateMutability": "nonpayable",
"inputs": [{"name": "to", "type": "address"}, {"name": "amount", "type": "uint256"}],
"outputs": [{"name": "", "type": "bool"}]}]
MAX_ATOMIC = 10_000 # 0.01 USDG at 6 decimals
def sift(path: str, body: dict) -> dict:
r = requests.post(ORIGIN + path, json=body, timeout=90)
if r.status_code == 402:
q = r.json()
usdg = next(a for a in q["accepts"] if a["symbol"] == "USDG")
if q["chainId"] != 4663 or not q["recipient"] or int(usdg["amount"]) > MAX_ATOMIC:
raise RuntimeError("quote refused")
token = w3.eth.contract(address=Web3.to_checksum_address(usdg["token"]), abi=ERC20)
tx = token.functions.transfer(
Web3.to_checksum_address(q["recipient"]), int(usdg["amount"])
).build_transaction({
"from": acct.address,
"nonce": w3.eth.get_transaction_count(acct.address),
"chainId": 4663,
})
tx_hash = w3.eth.send_raw_transaction(acct.sign_transaction(tx).raw_transaction)
w3.eth.wait_for_transaction_receipt(tx_hash)
r = requests.post(ORIGIN + path, json=body, timeout=90,
headers={"X-402-TxHash": Web3.to_hex(tx_hash)})
r.raise_for_status()
return r.json() # {"data", "meta", "receipt"}
tsla = sift("/v1/sec/financials", {"ticker": "TSLA", "quarters": 8})Upoch checkpoints
A receipt needs nothing but the gateway’s public keys to check, so it can travel inside an agent checkpoint as is: about 5 KB with its ML-DSA-65 signature, or a few hundred bytes in the compact header form if the Ed25519 half is enough. Store receipt next to the data it covers (or only its outputHash if the data is large). Whoever restores the checkpoint later recomputes the hash and runs the verification above against the keys from GET /v1/pubkey, with no call back to SiftMCP needed.
SiftMCP does not write to Upoch itself. See upoch.tech for how its checkpoints are created and read.