ahmedgcompany-cyber/contractrift

Know when the APIs, LLMs and MCP servers you depend on go down — or silently change. Self-hosted API contract & drift monitoring.

TypeScript

0

20 commits

updated Sep 29, 2026

See the code

See what people are saying

SourceMessageScoreDate

(≤ 80 chars, no emoji, no superlatives)

1

Sep 29, 2026

README

ContractRift logo

ContractRift

Know when the APIs, LLMs and MCP servers you depend on go down — or silently change.
Self-hosted · open source · your API keys never leave your servers.

CI Release License: AGPL-3.0 Docker image

Live demo · Website · Quick start · User guide · API · Roadmap

ContractRift dashboard: breaking drift, a model change and an outage

Try it: https://136-119-147-140.sslip.io — read-only demo account shown on the sign-in page, watching the real GitHub API and two public MCP servers.

Why

Third-party APIs change without you changing anything. A field disappears, a type changes, validation tightens, an LLM alias moves to a new model, an MCP server drops a tool. Unit tests use frozen mocks, integration tests run only on pull requests, and uptime monitors only see 200 OK. Teams find out from customers.

The monitoring tools that do catch this are SaaS products that need your production API keys. ContractRift runs on your infrastructure and watches the contract, not just the status code.

What it does

REST / JSON APIsLearns the response structure from scheduled probes. Removed or re-typed fields → breaking; newly-null → warning; new fields → info. Plus status, latency, JSONPath and JSON Schema assertions.
LLM APIsOpenAI-compatible (Chat Completions) and Anthropic (Messages). Detects when the provider reports a different model behind your alias, and when output checks (contains, regex, JSON Schema) stop passing.
MCP serversStreamable HTTP, both the 2026-07-28 stateless protocol and initialize-based servers (auto-detected). Detects removed tools, new required parameters, failing tool calls.
Drift inboxEvery change with path, before → after and severity. Accept (baseline updates) or dismiss (mute that change).
Incidents & alertsIncident after N consecutive failures; HMAC-signed webhooks and Slack with retries and a delivery log.
CI deploy gatenode scripts/contractrift-gate.mjs --tags payments exits non-zero while a dependency is down or has unreviewed breaking drift.
Teams & securityViewer / editor / admin roles, read-only API tokens, audit log, AES-256-GCM encrypted write-only secrets with key rotation, secret URL parameters, SSRF protection, CSP.
Drift inboxMonitor detail with latency chart

Quick start

Docker (embedded PostgreSQL, data in a volume):

docker run -d --name contractrift -p 3000:3000 -v contractrift:/data \
  -e ENCRYPTION_KEY="$(openssl rand -base64 32)" \
  ghcr.io/ahmedgcompany-cyber/contractrift:latest

Open http://localhost:3000 and create the admin account. Keep the ENCRYPTION_KEY value (it encrypts stored API keys). For anything other than localhost over plain HTTP, put it behind HTTPS or add -e COOKIE_SECURE=false.

Docker Compose with PostgreSQL 17: cp .env.example .env, set ENCRYPTION_KEY and POSTGRES_PASSWORD, then docker compose up -d --build.

One-click cloud:

Deploy to Render

From source (Node.js 22.12+):

npm ci
cp .env.example .env && npm run gen-key   # paste the key into ENCRYPTION_KEY
npm run build && npm start

Try it with no real credentials using the bundled fake upstreams:

npm run upstreams -w backend              # fake JSON, OpenAI/Anthropic-format and MCP servers on :4010
# set ALLOW_PRIVATE_TARGETS=true in .env, then:
npm run seed:demo -w backend -- --upstreams http://127.0.0.1:4010

Status

v0.3.0 — functional, tested MVP. 146 unit/integration tests (on embedded PGlite and on PostgreSQL 17 in CI), 11 browser E2E tests, the docker-compose stack exercised in CI, and probes live-tested against the GitHub API, two real MCP servers (DeepWiki, Hugging Face) and a real OpenAI-compatible LLM server. Not yet load-tested. Full, honest status: PROJECT_STATUS.md.

Documentation

DocumentPurpose
INSTALLATION.mdInstall and first run
USER_GUIDE.mdUsing the product
DEPLOYMENT.mdDocker, PostgreSQL, Render, reverse proxy, key rotation, upgrades
API_DOCUMENTATION.md · api/openapi.yamlHTTP API
ARCHITECTURE.md · DATABASE.mdDesign
DEVELOPER_GUIDE.md · CONTRIBUTING.md · AI_DEVELOPMENT_CONTEXT.md · CLAUDE_CODE_GUIDE.mdWorking on the code
SECURITY.md · TROUBLESHOOTING.mdOperations
PRODUCT_SPEC.md · ROADMAP.md · research/Product and research
PROJECT_STATUS.md · CHANGELOG.mdStatus

Tech

TypeScript · Node.js 24 · Fastify 5 · Drizzle ORM · PostgreSQL / PGlite · React 19 · Vite · TanStack Query · Vitest · Playwright.

License

ContractRift is dual-licensed:

  • Open source: GNU AGPL-3.0. Free to use, modify and self-host. If you offer a modified version as a network service, you must publish your changes under the same license.
  • Commercial license: for organizations that cannot use AGPL software or want to embed or resell ContractRift without its obligations. See COMMERCIAL_LICENSE.md.
api-drift
api-monitoring
contract-testing
devops
fastify
llm
llmops
mcp
model-context-protocol
observability
postgresql
react
schema-drift
self-hosted
sre
synthetic-monitoring
typescript

ahmedgcompany-cyber/contractrift

