{
  "markdown": "# mcp-server-insumer\n\n[![npm](https://img.shields.io/npm/v/mcp-server-insumer)](https://www.npmjs.com/package/mcp-server-insumer) [![Glama](https://glama.ai/mcp/servers/@douglasborthwick-crypto/mcp-server-insumer/badge)](https://glama.ai/mcp/servers/@douglasborthwick-crypto/mcp-server-insumer) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nMCP server for [InsumerAPI](https://insumermodel.com/developers/) — condition-based access infrastructure. Send a wallet and conditions, get a signed boolean across 38 chains. No balances exposed, no identity required, no trust in the API provider needed.\n\nEnables AI agents (Claude Desktop, Cursor, Windsurf, and any MCP-compatible client) to add condition-based access to any workflow — verify on-chain conditions, discover merchants, generate signed discount codes, and onboard new merchants.\n\n**In production:** [AsterPay](https://github.com/AsterPay/erc8183-kya-hook) — a regulated payments stack — runs live ERC-8183 agentic-commerce trust scoring on InsumerAPI. [Case study](https://insumermodel.com/blog/asterpay-kya-erc8183-attestation-integration.html).\n\nAlso available as: [LangChain](https://pypi.org/project/langchain-insumer/) (26 tools, PyPI) | [langchain-community](https://github.com/langchain-ai/langchain/pull/549) (26 tools, PR #549) | [ElizaOS](https://www.npmjs.com/package/@insumermodel/plugin-eliza) (10 actions, npm) | [OpenAI GPT](https://chatgpt.com/g/g-699c5e43ce2481918b3f1e7f144c8a49-insumerapi-verify) (GPT Store) | [insumer-verify](https://www.npmjs.com/package/insumer-verify) (client-side verification, npm)\n\n**[Full AI Agent Verification API guide](https://insumermodel.com/ai-agent-verification-api/)** — covers all 38 chains, trust profiles, commerce protocols, and signature verification.\n\n## Quick Start\n\n### Claude Desktop\n\nAdd to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"insumer\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-server-insumer\"],\n      \"env\": {\n        \"INSUMER_API_KEY\": \"insr_live_...\"\n      }\n    }\n  }\n}\n```\n\n### Cursor / Windsurf\n\nAdd to your MCP settings:\n\n```json\n{\n  \"insumer\": {\n    \"command\": \"npx\",\n    \"args\": [\"-y\", \"mcp-server-insumer\"],\n    \"env\": {\n      \"INSUMER_API_KEY\": \"insr_live_...\"\n    }\n  }\n}\n```\n\n### Get a key — no signup, no dashboard, no password\n\nThree paths, all give you a working `insr_live_...` key in seconds with 100 reads/day and 10 verification credits. One free key per email.\n\n**Option A — Let your agent do it:** Start the server without a key. Your AI agent can call the `insumer_setup` tool with your email to generate a free key instantly. Add it to your config and restart.\n\n**Option B — Terminal:**\n\n```bash\ncurl -s -X POST https://api.insumermodel.com/v1/keys/create \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\": \"you@example.com\", \"appName\": \"MCP Server\", \"tier\": \"free\"}'\n```\n\n**Option C — Browser:** Enter your email on [insumermodel.com](https://insumermodel.com/?utm_source=npm-mcp-server-insumer) — the key appears inline.\n\nSet it as `INSUMER_API_KEY` in your config.\n\n**Already have a key?** Manage usage, top up, or upgrade at [insumermodel.com/developers/account/](https://insumermodel.com/developers/account/?utm_source=npm-mcp-server-insumer).\n\n### Option D — Pay per call with x402 (no key at all)\n\nInstead of a key, set `INSUMER_PAYMENT_KEY` to a **throwaway Base wallet** funded with a few dollars of USDC. Metered calls (`insumer_attest`, `insumer_wallet_trust`, `insumer_batch_wallet_trust`) are then paid inline via [x402](https://www.x402.org) — the server requests a price, signs an EIP-3009 USDC authorization on Base, and retries. No signup, no credits, no dashboard.\n\n```json\n{\n  \"mcpServers\": {\n    \"insumer\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-server-insumer\"],\n      \"env\": { \"INSUMER_PAYMENT_KEY\": \"0x<throwaway-wallet-private-key>\" }\n    }\n  }\n}\n```\n\n- Base USDC only; the wallet needs USDC but **no ETH** (settlement is gasless).\n- Each call spends a few cents (attest $0.05, trust $0.15). Use a **dedicated throwaway wallet** funded with a small amount — never a wallet holding meaningful funds.\n- If both `INSUMER_API_KEY` and `INSUMER_PAYMENT_KEY` are set, the key (credits) is used.\n\n## What You Get Back\n\nWhen your agent calls `insumer_attest`, you get an ECDSA-signed attestation:\n\n```json\n{\n  \"ok\": true,\n  \"data\": {\n    \"attestation\": {\n      \"id\": \"ATST-A7C3E1B2D4F56789\",\n      \"pass\": true,\n      \"results\": [\n        {\n          \"condition\": 0,\n          \"met\": true,\n          \"label\": \"USDC >= 1000 on Ethereum\",\n          \"type\": \"token_balance\",\n          \"chainId\": 1,\n          \"evaluatedCondition\": {\n            \"chainId\": 1,\n            \"contractAddress\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n            \"operator\": \"gte\",\n            \"threshold\": \"1000\",\n            \"type\": \"token_balance\"\n          },\n          \"conditionHash\": \"0x8a3b...\",\n          \"blockNumber\": \"0x1799043\",\n          \"blockTimestamp\": \"2026-03-26T20:04:23.000Z\"\n        }\n      ],\n      \"passCount\": 1,\n      \"failCount\": 0,\n      \"attestedAt\": \"2026-02-28T12:34:57.000Z\",\n      \"expiresAt\": \"2026-02-28T13:04:57.000Z\"\n    },\n    \"sig\": \"NgA7BO8SAildiTrgIQY2UyXsBrySZknkP85pT2Zqv8Hq0KsCsB8DRFVMkXgnXtCXrbb726Is6k4LyyBYU+f/Pw==\",\n    \"kid\": \"insumer-attest-v2\",\n    \"pqSig\": \"<base64 ML-DSA-65 signature>\",\n    \"pqKid\": \"insumer-attest-pq1\"\n  },\n  \"meta\": {\n    \"version\": \"1.0\",\n    \"timestamp\": \"2026-02-28T12:34:57.000Z\",\n    \"creditsRemaining\": 99,\n    \"creditsCharged\": 1\n  }\n}\n```\n\nThe `sig` is an ECDSA P-256 signature (base64, P1363 r||s, 88 characters). The `kid` identifies the key and selects the signed bytes: `insumer-attest-v2` signs `\"insumer.attestation.v2\\n\" + canonical_json({v: 2, id, pass, results, attestedAt})` (keys sorted at every level); `insumer-attest-v1` signs the bare `JSON.stringify` of `{id, pass, results, attestedAt}` in insertion order. Since 2026-09-01 every attest and trust response also carries a post-quantum companion, `pqSig` and `pqKid` (ML-DSA-65 over the post-quantum domain tag plus the same classical preimage the `kid` selects), added beside `sig` and `kid` without changing them. The `conditionHash` is a SHA-256 of the exact condition logic that was evaluated.\n\nNo balances. No amounts. Just a cryptographically signed true/false.\n\nFor XRPL conditions, results include `ledgerIndex`, `ledgerHash` (validated ledger hash), and `trustLineState: { frozen: boolean }` instead of `blockNumber`/`blockTimestamp`. Native XRP conditions include `ledgerIndex` and `ledgerHash` but not `trustLineState`. Frozen trust lines cause `met: false`.\n\n### Wallet Auth (JWT)\n\nAdd `format: \"jwt\"` to the `insumer_attest` tool parameters to receive the attestation as a standard JWT bearer token:\n\n```json\n{\n  \"wallet\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n  \"conditions\": [ ... ],\n  \"format\": \"jwt\"\n}\n```\n\nThe response includes an additional `jwt` field containing an ES256-signed JWT, and beside it a `pqJwt` sibling (a compact JWS with `alg` ML-DSA-65 carrying the same claims, signed under `insumer-attest-pq1`). The `jwt` token is verifiable by any standard JWT library via the JWKS endpoint at `GET /v1/jwks` — making it compatible with Kong, Nginx, Cloudflare Access, AWS API Gateway, and other middleware that accepts JWT bearer tokens.\n\n## Verify the Response\n\nYour agent gets the attestation. Your application should verify it. Install [insumer-verify](https://www.npmjs.com/package/insumer-verify):\n\n```bash\nnpm install insumer-verify\n```\n\n```typescript\nimport { verifyAttestation } from \"insumer-verify\";\n\n// attestationResponse = the full API envelope {ok, data: {attestation, sig, kid, pqSig, pqKid}, meta}\n// Do NOT pass attestationResponse.data — the function expects the outer envelope\nconst result = await verifyAttestation(attestationResponse, {\n  jwksUrl: \"https://insumermodel.com/.well-known/jwks.json\",\n  maxAge: 120, // reject if block data is older than 2 minutes\n});\n\nif (result.valid) {\n  // Signature verified, condition hashes match, not expired\n  const pass = attestationResponse.data.attestation.pass;\n  console.log(`Attestation ${pass ? \"passed\" : \"failed\"} all conditions`);\n} else {\n  console.log(\"Verification failed:\", result.checks);\n}\n```\n\nThis reports five independent verdicts: ECDSA signature, condition hash integrity, block freshness, attestation expiry, and the post-quantum companion (`insumer-verify` 1.8.1+ reports it as verified, refuted, absent, or unverifiable). Zero runtime dependencies, uses Web Crypto API.\n\n## Tools (27)\n\n### Setup (free, no auth)\n\n| Tool | Description |\n|------|-------------|\n| `insumer_setup` | Generate a free API key instantly. Takes an email, returns an `insr_live_...` key with 10 credits. No credit card required. |\n\n### Key Discovery (free)\n\n| Tool | Description |\n|------|-------------|\n| `insumer_jwks` | Get the JWKS: five entries over two keys. The ECDSA P-256 key under `insumer-attest-v1`, `insumer-attest-v2`, and `insumer-trust-v2`, followed by the ML-DSA-65 post-quantum key under two RFC 9964 `AKP` entries, `insumer-attest-pq1` and `insumer-trust-pq1`. Match by the `kid` (or `pqKid`) on the response, never by position. |\n\n### On-Chain Verification (cost credits)\n\n> **`token_balance` thresholds are decimal strings.** Pass `threshold` as `\"100\"`, not `100`. Keys created from 2026-06-10 sign with `kid: insumer-attest-v2`, which preserves full precision and rejects a JSON number with a `400`. The `insumer_attest` tool accepts a number or string and coerces to the canonical string; older `insumer-attest-v1` keys accept either.\n\n| Tool | Description |\n|------|-------------|\n| `insumer_attest` | Verify on-chain conditions (token balances, NFT ownership, EAS attestations, Farcaster identity, `evm_view_call` for arbitrary boolean view functions, `ratio_to_amount` for self-scaling agent-spend limits and `ratio_to_supply` for share-of-supply rules — all three RPC EVM only, plus `erc8004_agent` for ERC-8004 agent registration and `erc7710_delegation` for MetaMask-framework delegation validity, both on Base). Returns ECDSA-signed boolean with `kid`, `evaluatedCondition`, `conditionHash` (SHA-256), and `blockNumber`/`blockTimestamp`. 1 credit. Optional `proof: \"merkle\"` for EIP-1186 Merkle storage proofs (2 credits). |\n| `insumer_compliance_templates` | List available EAS compliance templates (Coinbase Verifications on Base, Gitcoin Passport on Optimism). Free. |\n| `insumer_wallet_trust` | Generate ECDSA-signed wallet trust fact profile. 44 base checks across 25 chains in 5 dimensions (stablecoins, governance, NFTs, staking, institutional stablecoins — EURCV/USDCV/USDC/BENJI across Ethereum, Solana, XRPL, Stellar, Sui), up to 49 checks across 27 chains in 9 dimensions with optional Solana, XRPL, Bitcoin, and Tron wallets. 3 credits (6 with merkle). |\n| `insumer_batch_wallet_trust` | Batch trust profiles for up to 10 wallets. Each wallet object supports optional `solanaWallet`, `xrplWallet`, `bitcoinWallet`, `tronWallet`, `stellarWallet`, and `suiWallet`. Shared block fetches, 5-8x faster. Partial success supported. 3 credits/wallet (6 with merkle). |\n| `insumer_verify` | Create signed discount code (INSR-XXXXX, 30-min expiry) for a wallet at a merchant. 1 merchant credit. |\n\n### Discovery (free)\n\n| Tool | Description |\n|------|-------------|\n| `insumer_list_merchants` | Browse the merchant directory. Filter by token, verification status. |\n| `insumer_get_merchant` | Get full public merchant profile. |\n| `insumer_list_tokens` | List all registered tokens and NFTs. Filter by chain, symbol, type. |\n| `insumer_check_discount` | Calculate discount for a wallet at a merchant. |\n\n### Credits & Keys\n\n| Tool | Description |\n|------|-------------|\n| `insumer_buy_key` | Buy a new API key with USDC, USDT, BTC, or USDT-TRC20 (no auth required). Agent-friendly: no email needed, sender wallet becomes the key's identity. One key per wallet. Volume discounts: $0.04–$0.02/call. Supported chains: Ethereum, Base, Polygon, Arbitrum, Optimism, BNB Chain, Avalanche, Solana, Bitcoin, Tron. Non-refundable. |\n| `insumer_credits` | Check credit balance and tier. |\n| `insumer_buy_credits` | Buy verification credits with USDC, USDT, BTC, or USDT-TRC20. Volume discounts: $0.04–$0.02/call. Supported chains: Ethereum, Base, Polygon, Arbitrum, Optimism, BNB Chain, Avalanche, Solana, Bitcoin, Tron. Non-refundable. First purchase registers sender wallet; subsequent purchases must match or include `updateWallet: true`. |\n| `insumer_confirm_payment` | Confirm USDC payment for a discount code. |\n\n### Merchant Onboarding (owner-only)\n\n| Tool | Description |\n|------|-------------|\n| `insumer_create_merchant` | Create new merchant. Receives 100 free credits. |\n| `insumer_merchant_status` | Get full private merchant details. |\n| `insumer_configure_tokens` | Set token discount tiers. |\n| `insumer_configure_nfts` | Set NFT collection discounts. |\n| `insumer_configure_settings` | Set discount mode, cap, USDC payments. |\n| `insumer_publish_directory` | Publish merchant to public directory. |\n| `insumer_buy_merchant_credits` | Buy merchant verification credits with USDC, USDT, BTC, or USDT-TRC20. Volume discounts: $0.04–$0.02/call. Owner only. Non-refundable. First purchase registers sender wallet; subsequent purchases must match or include `updateWallet: true`. |\n\n### Domain Verification (owner-only)\n\n| Tool | Description |\n|------|-------------|\n| `insumer_request_domain_verification` | Request a verification token for a merchant's domain. Returns token and 3 methods (DNS TXT, meta tag, file upload). |\n| `insumer_verify_domain` | Complete domain verification after placing the token. Verified merchants get a trust badge. |\n\n### Commerce Protocol Integration\n\n| Tool | Description |\n|------|-------------|\n| `insumer_acp_discount` | Check discount eligibility in OpenAI/Stripe ACP format. Returns coupon objects and per-item allocations. 1 merchant credit. |\n| `insumer_ucp_discount` | Check discount eligibility in Google UCP format. Returns title, extension field, and applied array. 1 merchant credit. |\n| `insumer_validate_code` | Validate an INSR-XXXXX discount code. Returns validity, discount percent, expiry. Free, no auth. |\n\n## Pricing\n\n**Tiers:** Free (100 reads/day, 10 credits) | Pro $29/mo (1,000 credits/mo, 10,000/day) | Enterprise $99/mo (5,000 credits/mo, 100,000/day)\n\n**Volume discounts:** $5–$99 = $0.04/call (25 credits/$1) · $100–$499 = $0.03 (33/$1, 25% off) · $500+ = $0.02 (50/$1, 50% off)\n\n**Platform wallets:**\n- **EVM (USDC/USDT):** `0xAd982CB19aCCa2923Df8F687C0614a7700255a23`\n- **Solana (USDC/USDT):** `6a1mLjefhvSJX1sEX8PTnionbE9DqoYjU6F6bNkT4Ydr`\n- **Bitcoin:** `bc1qg7qnerdhlmdn899zemtez5tcx2a2snc0dt9dt0`\n- **Tron (USDT-TRC20):** `TC5yvwkAMakkXtUxYiu2Yn1xbBcwYuD6cn`\n\n**Supported payment chains:** Ethereum, Base, Polygon, Arbitrum, Optimism, BNB Chain, Avalanche, Solana, Bitcoin, Tron. Tokens sent on unsupported chains cannot be recovered. All purchases are final and non-refundable. [Full pricing →](https://insumermodel.com/pricing/)\n\n## Handling `rpc_failure` Errors\n\nIf the API cannot reach one or more blockchain data sources after retries, endpoints that produce signed attestations (`insumer_attest`, `insumer_wallet_trust`, `insumer_batch_wallet_trust`) return `ok: false` with error code `rpc_failure`. No signature, no JWT, no credits charged. This is a retryable error — the MCP client should retry after a short delay (2-5 seconds).\n\n**Important:** `rpc_failure` is NOT a verification failure. Do not treat it as `pass: false`. It means the data source was temporarily unavailable and the API refused to sign an unverified result.\n\n## Supported Chains (38)\n\n32 EVM chains + Solana + XRP Ledger + Bitcoin + Tron + Stellar + Sui. Includes Ethereum, Base, Polygon, Arbitrum, Optimism, BNB Chain, Avalanche, XDC, Robinhood Chain, and 23 more EVM. [Full list →](https://insumermodel.com/developers/api-reference/)\n\n## Also Available As\n\n- **Claude Code Skill:** `smithery skill add douglasborthwick/insumer-skill` ([Smithery](https://smithery.ai/skills/douglasborthwick/insumer-skill) · [GitHub](https://github.com/douglasborthwick-crypto/insumer-skill)) — for *writing* wallet auth into your own projects from inside Claude Code. This MCP server gives an agent runtime access to the API; insumer-skill helps developers author integration code at build time. Different surfaces, same primitive.\n- **ElizaOS Plugin:** `@insumermodel/plugin-eliza` ([npm](https://www.npmjs.com/package/@insumermodel/plugin-eliza))\n- **LangChain (Python):** `pip install langchain-insumer` ([PyPI](https://pypi.org/project/langchain-insumer/))\n- **OpenAI GPT:** [InsumerAPI Wallet Auth](https://chatgpt.com/g/g-699c5e43ce2481918b3f1e7f144c8a49-insumerapi-wallet-auth) (GPT Store)\n- **Verifier (offline JWKS):** `npm install insumer-verify` ([npm](https://www.npmjs.com/package/insumer-verify))\n\n## Development\n\n```bash\nnpm install\nnpm run build\n\n# Test with MCP Inspector\nnpx @modelcontextprotocol/inspector node build/index.js\n```\n\n## License\n\nMIT\n\n---\n",
  "bytes": 17144,
  "sha": "48da8868474564e43278c65f2ea2ad5a8c1fd0cea46edb2c8bf2e246ab3c8c14",
  "repo_slug": "douglasborthwick-crypto/mcp-server-insumer",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_douglasborthwick_crypto_insume_da2917c6/readme"
}