{
  "markdown": "# FaultKey · CausalLayer MCP Server\n\n[![CI](https://github.com/smq9sn5jck-coder/causallayer-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/smq9sn5jck-coder/causallayer-mcp/actions/workflows/ci.yml)\n[![CodeQL](https://github.com/smq9sn5jck-coder/causallayer-mcp/actions/workflows/codeql.yml/badge.svg)](https://github.com/smq9sn5jck-coder/causallayer-mcp/actions/workflows/codeql.yml)\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/smq9sn5jck-coder/causallayer-mcp/badge)](https://scorecard.dev/viewer/?uri=github.com/smq9sn5jck-coder/causallayer-mcp)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![npm version](https://img.shields.io/npm/v/causallayer-mcp.svg)](https://www.npmjs.com/package/causallayer-mcp)\n[![Cloudflare Workers](https://img.shields.io/badge/Cloudflare-Workers-F38020?logo=cloudflare&logoColor=white)](https://workers.cloudflare.com/)\n[![Model Context Protocol](https://img.shields.io/badge/MCP-Ready-green)](https://modelcontextprotocol.io/)\n[![Live Demo](https://img.shields.io/badge/demo-live-success)](https://mcp.faultkey.com/try)\n[![GitHub Stars](https://img.shields.io/github/stars/smq9sn5jck-coder/causallayer-mcp?style=flat&logo=github)](https://github.com/smq9sn5jck-coder/causallayer-mcp/stargazers)\n[![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)\n[![OpenAPI](https://img.shields.io/badge/OpenAPI-3.1-85ea2d?logo=openapiinitiative&logoColor=white)](./openapi.yaml)\n[![security: ed25519](https://img.shields.io/badge/signing-Ed25519-181717)](./SECURITY.md)\n[![anchored: Bitcoin](https://img.shields.io/badge/anchor-Bitcoin%20%2B%20OpenTimestamps-f7931a?logo=bitcoin&logoColor=white)](https://opentimestamps.org)\n\n<p align=\"center\">\n  <img src=\"./demo.svg\" alt=\"FaultKey CausalLayer MCP — terminal demo showing liability attribution\" width=\"820\" />\n</p>\n\n> **Deterministic fault math for multi-party AI incidents.** When an AI causes harm and three parties argue over who pays, FaultKey returns a signed, Bitcoin-anchored certificate of fault allocation in under 200 ms — no LLM, no probabilistic scoring, no vendor cooperation needed for a third party to verify.\n\nThis is the official [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for the CausalLayer engine, packaged as a Cloudflare Worker. It lets AI agents (Claude Desktop, Cursor, Cline, Continue, Windsurf) call the four core liability-attribution tools without writing a single line of integration code.\n\n> **If this saves you time, [give it a star](https://github.com/smq9sn5jck-coder/causallayer-mcp/stargazers)** — it helps others find it and tells us people care.\n\n## Live demo\n\n> **🎮 [Try the Interactive Demo](https://mcp.faultkey.com/try)** — No setup required. Pick a scenario, click \"Run Analysis\", see real-time liability attribution.\n\nThe public Worker is deployed on Cloudflare's global edge network and is fully functional in standalone demo mode (deterministic responses, watermarked, rate-limited 5 calls / IP / day):\n\n- **Endpoint:** `https://mcp.faultkey.com/mcp` (live, custom domain) \n- **Mirror:** `https://causallayer-mcp-demo.zykm9qkk7j.workers.dev/mcp`\n- **Healthcheck:** [`/healthz`](https://mcp.faultkey.com/try)\n- **Demand telemetry:** [`/stats`](https://mcp.faultkey.com/stats) (public, aggregated, no PII)\n\n## Quick start\n\n### Claude Desktop\n\nAdd this to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows):\n\n```json\n{\n  \"mcpServers\": {\n    \"faultkey\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"causallayer-mcp\"]\n    }\n  }\n}\n```\n\nRestart Claude. Type *\"List the FaultKey tools.\"*\n\n### Cursor\n\nSettings → MCP Servers → Add new:\n\n- **Name:** `faultkey`\n- **Command:** `npx -y causallayer-mcp`\n\n### Cline / Continue / Windsurf\n\n```json\n{\n  \"name\": \"faultkey\",\n  \"command\": \"npx\",\n  \"args\": [\"-y\", \"causallayer-mcp\"]\n}\n```\n\n### Direct HTTP (no CLI)\n\n```bash\ncurl -X POST https://causallayer-mcp-demo.zykm9qkk7j.workers.dev/mcp \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":0,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"test\",\"version\":\"0\"}}}'\n```\n\nThe response includes a `Mcp-Session-Id` header that you reuse for subsequent calls.\n\n## Tools\n\n| Tool | Description | Demo limit | Paid cost |\n|---|---|---|---|\n| `submit_incident` | Submit an AI incident for deterministic liability attribution. Returns a signed `CausalCertificateV1` with per-agent fault allocation, evidence-chain completeness, and Bitcoin-anchored proof. | 5 / IP / day | 50 credits |\n| `verify_certificate` | Independently verify a certificate (signature, Merkle integrity, issuer status) without calling FaultKey. | 50 / IP / day | 1 credit |\n| `get_anchor_status` | Return the index of all Tessera anchor batches or one batch's full JSON (signed Merkle root, OpenTimestamps proof reference). | Unlimited | Free |\n| `query_issuer_registry` | List all trusted CausalLayer issuer public-key fingerprints, status, and validity windows. | Unlimited | Free |\n\n## Why deterministic?\n\nInsurers, banks, and APRA-regulated entities cannot accept LLM-based fault attribution because the same prompt produces different answers on different days. FaultKey uses a closed-form causal scoring algorithm (graph-theoretic, version-pinned, byte-identical reproducible across runs) so two adversarial parties get the same number — that's the whole point.\n\nThe math is published as an Australian Standards-aligned paper. The signed certificate, issuer registry, and Merkle anchor log are all independently verifiable by a third party using only Node's built-in crypto and the [`causallayer-verifier`](https://github.com/smq9sn5jck-coder/causallayer-verifier) tool — no network calls back to the vendor.\n\n## Guardrails (enforced at the Cloudflare edge)\n\n1. **NO-PII** — Payloads are regex-scanned for emails, Tax File Numbers, Medicare numbers, SSNs, and credit cards. Rejected unless the caller sets `pii_acknowledged: true` (which is logged in the certificate as a compliance acknowledgement).\n2. **DETERMINISTIC-ONLY** — The engine rejects any request lacking `deterministic_only: true`. This is the agent's binding acknowledgement that FaultKey output is closed-form, not probabilistic.\n3. **EVIDENCE-REQ** — At least one identified agent and one timestamped event with description must be supplied or the request is rejected with `400 evidence_insufficient`.\n\n## Self-hosting\n\nYou can deploy your own copy to your own Cloudflare account if you want to enforce a corporate firewall, custom rate limits, or bring your own KV namespace:\n\n```bash\ngit clone https://github.com/smq9sn5jck-coder/causallayer-mcp.git\ncd causallayer-mcp\npnpm install\npnpm wrangler kv namespace create LEDGER\n# paste the returned id into wrangler.jsonc\npnpm wrangler deploy\n```\n\nThe CausalLayer engine itself (the closed-form fault math) runs upstream and is available via API key. For self-hosted demos without an upstream, set `STANDALONE_DEMO=true` in `wrangler.jsonc` to short-circuit upstream calls and return deterministic, watermarked responses.\n\n## Architecture\n\n```\n[Claude/Cursor/Cline]  ←→  [npx causallayer-mcp]  ←→  [Cloudflare Worker]  ←→  [CausalLayer engine]\n                              (mcp-remote proxy)         (this repo)            (Fly.io Sydney)\n                                                              ↓\n                                                    [KV: credit ledger]\n                                                    [DO: per-session state]\n                                                    [KV: telemetry buffer]\n```\n\n- **Transport:** Streamable HTTP (per the 2024-11-05 MCP spec — SSE is deprecated)\n- **Session state:** Cloudflare Durable Object (`CausalLayerMCP`), SQLite-backed\n- **Billing:** Cloudflare KV ledger, Stripe Checkout webhook, optional x402 USDC fallback\n- **Demo:** Per-IP daily counter in KV, deterministic fixture responses with `[DEMO]` watermark\n- **Latency:** p50 ≈ 60 ms (cold), 25 ms (warm) on Cloudflare's 300+ POPs\n\n## Pricing\n\n| Tier | Credits | $AUD | Notes |\n|---|---|---|---|\n| Demo | 5 incidents / IP / day | Free | Watermarked responses |\n| Starter | 1,000 | $99 | Stripe Checkout, no SLA |\n| Growth | 10,000 | $749 | + 50 verify, 99.5% SLA |\n| Enterprise | Unmetered | Contact | + dedicated namespace, 99.95% SLA, audit log access |\n\nFor enterprise tenants email **sales@faultkey.com** (or open a GitHub issue with subject \"enterprise inquiry\").\n\n## Interactive Tools\n\n> **Score any AI incident in seconds** — [faultkey.com/score](https://faultkey.com/score) — describe what happened, get a deterministic liability split with dollar exposure, jurisdiction analysis, and a shareable verdict card.\n>\n> **Compare vendor liability profiles** — [faultkey.com/compare](https://faultkey.com/compare) — side-by-side comparison of AI vendors (OpenAI vs Anthropic vs Google etc.) across incident types.\n>\n> **Public accuracy ledger** — [faultkey.com/track-record](https://faultkey.com/track-record) — 7/7 direction match on backtested cases, 3 pending predictions on active litigation.\n\n## License\n\nApache 2.0. See [LICENSE](./LICENSE).\n\n## Support the Project\n\nIf FaultKey helped you understand AI liability, saved you research time, or you just think deterministic fault attribution should exist:\n\n- **⭐ Star this repo** — [github.com/smq9sn5jck-coder/causallayer-mcp](https://github.com/smq9sn5jck-coder/causallayer-mcp/stargazers) (takes 2 seconds, helps others find it)\n- **Share it** — post on LinkedIn, X, or your team Slack\n- **Score an incident** — [faultkey.com/score](https://faultkey.com/score)\n- **Compare vendors** — [faultkey.com/compare](https://faultkey.com/compare)\n- **Join the discussion** — [GitHub Discussions](https://github.com/smq9sn5jck-coder/causallayer-mcp/discussions)\n\n## Built in Brisbane\n\nFaultKey is built in Brisbane, Australia, with data residency in Sydney for APRA-regulated buyers. The team can be reached at hello@faultkey.com.\n",
  "bytes": 10218,
  "sha": "dece6927a805f208ae2d62a7f8fc477ca4f2d50708d9e3ecc45b16ff8d65541c",
  "repo_slug": "smq9sn5jck-coder/causallayer-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_smq9sn5jck_cloud_causallayer_m_4502fa38/readme"
}