contradiction-mcp
Contradiction MCP lets AI agents ingest external sources, extract factual claims, detect cross-source contradictions, and manage review/resolution workflows.
Check server health, SQLite connectivity, metrics, uptime, and connector status.
List registered data sources/connectors with pagination and type filtering.
Test GitHub, website, or local-file connectivity/access without persisting data.
Sync/ingest local documents, public URLs, and GitHub repos; extract claims with provenance; support batch sync and automatic contradiction discovery.
Scan the whole knowledge base, a source, or a single claim for contradictions with confidence and dismissed-record controls.
Compare two claims for contradiction status, severity, confidence, explanation, and suggested action.
Query claims by subject, predicate, source, environment, and value type; retrieve claim details and chronological history.
Query contradictions by status, severity, type, and confidence; retrieve full details, conflicting claims, evidence, and audit trail.
Generate deterministic resolution advice based on authority, freshness, and evidence.
Review, resolve, dismiss, or reopen contradictions with actor, reason, notes, chosen authoritative claim, and immutable audit history.
Ingests and analyzes GitHub repositories via a dedicated GitHub Connector, extracting structured, line-cited claims from runtime engine configurations, Dockerfiles, GitHub Actions/CI workflow files, and READMEs in order to detect cross-source contradictions and inconsistencies between code, deployment configurations, and documentation.
Contradiction MCP
Autonomous Cross-Source Inconsistency & Contradiction Intelligence Engine for AI Agents
The Problem It Solves
Modern engineering ecosystems rely on fragmented, uncoordinated sources of truth:
Code Repositories:
package.json,Dockerfile, CI/CD workflows (.github/workflows/*.yml)Deployment Manifests: Kubernetes YAML, Helm values, cloud environment configurations
Technical Documentation: Architecture guides, runbooks, developer setup portals, READMEs
Public Endpoints: OpenAPI/Swagger schemas, status feeds, live web documentation
When these systems diverge—for example, a Kubernetes manifest deploying Node.js 22 while technical documentation instructs developers to run Node.js 18, or conflicting database engine versions across staging and production—silent regressions, deploy failures, and hallucinations in LLM reasoning occur.
Contradiction MCP bridges these silos through automated multi-source ingestion, context-aware contradiction reasoning, source authority and freshness scoring, human-in-the-loop review/resolution workflows, and immutable audit trails.
Related MCP server: Mnemoverse Memory
Core Capabilities
Zero Mocks: Real embedded SQLite with Write-Ahead Logging (WAL), real filesystem I/O with directory containment guards, and real HTTP fetchers with pre-flight DNS validation.
Context-Aware Contradiction Engine: Eliminates false positives by understanding semantic contexts:
Environments:
productionvsstagingvsdevelopmentScopes:
filevsdeploymentvsclusterRoles:
source_of_truthvsdeploymentvsdocumentation
Deterministic SemVer Mathematics & Value Type Isolation: Employs rigorous version range satisfaction algebra rather than naive string comparisons. Strict IPv4/IPv6/host type discrimination ensures IP addresses (e.g.
127.0.0.1) are never misclassified as SemVer versions or compared against ports.Namespace-Aware Leaf Predicate Matching: Protects against heading-level false positives. Parameters under shared Markdown headings (e.g.
2_configuration_quantum_config_yaml_hostvs2_configuration_quantum_config_yaml_port) are discriminated by leaf property semantics so unrelated parameters never falsely match.Multi-Column Matrix & Header Delimiter Parsing: Markdown tables automatically skip table header rows and delimiter rows, cleanly extracting multi-column tables into composite property claims (e.g.
python_minimum: 3.12+,python_recommended: 3.13).Visual CI Badge Contradiction Detection: Parses Markdown Shields.io and GitHub Action status badges to uncover visual discrepancies (e.g. conflicting
build_status: passingvsbuild_status: failingbadges).Multi-Source Ingestion Pipeline:
GitHub Connector: Analyzes runtime engines, Dockerfiles, GitHub Actions workflows, and READMEs.
Document Connector: Extracts structured claims from JSON, YAML, Markdown, CSV, TXT, RFC822 (
.eml), and OpenXML (.docx) documents with exact page- and line-numbered evidence citations.Public Website Connector: Web crawler hardened with multi-layer SSRF protection against loopback, private IPv4/IPv6 CIDRs, and cloud metadata endpoints (
169.254.169.254).
Scoring & Advisory Intelligence:
AuthorityScorer: Ranks conflicting claims based on source hierarchy and origin credibility.FreshnessScorer: Applies exponential half-life time decay models.EvidenceEvaluator: Quantifies citation directness and snippet quality.ResolutionAdvisor: Generates actionable resolution recommendations without mutating state without operator consent.
Review & Resolution Workflows: Full lifecycle transitions (
OPEN→REVIEWED→RESOLVED/DISMISSED→REOPENED) backed by append-only audit histories.Dual Transport Architecture: Operates over standard Stdio (for Claude Desktop, Google Antigravity, Cursor) or Streamable HTTP/SSE with Bearer API key authentication and sliding rate limiting.
Limitations & Known Edge Cases
While Contradiction MCP is battle-tested on cross-document and cross-source consistency audits, users and integrating agents should take note of current architectural boundaries and operational edge cases:
Intra-Manifest Hierarchical Collisions (Deeply Nested JSON/YAML/K8s):
Behavior: Key-value extraction flattens object hierarchies into leaf tokens. In complex single manifests (such as Kubernetes deployments or Terraform plans), parameters sharing identical leaf keys across distinct blocks (e.g.,
readinessProbe.initialDelaySecondsvslivenessProbe.initialDelaySeconds, or containerresources.requests.cpuvsresources.limits.cpu) can trigger intra-file candidate comparisons and false-positive warnings.Mitigation: Focus analysis on cross-document source verification or filter by external source boundaries (
sync_source/compare_sources). Full JSON-path namespace scoping is in development for future releases.
Heuristic Claim Extraction vs Nuanced Prose Negations:
Behavior: Heuristic extractors identify explicit version strings, ports, URLs, quantities, and key-value declarations from markdown tables, code fences, and bullet points. Complex natural language nuance, rhetorical negations (e.g., "We initially planned v3.0, but firmly rejected it in favor of v2.4"), or implied conditionals without standard configuration keys might not extract or may produce contradictory assertions requiring manual review.
Mitigation: Use explicit tabular or structured key-value declarations in documentation, or use
create_claimto programmatically ingest claims with verified predicate semantics.
Connector Security Sandboxing & Network Boundaries:
Document Connector: File ingestion is strictly restricted to configured
allowedRoots(default: current workspace). Paths outside these roots or attempts to navigate via directory traversal are rejected by design.Website Connector: Enforces strict SSRF protections, blocking private RFC 1918 subnets, loopback interfaces (
127.0.0.1,localhost), and cloud instance metadata endpoints (169.254.169.254). HTTP redirects are capped at 5 hops to prevent circular redirect exhaustion. Client-side rendered Single-Page Applications (SPAs) requiring JavaScript execution are not executed dynamically; static HTML snapshots or rendered markdown must be supplied.GitHub Connector: Governed by GitHub REST API rate limits (60 requests/hour unauthenticated; 5,000 requests/hour with
GITHUB_TOKEN).
Static Assertions vs Ephemeral Live Infrastructure:
Behavior: The engine analyzes declared assertions across files, repositories, API specs, and documentation. It does not probe live runtime network sockets, ephemeral cloud container states, or uncommitted database rows unless synced as structured state documents.
Pairwise Combinatorial Complexity on Monolithic Manifests:
Behavior: Files producing >1,000 claims increase pairwise combinations quadratically ($O(N^2)$ worst-case prior to subject grouping and similarity pruning).
Mitigation: Bounded file size guards (
MAX_FILE_SIZE_BYTES, default 10MB) prevent memory exhaustion. Partition giant monolithic specifications into modular domain or component manifests.
Environment & Scope Assumptions:
Behavior: Contradiction MCP recognizes disjoint runtime environments (
development,staging,testing,production,deployment,ci). However, if claims are ingested without explicitenvironmentorscopemetadata, the engine conservatively assumes they apply to the same global subject scope.Mitigation: Provide explicit
environmentandscopearguments when syncing sources or creating claims to prevent false positives across heterogeneous environments.
Language & Domain Units:
Behavior: Predicate patterns, quantity normalizers (
GB,MB,ms,s, ports, semantic versions, comma-formatted numbers), and terminology heuristics are tuned for English technical documentation and standard DevOps configurations. Multi-lingual prose extraction without standard keying is planned for future major releases.
System Architecture
Visual Dataflow
flowchart TD
subgraph Clients["MCP Clients & IDEs"]
Claude["Claude Desktop"]
AGY["Google Antigravity"]
Cursor["Cursor IDE"]
HTTP["Remote HTTP / SSE"]
end
subgraph Protocol["MCP Protocol Layer"]
StdioT["StdioServerTransport"]
HttpT["StreamableHttpTransport"]
Router["12 Canonical Tools | 4 Resources | 2 Prompts"]
end
subgraph Core["Analysis & Intelligence Engine"]
Engine["ContradictionEngine"]
Classifier["ContradictionClassifier"]
Authority["AuthorityScorer"]
Freshness["FreshnessScorer"]
Advisor["ResolutionAdvisor"]
end
subgraph Connectors["Ingestion Connectors"]
GH["GitHub Connector"]
DOC["Document Connector (PDF/YAML/JSON/MD)"]
WEB["Website Connector (SSRF Guarded)"]
end
subgraph Storage["Storage Layer"]
DB[(SQLite WAL Mode)]
Audit["Immutable Audit Trail"]
Backups["Online Live Backups"]
end
Claude --> StdioT
AGY --> StdioT
Cursor --> StdioT
HTTP --> HttpT
StdioT --> Router
HttpT --> Router
Router --> Engine
Router --> Connectors
Connectors --> DB
Engine --> Classifier
Engine --> Authority
Engine --> Freshness
Engine --> Advisor
Engine --> DB
DB --> Audit
DB --> BackupsOne-Command Quickstart (All IDEs)
Automatically configure Contradiction MCP into your favorite editor with a single command:
Universal CLI Setup
# Google Antigravity (configured in ~/.gemini/config/mcp_config.json and workspace)
npx -y contradiction-mcp install antigravity
# Cursor IDE (configured in ~/.cursor/mcp.json and workspace)
npx -y contradiction-mcp install cursor
# Claude Desktop App (configured in claude_desktop_config.json)
npx -y contradiction-mcp install claude
# Claude Code CLI (configured in ~/.claude.json & via claude mcp add)
npx -y contradiction-mcp install claude-code
# Windsurf IDE (configured in ~/.codeium/windsurf/mcp_config.json)
npx -y contradiction-mcp install windsurf
# Configure ALL detected IDEs simultaneously
npx -y contradiction-mcp install all
# Or install via Smithery CLI
npx -y smithery mcp add dakshshrivastav56/contradiction-mcpLocal Setup from Cloned Source
git clone https://github.com/Daksh-create349/Contradiction-MCP.git
cd "Contradiction MCP/contradiction-mcp"
npm install
npm run build
# Automatically configure in your current environment:
npm run install-mcp
# Or target a specific IDE:
node bin/cli.js install [antigravity|cursor|claude|claude-code|windsurf|all]Manual IDE Client Configuration
If you prefer manual configuration, add the following configuration block to your client settings:
1. Claude Desktop (claude_desktop_config.json)
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"contradiction": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/contradiction-mcp/dist/index.js"],
"env": {
"NODE_ENV": "production",
"DATABASE_PATH": "/ABSOLUTE/PATH/TO/contradiction-mcp/data/contradiction.db",
"MCP_TRANSPORT": "stdio",
"LOG_LEVEL": "error"
}
}
}
}2. Google Antigravity (mcp_config.json)
Global:
~/.gemini/config/mcp_config.jsonWorkspace:
<workspace-root>/.agents/mcp_config.json
{
"mcpServers": {
"contradiction": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/contradiction-mcp/dist/index.js"],
"env": {
"NODE_ENV": "production",
"DATABASE_PATH": "/ABSOLUTE/PATH/TO/contradiction-mcp/data/contradiction.db",
"MCP_TRANSPORT": "stdio",
"LOG_LEVEL": "error"
}
}
}
}3. Cursor IDE (.cursor/mcp.json)
{
"mcpServers": {
"contradiction": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/contradiction-mcp/dist/index.js"]
}
}
}4. Streamable HTTP Remote Client
Connect distributed agents or team members to a centralized server daemon:
{
"mcpServers": {
"contradiction": {
"url": "http://localhost:3000/mcp",
"headers": {
"Authorization": "Bearer YOUR_SECRET_API_KEY"
}
}
}
}MCP Interface: 12 Canonical Tools, 4 Resources, 2 Prompts
Contradiction MCP exposes 12 canonical tools engineered to the highest specification standards (Glama Tool Definition Quality Score 5.0 / 5.0 Grade A). Every tool strictly follows verb_noun nomenclature, provides rich typed schemas, and isolates distinct operational domains.
Active Canonical MCP Tools (12)
Tool Name | Operational Domain | Description | Key Arguments |
| Diagnostics | Verifies server runtime health, database connectivity, and active connector health |
|
| Discovery | Lists registered knowledge sources and connector types with pagination |
|
| Connectivity | Validates credentials, permissions, and network reachability without persisting data |
|
| Ingestion | Unified ingestion engine for files, Markdown, Word (.docx), JSON, URLs, or Git repositories |
|
| Intelligence | Scans the knowledge base, a source, or a claim for logical/semantic contradictions |
|
| Intelligence | Performs pairwise contradiction and contextual relationship analysis between two claims |
|
| Knowledge Base | Lists extracted factual claims with multi-field filtering and pagination |
|
| Knowledge Base | Retrieves factual claim details, contextual metadata, and audit supersession history |
|
| Lifecycle | Queries detected contradictions filtered by lifecycle status, severity, and confidence |
|
| Lifecycle | Retrieves full contradiction state, conflicting claims, and contextual explanation |
|
| Advisory | Evaluates source authority, freshness, and evidence quality to recommend canonical truth |
|
| Resolution | Executes lifecycle transitions ( |
|
Full Backwards Compatibility: Legacy tool names (health_check, sync_document, sync_website, sync_github_repository, scan_for_contradictions, scan_claim_for_contradictions, scan_source_for_contradictions, explain_claim_relationship, review_contradiction, dismiss_contradiction, reopen_contradiction, get_contradiction_history, get_claim_history, list_connectors, test_github_connection, sync_sources) continue to function without error via automatic request routing and parameter translation.
Active MCP Resources (4)
health://metrics— Static snapshot of uptime, tool invocations, and contradiction tallies.contradiction://{id}— Dynamic resource returning live contradiction state for a specific ID.claim://{id}— Dynamic resource returning factual claim details, context, and provenance.source://{id}— Dynamic resource returning source metadata, type, and trust score.
Active MCP Prompts (2)
investigate_contradiction— Interactive prompt guiding contradiction investigation, context analysis, and resolution.review_source_consistency— Agent prompt guiding systematic cross-source consistency audits.
Example Tool Payloads & Responses
Request:
{
"filePath": "/tmp/deployment_spec.json",
"subject": "api-server",
"scope": "deployment",
"environment": "production",
"sourceRole": "deployment"
}Response:
{
"success": true,
"sourceId": "76be8d2f-1e3b-48fd-922f-1b499251ac2b",
"claimsCreated": 2,
"claimsUpdated": 0
}Request:
{}Response:
{
"status": "completed",
"claimsScanned": 4,
"candidatePairs": 2,
"contradictionsFound": 1,
"contradictions": [
{
"contradictionType": "VERSION_MISMATCH",
"severity": "HIGH",
"confidence": 1.0,
"explanation": "Both claims describe the node_version for 'api-server'. However, architecture_guide.md reports '18.0.0' while deployment_spec.json reports '22.0.0'. Classified as VERSION_MISMATCH with HIGH severity.",
"priorityScore": 0.93,
"contradictionId": "2f1691be-9c1f-4e93-a86a-ef0c0ba54f9d"
}
]
}Request:
{
"contradictionId": "2f1691be-9c1f-4e93-a86a-ef0c0ba54f9d"
}Response:
{
"recommendedClaimId": "a779fa4b-c680-482c-8f31-daf470aaaab7",
"recommendedValue": "22.0.0",
"confidenceScore": 0.88,
"reasoning": "Claim B represents a higher-confidence candidate for current truth because it carries higher operational authority (0.85 vs 0.65) as deployment configuration and is equally fresh.",
"authorityScoreA": 0.65,
"authorityScoreB": 0.85
}Step-by-Step Hands-On Tutorial
Tutorial: Detecting Real Document Contradictions in 30 Seconds
cd contradiction-mcp
# 1. Create two contradictory specifications for the same service:
cat << 'EOF' > /tmp/deployment_spec.json
{
"node_version": "22.0.0",
"database": "postgres-16"
}
EOF
cat << 'EOF' > /tmp/architecture_guide.md
# Architecture Guide
node_version: 18.0.0
database: postgres-14
EOF
# 2. Run test script to ingest and scan via Stdio MCP client:
npx tsx -e '
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
import { Client } from "@modelcontextprotocol/client";
async function main() {
const client = new Client({ name: "tester", version: "1.0.0" }, { capabilities: {} });
await client.connect(new StdioClientTransport({ command: "node", args: ["dist/index.js"] }));
// Ingest Deployment Spec (canonical: sync_source, role: deployment)
await client.callTool({
name: "sync_source",
arguments: { filePath: "/tmp/deployment_spec.json", subject: "api-server", sourceRole: "deployment", environment: "production" }
});
// Ingest Architecture Guide (canonical: sync_source, role: documentation)
await client.callTool({
name: "sync_source",
arguments: { filePath: "/tmp/architecture_guide.md", subject: "api-server", sourceRole: "documentation", environment: "production" }
});
// Automatically scan knowledge base (canonical: scan_contradictions)
const scan = await client.callTool({ name: "scan_contradictions", arguments: {} });
console.log("\nDISCOVERED CONTRADICTIONS:\n", JSON.stringify(JSON.parse(scan.content[0].text), null, 2));
await client.close();
}
main();
'Complete Command Reference
Command | Description |
| Compiles TypeScript and packages SQL migration scripts |
| Launches compiled production server ( |
| Runs development server with on-the-fly TypeScript execution |
| Runs complete Vitest test suite (181 tests across 25 files) |
| Generates detailed V8 code coverage report |
| Runs all 62 end-to-end verification gates (protocol, security, heuristics) |
| Executes live 17-step end-to-end demonstration scenario |
| Launches compiled server and verifies real MCP Stdio connectivity |
| Runs stdio smoke tests followed by Streamable HTTP integration suite |
| Validates TypeScript static typing ( |
| Lints codebase with ESLint 9 Flat Config (0 errors, 0 warnings) |
| Verifies code formatting against Prettier |
| Auto-formats all code using Prettier |
| Automatically configures MCP settings across Antigravity, Cursor, and Claude |
| Executes pending SQLite database schema migrations |
| Seeds database with realistic demonstration claims and sources |
| Creates zero-downtime online SQLite backup in |
| Restores database from a designated backup archive |
| Queries system health status and outputs operational JSON |
| Runs |
Environment Variables
Variable | Default | Description |
|
| Runtime mode: |
|
| Path to SQLite database file or |
|
| Transport mode: |
|
| Port for Streamable HTTP server when |
|
| Binding address for HTTP daemon (DNS rebinding guarded) |
| (optional) | Secret bearer token required for HTTP authentication |
| (optional) | Personal Access Token to prevent GitHub API rate limits |
|
| Logging level: |
|
| Comma-separated directory paths permitted for file ingestion |
|
| Maximum file size allowed for document ingestion |
|
| Maximum requests permitted per sliding time window |
|
| Sliding rate limiter window in milliseconds |
Docker & Container Deployment
Run with Docker
# Build production container (multi-stage, non-root user):
docker build -t contradiction-mcp:latest .
# Run container with persistent data volume:
docker run -d \
--name contradiction-mcp \
-p 3000:3000 \
-v contradiction-data:/app/data \
-e MCP_TRANSPORT=http \
-e HTTP_PORT=3000 \
contradiction-mcp:latestRun with Docker Compose
docker compose up -d
docker compose ps
docker compose logs -fRelease History
v0.3.6 (2026-10-23)
Per-Session Streamable HTTP Server: Created dedicated
McpServerandNodeStreamableHTTPServerTransportinstances per MCP session with stateful session lifecycle routing, eliminating "Server already initialized" errors under multi-client loads with MCP SDK v2.3.x.Configurable HTTP Rate Limits & Bounded Memory: Configurable
RATE_LIMIT_PER_MINUTEfor Streamable HTTP requests with automated eviction of expired client buckets under high churn.Binary Unit & Day Durations: Added precision normalization for binary storage units (
KiB,MiB,GiB,TiB) and multi-day (d) time duration conversions.GitHub Target Parsing & Array Forwarded IPs: Robust parser support for raw GitHub pull request URLs and array-formatted
x-forwarded-forproxy headers.Rate Limiter Strict Boundary: Corrected boundary comparison to ensure exact rate limit ceiling enforcement.
Comprehensive Verification: All 207 tests passing across 26 test suites with 0 typecheck, lint, or security issues.
v0.3.5 (2026-10-18)
NPX Auto-Install Ephemeral Path Fix: Fixed CLI installer (
bin/cli.js) to recognize packages running vianpxor global npm installations, configuring stablenpx -y contradiction-mcpexecution rather than fragile, cache-expiring filesystem paths in IDE configs (Cursor, Antigravity, Claude, Windsurf).Website Connector Redirect SSRF Defense: Enforced
redirect: 'manual'with recursive SSRF target validation ontestConnection, eliminating unauthorized internal metadata / loopback access via HTTP redirects.DocumentConnector Symlink Root Resolution: Ensured
allowedRootsevaluation resolves real paths withfs.realpathSync, preventing falseAccess deniedexceptions on macOS and Linux systems with symlinked temporary directories (/var->/private/var).Composite Similarity Word Boundary Checking: Bound substring comparisons in
ClaimMatcher.calculateCompositeSimilaritywith word boundaries, preventing false positive similarity matches between unrelated words (e.g.portvssupport).Engine Handshake & Version Synchronization: Aligned runtime
SERVER_VERSIONconfiguration to0.3.5across protocol handshakes, MCP server initialization, and health checks.Passing Test Suite: Regression test suite reports 202 passing tests across 26 test suites.
v0.3.4 (2026-10-07)
SemVer Wildcard Ranges: Full support for npm/semver wildcards (
20.x,1.X,*.x), preventing patch releases from falsely contradicting wildcard ranges.Duration Unit Safety: Resolved collision between bare memory unit
mand minutes innormalizeQuantity, correctly treating10mvs600sas equivalent duration.Status & Boolean Normalization:
compareStatusesandinferValueTypeevaluate affirmative (true,yes,enabled,active) and negative (false,no,disabled) equivalences.Orthogonal Memory Limits: Separated base
ram/memoryfrommemory_limitupper caps, preventing container resource limits from colliding with minimum hardware specs.Quote-Aware YAML & Properties Extraction: Fixed regex tokenization to preserve double-quoted strings containing apostrophes.
Sync Summary Metric Fallback: Single-file document and website connector syncs accurately report
filesInspected: 1.
v0.3.1 (2026-09-15)
Security & Extraction Hardening: Replaced shell string execution in
DocumentConnectorwith safeexecFileSync, eliminating command injection vectors in.docxprocessing.Website Connector Redirect Safety: Enforced a strict maximum of 5 HTTP redirects to prevent unbounded redirect loops and guaranteed timeout cleanup on all fetch error paths.
Authority & Specification Role Scoring: Added
'specification'and'deployment'to standard claim source roles with a dedicated authority score of0.75inAuthorityScorer, preventing specification claims from falling into low-confidence fallbacks.Evidence Metadata Alignment: Aligned connector provenance metadata (
lineRange,evidence) withEvidenceEvaluatorandAuthorityScorerschema expectations to accurately quantify citation directness and snippet quality.Deterministic Resolution Tie-Breaking: Enhanced
ResolutionAdvisorto evaluate evidence quality as a deterministic tie-breaker before falling back to'uncertain'.Environment Disjointness Heuristics: Expanded
ContextAnalyzerenvironment comparison to recognize non-overlapping tiers (development,staging,testing,production,deployment,ci), eliminating false-positive contradiction flags across distinct environments.Comma-Formatted Numeric Normalization: Stripped comma separators in
ValueComparator(isLikelyNumber,normalizeQuantity,compareNumbers) so formatted numbers (e.g.,"5,000") compare accurately against integer values.Deterministic Database Pagination: Added SQL
OFFSETsupport and primary key tie-breakers (ORDER BY created_at DESC, id ASC) acrosslistSources,listClaims, andlistContradictionsqueries.Server Tool Delegation Fixes: Delegated
test_connectionto registered connector implementations and forwarded pagination offsets and sync metadata.Expanded Regression Suite: Added dedicated regression test suite (
tests/bugfixes.test.ts), raising test coverage to 181 passing tests across 25 suites.
v0.3.0 (2026-09-14)
12 Canonical Tools Architecture: Streamlined tool interface into 12 orthogonal, strictly typed
verb_nountools (check_health,list_sources,test_connection,sync_source,scan_contradictions,analyze_claim_pair,list_claims,get_claim,list_contradictions,get_contradiction,advise_resolution,resolve_contradiction).Zero-Breaking Backwards Compatibility Routing: Added a transparent request router shim ensuring all legacy tool names continue to function seamlessly with argument translation.
Enhanced OpenXML (.docx) Ingestion: Direct extraction of table structures (
<w:tr>,<w:tc>) as key-value assertions with XML stripping to eliminate duplicate claims.Multi-Format Cross-Document Consistency: Verified cross-referencing and contradiction discovery across Markdown runbooks, JSON configs, and Word architecture documents.
Parametric Claim Queries: Extended SQLite database layer with multi-field filtering (
predicate,environment,valueType,limit,offset).
v0.2.1 (2026-09-14)
22 Active MCP Tools: Full interface alignment including
scan_source_for_contradictionsfor targeted source discovery.Section Heading Namespacing in Markdown: Hierarchical markdown headings (
##to######) namespace nested properties (e.g.### API Gateway$\rightarrow$api_gateway_port), preventing intra-document collisions while matching nested JSON configurations.Precision Predicate Similarity Guard: Enhanced
claimMatcherrequiring $\ge 50%$ token overlap on multi-token phrases, eliminating false matches between distinct properties sharing generic suffixes (node_versionvscache_version,runtime_node_versionvsruntime_python_version).Scoped JSON Extraction: Streamlined
flattenJsonObjectto emit unique composite paths, avoiding leaf key duplication explosions.Numeric Claim Validation: Excluded valid single-digit numbers (
4,3) from short-value extraction warnings.Multi-Format Ingestion: End-to-end verified across Markdown, JSON, OpenXML
.docx, and Kubernetes manifests.
v0.2.0 (2026-09-13)
Initial public release with 21 core MCP tools, SQLite WAL persistence, GitHub, Document, and Website ingestion connectors.
Documentation Index
Architecture Guide — Layered design, protocol topology, and component contracts.
Security Model — Multi-layer SSRF defenses, directory containment, and scope authorizations.
Connectors Reference — GitHub, Document (PDF/JSON/YAML/CSV/TXT), and Website connectors.
Database & Migrations — Schema definitions, audit tables, and WAL configuration.
Operations & Runbook — Online backups, rate limiting, scheduling, and graceful shutdown.
Testing Strategy — Zero-mock philosophy, test suite itemization, and benchmarks.
Practical Examples — Detailed walkthroughs of real-world contradiction scenarios.
License
This project is licensed under the MIT License.
MIT License
Copyright (c) 2026 Daksh Srivastava and Contradiction MCP ContributorsFree and open-source software — you are free to use, modify, distribute, sublicense, and deploy Contradiction MCP in personal and commercial environments.
Available Tools
12 toolscontradiction.claims.analyzeARead-onlyIdempotent
Performs deep comparative analysis between two factual claims to determine whether they contradict each other. Evaluates semantic meaning, value differences, numeric/temporal ranges, and contextual dimensions (environment divergence, scope, source roles). Returns contradiction classification, severity, confidence score, and detailed explanation. Read-only operation.
Inputs: claimAId (required), claimBId (required), explainContext. Returns: severity, confidence, explanation, suggestedAction, +1 more
contradiction.claims.getARead-onlyIdempotent
Retrieves complete details for a single factual claim by ID, including its subject, predicate, current and normalized values, provenance evidence, originating source metadata, and chronological historical value transitions over time. Read-only operation.
Inputs: claimId (required), includeHistory. Returns: claim, history
contradiction.claims.listARead-onlyIdempotent
Queries stored factual assertions and claims extracted from connected sources with flexible filtering by subject, predicate, source, environment, and value type. Read-only operation. Use this tool to explore known facts, find subjects with multiple assertions, or inspect extracted data.
Inputs: limit, offset, subject, sourceId, +3 more. Returns: count, total, claims
contradiction.conflicts.adviseARead-onlyIdempotent
Generates deterministic authority, freshness, and evidence comparison between conflicting claims to advise an AI agent or human reviewer on which claim likely represents current truth and recommended remediation steps. Read-only deterministic calculation.
Inputs: contradictionId (required). Returns: rationale, confidence, contradictionId, recommendedAction
contradiction.conflicts.getARead-onlyIdempotent
Retrieves complete details of a single contradiction record by ID, including full representations of both conflicting claims, originating source metadata, exact line evidence snippets, and chronological audit trail of all review and resolution actions. Read-only operation.
Inputs: contradictionId (required), includeAuditHistory. Returns: auditTrail, contradiction
contradiction.conflicts.listARead-onlyIdempotent
Queries stored contradiction records from the database with filtering by resolution status, severity level, contradiction type, and confidence score. Returns enriched contradiction records with associated claim summaries and originating source details. Read-only operation. Use this tool to prioritize and triage conflicts.
Inputs: type, limit, offset, status, +2 more. Returns: count, total, contradictions
contradiction.conflicts.resolveAIdempotent
Updates the lifecycle status and audit trail of a contradiction record. Supports marking as REVIEWED, resolving as RESOLVED with an authoritative chosen claim, dismissing as DISMISSED (acceptable divergence), or reopening back to OPEN. Preserves an immutable audit trail of reviewer identity, decision reason, and timestamp. Mutating operation.
Inputs: contradictionId (required), actor, notes, action, +3 more. Returns: id, status, chosenClaimId
contradiction.conflicts.scanAIdempotent
Discovers conflicting and inconsistent factual assertions across connected sources. Can scan the entire database, or scope the scan to a specific source, file, or single claim. Uses deterministic candidate grouping, entity resolution, and value comparison algorithms to detect and persist contradictions without duplicates. Mutating and idempotent.
Inputs: limit, claimId, sourceId, minConfidence, +1 more. Returns: count, scannedCount, contradictions
contradiction.health.checkARead-onlyIdempotent
Checks the operational status of the Contradiction MCP server, including SQLite database connectivity, storage metrics, active connectors, and runtime diagnostics. Read-only and safe to invoke frequently for readiness and liveness probing.
Inputs: verbose. Returns: mcp, server, status, metrics, +2 more
contradiction.sources.listARead-onlyIdempotent
Lists all registered external data source connectors (document, website, github) and ingested source entities tracked by the system, including source IDs, synchronization timestamps, and claim counts. Read-only operation. Use this tool to inspect available data sources before initiating scans or synchronization.
Inputs: type, limit, offset. Returns: count, sources, connectors, sourcesCount
contradiction.sources.syncAIdempotent
Ingests and synchronizes one or more external data sources (local document file, public website URL, or GitHub repository), extracts factual claims with exact line provenance, idempotently updates SQLite storage, and triggers automatic contradiction discovery. Mutating and idempotent operation. Supports single source ingestion or concurrent batch synchronization.
Inputs: connector (required), batch, input, scope, +7 more. Returns: status, connector, durationMs, repository, +2 more
contradiction.sources.testARead-onlyIdempotent
Validates connectivity, authentication, and accessibility for an external data source or connector (such as a GitHub repository, web URL, or local file) without persisting any data or modifying state. Use this tool to verify credentials and target reachability prior to running synchronization.
Inputs: target (required), connector (required), branch. Returns: target, message, connector, accessible
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool targets a distinct resource and action: health check, source management, claim inspection/analysis, and conflict discovery/triage/resolution. The descriptions clearly separate the overlapping analysis tools (claims.analyze vs conflicts.advise) by their output purpose.
All tools follow the same dot-separated namespace pattern: contradiction.<resource>.<action>. The action verbs are consistently lowercase and descriptive, creating a predictable and uniform naming convention across the entire toolset.
The 12 tools are well-scoped for a contradiction management service. Each tool serves a clear purpose within source ingestion, claim inspection, conflict scanning, or resolution, with no redundancy or excessive expansion.
The core workflow is well covered: source sync/test, claim retrieval/analysis, conflict discovery/listing/advice/resolution. The only notable gaps are the absence of delete or update operations for sources and claims, but these are not essential for the server's primary contradiction-management purpose.
Maintenance
Related MCP Connectors
One memory for AI agents in Claude Code, Cursor, Codex and ChatGPT that flags conflicting facts.
Psyche audits for AI agents: declared vs self-reported vs revealed objectives, diffed and flagged.
Autonomous and governed SRE & MLOps control plane for AI agent platforms.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenancePersistent decision memory and contradiction detection for AI coding agents. Enforces architectural consistency across sessions — the agent cannot code until it loads prior decisions. Human resolves conflicts on a dashboard or in chat.1MIT
- AlicenseAqualityAmaintenanceHosted memory for AI agents that learns from outcomes, with shared rooms. One key across Claude, Cursor & ChatGPT.11936 npm28MIT
- AlicenseNot gradedqualityFmaintenanceContradiction detector and belief repairer for multi-source facts — ensures knowledge-base consistency across agent sessions.MIT
- AlicenseAqualityCmaintenanceShared, versioned memory and governance control plane for AI coding agents. Compiler pipeline resolves architectural decision conflicts across Claude Code, Cursor, and custom agent fleets.36MIT