{
  "markdown": "# Israel Invoice Payment Gate and Counterparty Intelligence\n\nOne agent-native gate to check an Israeli supplier invoice before payment, with public-registry counterparty evidence.\n\nPublic source: <https://github.com/itzikhr18/israel-counterparty-intelligence>\n\n**Bring your own trusted wallet:** the free invoice result can prepare a private, validated request\nfor an existing x402 client, with a free supplier match and a 0.25 USDC proposed cap.\nNo seller wallet package is required. Downloading is not payment approval; the buyer's wallet must\nenforce the live terms. [Independent-wallet guide](https://israel-counterparty-intelligence.vercel.app/trusted-wallet-guide.md).\n\nStart with the [free invoice check](https://israel-counterparty-intelligence.vercel.app/#invoice-preview),\ndownload the validated `invoice-request.json`, and continue with the same invoice:\n\n```bash\nnpx --yes https://israel-counterparty-intelligence.vercel.app/israel-company-verify-buyer-0.4.0.tgz --invoice-file invoice-request.json\n```\n\nPublic agent metadata is available at `/.well-known/x402`, `/llms.txt`, and `/README.md` in the\nproduction deployment. The Mainnet and Testnet payment resources use the same business logic but\nremain separate payment routes so Test USDC can never unlock the Mainnet resource.\n\nThe same verification engine is also exposed as a stateless Remote Streamable HTTP MCP server:\n\n- `POST /mcp` - Base Mainnet, including a 0.25 USDC Israeli invoice payment gate plus company changes, verification, and vendor-risk tools.\n- `POST /mcp/testnet` - Base Sepolia, 0.05 Test USDC per successful `verify_company` call.\n- `POST /mcp/pilot` - invitation-only partner evaluation with a time-limited bearer token.\n- Company and payment-risk previews, `preview_agent_payment_trust`, `describe_service`, and `get_schema` are free on both MCP endpoints.\n\nThis repository is a deliberately small MVP for External Paid Call #1. It resolves an Israeli\nregistered company, adds its public government-contract/support footprint, builds field-level\nevidence, and returns a transparent heuristic risk signal. It is not a legal, credit, sanctions,\nor investment service.\n\n## Current scope\n\n- `POST /v1/verify` - official company resolution and evidence.\n- `POST /v1/verify/mainnet` - the same verification result, paid with real USDC on Base Mainnet.\n- `POST /v1/pilot/verify` - invitation-only partner evaluation; never a public free route.\n- `POST /v1/government-footprint` - public contracts and supports by exact company number.\n- `POST /v1/counterparty-risk` - combined result and deterministic reason-coded score.\n- `POST /v1/payment-risk/mainnet` - Mainnet pre-payment vendor triage with a `PROCEED`, `REVIEW`, or `BLOCK` result.\n- `POST /v1/invoice-gate/preview` - free invoice arithmetic and allocation-applicability preview using date, amount, VAT component, and buyer-attested conditions; never authorization to pay.\n- `POST /v1/invoice-gate/mainnet` - 0.25 USDC registry-backed Israeli invoice gate returning `PAY`, `HOLD`, or `BLOCK`.\n- `POST /v1/company-changes/mainnet` - recent official company filing and status-change events for an exact company number, newest first, with source evidence.\n- `POST /v1/agent-payment-trust` - free dry-run x402 pre-sign firewall with `ALLOW`, `REVIEW`, or `DENY`; it never signs or submits a payment.\n- `GET /health` - health check.\n- `GET /openapi.json` - machine-readable contract.\n- x402 v2 fixed-price protection and Bazaar metadata when `X402_ENABLED=true`.\n- Remote Streamable HTTP MCP with paid `verify_company` plus free `preview_company`, `preview_agent_payment_trust`, `describe_service`, and `get_schema`.\n\nAllocation applicability uses a strictly-greater-than amount threshold and also depends on a VAT component, an authorized-dealer buyer, and a buyer request; missing buyer context fails safely to `HOLD`. Official Tax Authority allocation verification requires an authorized dealer/representative connection. Buyer-supplied verification results are labeled `BUYER_ATTESTED` and are not independently authenticated. Not included: dashboards, accounts, subscriptions, PDF reports, broad scraping, bank-account\nownership verification, document forensics, UBO/PEP/sanctions certification, adverse-media\nscreening, creditworthiness, TASE enrichment, or a custom ML model.\n\n## Verified Payee Firewall MVP\n\n`preview_agent_payment_trust` evaluates exact x402 terms before a buyer wallet signs. It resolves\nthe claimed Israeli company, fetches `/.well-known/agent-payee.json` from the service origin with\nSSRF and redirect protections, validates the manifest and EVM signature, checks the declared\npayment destination, verifies the payment resource origin and buyer mandate, and creates a stable\nSHA-256 fingerprint of the payment contract.\n\n`ALLOW` is fail-closed: it requires an active resolved company, a valid domain-fetched manifest,\nan authorized payment destination, a matching resource origin, and a complete buyer mandate.\n`REVIEW` and `DENY` must not be signed automatically. Level 1 and Level 2 assurance do not prove\nlegal ownership of the recipient wallet. The manifest specification is published at\n`/agent-payee-manifest-v0.1.md` and its JSON Schema at\n`/.well-known/agent-payee-schema.json`.\n\nProduction status: **MAINNET LIVE - AWAITING FIRST EXTERNAL PAID CALL**. No internal Mainnet\npayment is required for launch. The first genuine external Base Mainnet USDC payment is also the\nfirst production end-to-end settlement and External Paid Call #1.\n\n## Public sources\n\nThe company adapters use the Ministry of Justice Companies Registrar open CKAN company dataset and\nthe Corporations Authority daily changes dataset on `data.gov.il`. The changes source covers up to\napproximately one year; an empty result does not prove that no earlier change occurred. Official\nrequest types are returned as facts and mapped to deterministic navigation categories, not risk\nconclusions. The government-footprint adapter uses the public BudgetKey table API. Source URLs,\nretrieval time, source record identifiers, and confidence are returned in `evidence`.\n\nThe service returns `null` and `missing_data` when data is unavailable. It does not convert a\ngovernment contract into a trust endorsement and does not add risk points merely because a source\nis missing.\n\n## Local setup\n\nRequirements: Node.js 20 or newer.\n\n```bash\nnpm install\ncp .env.example .env.local\nnpm run dev\n```\n\nRun all checks:\n\n```bash\nnpm run check\n```\n\n## Example\n\n```bash\ncurl -X POST http://localhost:3000/v1/verify \\\n  -H 'content-type: application/json' \\\n  -d '{\"company_number\":\"514744887\",\"language\":\"en\"}'\n```\n\nName lookup is also supported:\n\n```json\n{\n  \"company_name\": \"MONDAY.COM\",\n  \"city\": \"Tel Aviv\",\n  \"language\": \"en\"\n}\n```\n\nWhen several candidates are plausible, the API returns `409 AMBIGUOUS_ENTITY` and candidates. It\nnever silently selects one. An invalid number returns `400`; no reliable entity returns `422` for\nthe two enrichment endpoints.\n\n## x402 configuration\n\nThe implementation uses the official x402 v2 packages and Next.js `withX402`, so settlement occurs\nonly after a successful response. The default test setup is Base Sepolia through the public x402\ntest facilitator.\n\nRequired to enable payment:\n\n```dotenv\nX402_ENABLED=true\nX402_PAY_TO=0xYourReceivingWallet\nX402_NETWORK=eip155:84532\nX402_ASSET=0x036CbD53842c5426634e7929541eC2318f3dCF7e\nX402_FACILITATOR_URL=https://facilitator.payai.network\nPUBLIC_BASE_URL=https://your-public-host.example\n```\n\nPrices are centralized in environment variables:\n\n```dotenv\nX402_VERIFY_PRICE=$0.10\nX402_GOVERNMENT_PRICE=$0.35\nX402_RISK_PRICE=$0.50\n```\n\nThe independent Mainnet resource uses:\n\n```dotenv\nX402_MAINNET_ENABLED=true\nX402_MAINNET_PAY_TO=0xYourReceivingWallet\nX402_MAINNET_NETWORK=eip155:8453\nX402_MAINNET_ASSET=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\nX402_MAINNET_FACILITATOR_URL=https://facilitator.payai.network\nX402_MAINNET_FACILITATOR_PROVIDER=auto\nCDP_API_KEY_ID=\nCDP_API_KEY_SECRET=\nX402_MAINNET_VERIFY_PRICE=$0.05\nX402_MAINNET_PAYMENT_RISK_PRICE=$0.10\nX402_MAINNET_INVOICE_GATE_PRICE=$0.25\nX402_MAINNET_COMPANY_CHANGES_PRICE=$0.01\nX402_MCP_TESTNET_VERIFY_PRICE=$0.05\nX402_MCP_MAINNET_VERIFY_PRICE=$0.05\nX402_MCP_TESTNET_PAYMENT_RISK_PRICE=$0.10\nX402_MCP_MAINNET_PAYMENT_RISK_PRICE=$0.10\nX402_MCP_TESTNET_INVOICE_GATE_PRICE=$0.25\nX402_MCP_MAINNET_INVOICE_GATE_PRICE=$0.25\nX402_MCP_TESTNET_COMPANY_CHANGES_PRICE=$0.01\nX402_MCP_MAINNET_COMPANY_CHANGES_PRICE=$0.01\nMAINNET_INTERNAL_TEST_PAYER=0xYourIsolatedMainnetTestWallet\n```\n\nWithout a payment signature, a protected endpoint returns `402` with `PAYMENT-REQUIRED`. The\nchallenge includes Bazaar input/output metadata. A compatible paid client must echo that extension\nin its payment payload. Catalog inclusion happens only after a facilitator processes a conforming\npaid payload and is ultimately controlled by that facilitator.\n\n`X402_MAINNET_FACILITATOR_PROVIDER=auto` preserves the configured URL until both CDP credentials\nare present. When they are added, Mainnet verification and settlement automatically switch to the\nauthenticated Coinbase CDP facilitator. The secret never appears in challenges, logs, or health\nresponses. Run `npm run bazaar:check` to validate all live paid endpoints against Coinbase Bazaar;\nthe same read-only check runs daily in GitHub Actions.\n\nThe Base Sepolia and Base Mainnet network identifiers and USDC assets are validated as distinct\nconfiguration values. Price, asset, network, facilitator and payTo are server-owned and cannot be\noverridden by request input.\n\n## MCP client setup\n\nProduction MCP URL:\n\n```text\nhttps://israel-counterparty-intelligence.vercel.app/mcp\n```\n\nThe endpoint implements Streamable HTTP and x402 v2. Standard MCP clients can initialize the\nserver, list tools, and call the free tools. `preview_company` returns identity/status plus exact\nreusable arguments for the next paid action. A paid `verify_company` call returns a structured\n`PaymentRequired` result until the client retries it with `_meta[\"x402/payment\"]`; a successful\nsettlement is returned in `_meta[\"x402/payment-response\"]`. Use an x402-aware MCP client such as\n`@x402/mcp` for automatic signing and retry. No buyer account or API key is required.\n\nThe production `PaymentRequired.resource.description` includes the canonical buyer guide:\nhttps://israel-counterparty-intelligence.vercel.app/x402-buyer-quickstart.md. It contains a\nStreamable HTTP client example, explicit Base Mainnet/USDC requirements, per-tool spend guards,\nand the expected payment/settlement metadata. A normal MCP client without an x402 wallet bridge can\ndiscover and call the free tools but cannot complete `verify_company` automatically.\n\nMinimal client configuration for Claude and other clients that accept remote HTTP MCP servers:\n\n```json\n{\n  \"mcpServers\": {\n    \"israel-business-intelligence\": {\n      \"type\": \"http\",\n      \"url\": \"https://israel-counterparty-intelligence.vercel.app/mcp\"\n    }\n  }\n}\n```\n\nLangChain uses the same URL with transport `http`; CrewAI and Google ADK use transport\n`streamable-http`. Their standard MCP adapters can discover and call the free tools. Paid calls\nrequire the x402 payment metadata round trip described above; no framework-specific SDK is needed.\n\nAn isolated, buyer-controlled supplier-onboarding composition is available in\n[`examples/aerchain-adapter`](examples/aerchain-adapter/README.md). It includes a strict Base\nMainnet payment policy, registry-to-vendor mapping, settlement receipt handling, fixtures, and\ntests. It does not alter the production service or represent public-registry evidence as full KYB.\n\n## Partner pilot\n\nThe partner pilot is isolated from both paid routes. A valid bearer token can call the same\nverification engine through `/mcp/pilot` or `/v1/pilot/verify` while payment is waived. The current\noffer is limited to 100 successful verifications and a fixed expiration date. Each successful call\nemits a `pilot_verification` event with a partner identifier and no raw token or raw IP address.\n\nThe in-process counter is a safety cap, not a globally durable billing ledger. The authoritative\npilot total is the centralized count of successful `pilot_verification` events. If the product\nmoves beyond a small evaluation, replace this mechanism with an atomic shared usage store before\nselling metered plans.\n\nKeep the raw bearer token outside the repository and configure only its SHA-256 digest. See\n[the pilot runbook](docs/PILOT.md) for activation, monitoring, and shutdown steps.\n\n## Smoke tests\n\nAgainst a running unprotected service and the live public sources:\n\n```bash\nBASE_URL=http://localhost:3000 npm run smoke\n```\n\nAgainst a running x402-enabled service, without paying:\n\n```bash\nBASE_URL=http://localhost:3000 EXPECT_X402=true npm run smoke\n```\n\nThe x402 smoke mode verifies HTTP 402, the payment header, protocol version 2, the exact configured\nprice, and Bazaar metadata. Base Sepolia already proves the complete settlement flow. Mainnet stays\nlive without an operator-funded self-payment and waits for a genuine external payer.\n\nMCP discovery and free-tool smoke test:\n\n```bash\nMCP_URL=https://israel-counterparty-intelligence.vercel.app/mcp/testnet npm run smoke:mcp\n```\n\nThe paid MCP smoke script is hard-restricted to `/mcp/testnet` and requires an isolated Base\nSepolia wallet file supplied outside the repository:\n\n```bash\nX402_TEST_WALLET_FILE=/secure/path/test-wallet.json npm run smoke:mcp:paid\n```\n\n## Risk scoring v0.1.0\n\n- Entity not active: +40.\n- Registry law-violation flag: +25.\n- Annual report older than two years: +10.\n- 0-19: LOW, 20-49: MEDIUM, 50-100: HIGH.\n- Ambiguous identity is not scored.\n- Missing critical identity data blocks scoring; missing enrichment lowers confidence.\n\nEvery risk response includes `reason_codes`, `explanation`, `confidence`, `scoring_version`, and an\ninference evidence record. The safe interpretation is: no material public warning flags were found\nin the sources checked - never that a transaction is safe.\n\n## Reliability and privacy\n\n- Typed adapters with Zod response validation.\n- Abort timeouts and one bounded retry by default.\n- Six-hour in-memory source cache.\n- Per-instance in-memory rate limiting.\n- JSON logs with request ID, timing, source calls, payment presence, confidence, error category, and\n  a shortened one-way client fingerprint.\n- Only a successful settlement on the exact Base Mainnet route, official Base USDC contract,\n  configured amount and configured payTo can emit `external_paid_call`. Testnet and the configured\n  internal test payers are excluded. The event is emitted by the post-settlement SDK hook and\n  includes network, asset, payer, amount, transaction hash, resource and optional discovery source.\n- No user database and no raw IP logging in application code.\n- No secrets in the repository.\n- Pilot authentication compares a SHA-256 token digest in constant time; the raw credential stays\n  outside the repository.\n\nIn-memory cache and rate limiting are sufficient for the first paid-call experiment, not a\nmulti-region high-volume service. Add shared infrastructure only after real demand appears.\n\n## Deployment\n\nBuild first:\n\n```bash\nnpm run check\n```\n\nThen link and deploy from this directory:\n\n```bash\nvercel link\nvercel deploy\nvercel promote <validated-preview-url>\n```\n\nConfigure runtime environment variables in Vercel rather than committing them. Keep x402 disabled\nuntil the receiving wallet is correct. After enabling x402, redeploy and run the non-paying 402\nsmoke test. Do not manufacture a Mainnet settlement for activation or discovery.\n\n## External Paid Call #1\n\n1. Keep the public Mainnet endpoint and discovery metadata live.\n2. Wait for a payer that is not controlled by the operator.\n3. Require successful Base Mainnet settlement with real USDC and an HTTP 200 API response.\n4. Exclude Testnet, internal wallets, smoke tests, crawlers and directory probes.\n5. Emit `external_paid_call` with network, payer, amount, transaction hash, resource and timestamp.\n6. Treat that same event as the first Mainnet end-to-end proof and External Paid Call #1.\n\nDo not add features if no external paid call occurs after a reasonable discovery and outreach test.\nChange the offer or stop.\n\n## Policies\n\n- [Terms](docs/TERMS.md)\n- [Privacy notice](docs/PRIVACY.md)\n- [Correction process](docs/CORRECTIONS.md)\n- [Implementation analysis in Hebrew](docs/ANALYSIS_HE.md)\n- [Current blockers](docs/BLOCKERS.md)\n- [Paid settlement test](docs/PAID_SETTLEMENT_TEST.md)\n",
  "bytes": 16508,
  "sha": "3d9751cedd534abeffd2c1e200b3773c52c95cdd58821a1d0ffb5e38c7a8b217",
  "repo_slug": "itzikhr18/israel-counterparty-intelligence",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_itzikhr18_israel_business_inte_896caade/readme"
}