Repository avatar
Other Tools
v0.1.1
active

paid-mcp

io.github.HGN-ind/paid-mcp

Deterministic UK/US tariff, OpenAPI/NHS FHIR, FCDO/OFAC sanctions & GPDO planning tools (x402/MPP)

Documentation

PaidMCP — Deterministic UK & Global Compliance MCP Server

MCP Registry

PaidMCP is a 100% deterministic, zero-LLM Model Context Protocol (MCP) server built for autonomous AI agents and compliance pipelines. Every tool runs deterministic statutory math, JSON Schema / FHIR validation, or indexed read-only SQLite lookups against SHA-256-verified regulatory snapshots — eliminating LLM hallucinations and per-request inference latency.

  • Live Endpoint: https://paidmcp-api-j7cpz2cyjq-nw.a.run.app/mcp (Streamable HTTP)
  • Service Overview: https://paidmcp-api-j7cpz2cyjq-nw.a.run.app/
  • Agent Discovery Manifest: https://paidmcp-api-j7cpz2cyjq-nw.a.run.app/llms.txt
  • Health & Snapshot Checksum: https://paidmcp-api-j7cpz2cyjq-nw.a.run.app/health
  • Official MCP Registry ID: io.github.HGN-ind/paid-mcp
  • Primary Region: europe-west2 (London)

Tool Catalog (11 Deterministic Tools across 4 Packs)

Discovery methods (initialize, ping, tools/list) and pre-payment Zod input validation are free. Paid tools/call requests settle deterministically via HTTP 402.

ToolPackx402 (Base USDC)Stripe MPP (Card)Purpose
tariff_lookuptariff$0.03$0.50*UK Global Online Tariff (10-digit) & USITC HTS MFN duty, VAT, preferential rates & Section 301/232 remedies
freight_landed_costtariff$0.07$0.50*UK/US landed cost in integer minor units (CIF/FOB, £135 UK de minimis, VAT, Section 301/232, US MPF & HMF)
tariff_lookup_batchtariff$0.75$0.75Bulk UK/US tariff lookup for up to 25 codes in one call ($0.03/code at max batch)
freight_landed_cost_batchtariff$1.00$1.00Bulk UK/US landed cost for up to 20 shipments in one call ($0.05/shipment at max batch)
validate_openapi_31validate$0.03$0.50*OpenAPI 3.1.0 validator (JSON Schema Draft 2020-12, duplicate operationId, local $ref, 2xx & security checks)
validate_fhir_ukcorevalidate$0.06$0.50*HL7 FHIR R4 & NHS England UK Core validator (Mod-11 NHS Numbers, ODS, SDS/GMC/NMC & SNOMED/dm+d codings)
sanctions_screen_entitysanctions$0.03$0.50*UK FCDO & US OFAC SDN entity/vessel screening (NFKD folding, token sorting, Levenshtein & Jaro-Winkler)
sanctions_screen_batchsanctions$0.75$0.75Bulk UK FCDO & US OFAC SDN screening for up to 25 entities in one call ($0.03/entity at max batch)
uk_entity_compliance_checksanctions$0.07$0.50*UK Companies House entity & officer sanctions + insolvency cross-check (PASS / REVIEW / BLOCK)
gpdo_class_a_rear_extensionplanning$0.03$0.50*England GPDO 2015 (SI 2015/596 Sch. 2, Pt. 1, Class A) rear/side extension & Prior Approval calculator
gpdo_outbuilding_and_loft_checkplanning$0.06$0.50*England GPDO 2015 Class E outbuildings & Class B loft additions statutory compliance engine

*Stripe PaymentIntents enforce a $0.50 USD card minimum. For single calls ($0.03–$0.07), pay via x402 Base USDC; for card agents, use the $0.75–$1.00 bulk tools or the $29/mo subscription tier (1,500 calls/mo).


Quickstart

Connect via MCP Client (Streamable HTTP)

Add PaidMCP to Claude Desktop, Cursor, Windsurf, or any Streamable HTTP MCP client:

{
  "mcpServers": {
    "paidmcp": {
      "url": "https://paidmcp-api-j7cpz2cyjq-nw.a.run.app/mcp"
    }
  }
}

Inspect Schemas Without Authentication

curl -sS -X POST "https://paidmcp-api-j7cpz2cyjq-nw.a.run.app/mcp" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Payment Rails

  1. x402 (Live — Base Mainnet USDC): Native HTTP 402 micropayments (PAYMENT-REQUIRED → PAYMENT-SIGNATURE → PAYMENT-RESPONSE) settled on Base (eip155:8453) with exact $0.03–$1.00 pricing and local replay deduplication.
  2. Stripe Machine Payments Protocol (MPP): HTTP 402 Shared Payment Tokens (WWW-Authenticate → Authorization → Payment-Receipt) with Accept: text/html browser redirect to Stripe Checkout.
  3. MCP Marketplace (x-mcp-license-key): Subscription license verification with singleflight coalescing and bounded cache.

Architecture & Security

PaidMCP splits execution into two isolated planes:

  • Plane 1 (src/ — TypeScript / Node 22 on Cloud Run):
    • Zero LLM tokens per request, strict fail-fast Zod config & input validation before payment gating.
    • Non-root container, zero implicit outbound HTTP retries (HTTP_MAX_RETRIES=0), 256 KiB request body cap, 64 KiB upstream response cap, JSON-RPC array batch rejection (400 -32600), and strict CSP/security headers.
    • Read-only SQLite snapshot store verified via SHA-256 checksum, PRAGMA quick_check(1), core table row-count checks, and monotonic builtAtUtc anti-rollback on GCS sync.
  • Plane 2 (supervisor/ — Python 3.12 Cloud Run Job):
    • Daily autonomous regulatory drift monitor for UK Trade Tariff, USITC HTS, UK FCDO Sanctions, and US OFAC SDN.
    • Four hard IAL circuit breakers (budget ceiling, normalized doom-loop breaker, max_retries=0, external gateway cap), strict test-immutability verification gate, secret-scrubbed dead-letter alerts, and atomic GCS snapshot publication.

See SECURITY.md for vulnerability disclosure and hardening controls, and docs/LAUNCH_RUNBOOK.md for full GCP least-privilege deployment steps.


Local Development & Verification

npm install
npm run typecheck
npm test
pytest supervisor/tests

License

Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-only). See LICENSE for full terms.

  • Calling the hosted PaidMCP HTTP /mcp API incurs no copyleft obligations on client agents or applications.
  • Self-hosting or distributing modified copies of the server source requires making source modifications available under AGPL-3.0.

No installation packages available.