Know when the APIs, LLMs and MCP servers you depend on go down — or silently change. Self-hosted API contract & drift monitoring.

TypeScript

0

20 commits

updated Sep 29, 2026

See the code

See what people are saying

SourceMessageScoreDate

(≤ 80 chars, no emoji, no superlatives)

1

Sep 29, 2026

README

ContractRift logo

ContractRift

Know when the APIs, LLMs and MCP servers you depend on go down — or silently change.
Self-hosted · open source · your API keys never leave your servers.

CI Release License: AGPL-3.0 Docker image

Live demo · Website · Quick start · User guide · API · Roadmap

ContractRift dashboard: breaking drift, a model change and an outage

Try it: https://136-119-147-140.sslip.io — read-only demo account shown on the sign-in page, watching the real GitHub API and two public MCP servers.

Why

Third-party APIs change without you changing anything. A field disappears, a type changes, validation tightens, an LLM alias moves to a new model, an MCP server drops a tool. Unit tests use frozen mocks, integration tests run only on pull requests, and uptime monitors only see 200 OK. Teams find out from customers.

The monitoring tools that do catch this are SaaS products that need your production API keys. ContractRift runs on your infrastructure and watches the contract, not just the status code.

What it does

REST / JSON APIsLearns the response structure from scheduled probes. Removed or re-typed fields → breaking; newly-null → warning; new fields → info. Plus status, latency, JSONPath and JSON Schema assertions.
LLM APIsOpenAI-compatible (Chat Completions) and Anthropic (Messages). Detects when the provider reports a different model behind your alias, and when output checks (contains, regex, JSON Schema) stop passing.
MCP serversStreamable HTTP, both the 2026-07-28 stateless protocol and initialize-based servers (auto-detected). Detects removed tools, new required parameters, failing tool calls.
Drift inboxEvery change with path, before → after and severity. Accept (baseline updates) or dismiss (mute that change).
Incidents & alertsIncident after N consecutive failures; HMAC-signed webhooks and Slack with retries and a delivery log.
CI deploy gatenode scripts/contractrift-gate.mjs --tags payments exits non-zero while a dependency is down or has unreviewed breaking drift.
Teams & securityViewer / editor / admin roles, read-only API tokens, audit log, AES-256-GCM encrypted write-only secrets with key rotation, secret URL parameters, SSRF protection, CSP.
Drift inboxMonitor detail with latency chart

Quick start

Docker (embedded PostgreSQL, data in a volume):

docker run -d --name contractrift -p 3000:3000 -v contractrift:/data \
  -e ENCRYPTION_KEY="$(openssl rand -base64 32)" \
  ghcr.io/ahmedgcompany-cyber/contractrift:latest

Open http://localhost:3000 and create the admin account. Keep the ENCRYPTION_KEY value (it encrypts stored API keys). For anything other than localhost over plain HTTP, put it behind HTTPS or add -e COOKIE_SECURE=false.

Docker Compose with PostgreSQL 17: cp .env.example .env, set ENCRYPTION_KEY and POSTGRES_PASSWORD, then docker compose up -d --build.

One-click cloud:

Deploy to Render

From source (Node.js 22.12+):

npm ci
cp .env.example .env && npm run gen-key   # paste the key into ENCRYPTION_KEY
npm run build && npm start

Try it with no real credentials using the bundled fake upstreams:

npm run upstreams -w backend              # fake JSON, OpenAI/Anthropic-format and MCP servers on :4010
# set ALLOW_PRIVATE_TARGETS=true in .env, then:
npm run seed:demo -w backend -- --upstreams http://127.0.0.1:4010

Status

v0.3.0 — functional, tested MVP. 146 unit/integration tests (on embedded PGlite and on PostgreSQL 17 in CI), 11 browser E2E tests, the docker-compose stack exercised in CI, and probes live-tested against the GitHub API, two real MCP servers (DeepWiki, Hugging Face) and a real OpenAI-compatible LLM server. Not yet load-tested. Full, honest status: PROJECT_STATUS.md.

Documentation

DocumentPurpose
INSTALLATION.mdInstall and first run
USER_GUIDE.mdUsing the product
DEPLOYMENT.mdDocker, PostgreSQL, Render, reverse proxy, key rotation, upgrades
API_DOCUMENTATION.md · api/openapi.yamlHTTP API
ARCHITECTURE.md · DATABASE.mdDesign
DEVELOPER_GUIDE.md · CONTRIBUTING.md · AI_DEVELOPMENT_CONTEXT.md · CLAUDE_CODE_GUIDE.mdWorking on the code
SECURITY.md · TROUBLESHOOTING.mdOperations
PRODUCT_SPEC.md · ROADMAP.md · research/Product and research
PROJECT_STATUS.md · CHANGELOG.mdStatus

Tech

TypeScript · Node.js 24 · Fastify 5 · Drizzle ORM · PostgreSQL / PGlite · React 19 · Vite · TanStack Query · Vitest · Playwright.

License

ContractRift is dual-licensed:

  • Open source: GNU AGPL-3.0. Free to use, modify and self-host. If you offer a modified version as a network service, you must publish your changes under the same license.
  • Commercial license: for organizations that cannot use AGPL software or want to embed or resell ContractRift without its obligations. See COMMERCIAL_LICENSE.md.
api-drift
api-monitoring
contract-testing
devops
fastify
llm
llmops
mcp
model-context-protocol
observability
postgresql
react
schema-drift
self-hosted
sre
synthetic-monitoring
typescript

Languages

TypeScript

87.5%

JavaScript

4.7%

HTML

3.6%

CSS

3.5%