
Autonomous Model Context Protocol (MCP) engine for factual consistency, version reconciliation, and
Autonomous Model Context Protocol (MCP) engine for factual consistency, version reconciliation, and conflict resolution across engineering knowledge bases.
Autonomous Cross-Source Inconsistency & Contradiction Intelligence Engine for AI Agents
Problem • Capabilities • Limitations • Architecture • Quickstart • Tools Reference • Tutorials • Docs • License
[!NOTE]
Project Status: Active Development (v0.3.1)
Contradiction MCP is currently under active development. Core multi-format document ingestion (Markdown, RFC822
.eml, OpenXML.docx, and JSON) and cross-document contradiction discovery are operational and verified. Heuristic classifiers, deep JSON scoping, and public APIs are actively evolving prior to v1.0.0.
Modern engineering ecosystems rely on fragmented, uncoordinated sources of truth:
package.json, Dockerfile, CI/CD workflows (.github/workflows/*.yml)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.
production vs staging vs developmentfile vs deployment vs clustersource_of_truth vs deployment vs documentation127.0.0.1) are never misclassified as SemVer versions or compared against ports.2_configuration_quantum_config_yaml_host vs 2_configuration_quantum_config_yaml_port) are discriminated by leaf property semantics so unrelated parameters never falsely match.python_minimum: 3.12+, python_recommended: 3.13).build_status: passing vs build_status: failing badges)..eml), and OpenXML (.docx) documents with exact page- and line-numbered evidence citations.169.254.169.254).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.OPEN → REVIEWED → RESOLVED / DISMISSED → REOPENED) backed by append-only audit histories.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):
readinessProbe.initialDelaySeconds vs livenessProbe.initialDelaySeconds, or container resources.requests.cpu vs resources.limits.cpu) can trigger intra-file candidate comparisons and false-positive warnings.sync_source / compare_sources). Full JSON-path namespace scoping is in development for future releases.Heuristic Claim Extraction vs Nuanced Prose Negations:
create_claim to programmatically ingest claims with verified predicate semantics.Connector Security Sandboxing & Network Boundaries:
allowedRoots (default: current workspace). Paths outside these roots or attempts to navigate via directory traversal are rejected by design.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_TOKEN).Static Assertions vs Ephemeral Live Infrastructure:
Pairwise Combinatorial Complexity on Monolithic Manifests:
MAX_FILE_SIZE_BYTES, default 10MB) prevent memory exhaustion. Partition giant monolithic specifications into modular domain or component manifests.Environment & Scope Assumptions:
development, staging, testing, production, deployment, ci). However, if claims are ingested without explicit environment or scope metadata, the engine conservatively assumes they apply to the same global subject scope.environment and scope arguments when syncing sources or creating claims to prevent false positives across heterogeneous environments.Language & Domain Units:
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.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 --> BackupsAutomatically configure Contradiction MCP into your favorite editor with a single command:
# 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-mcpgit 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]If you prefer manual configuration, add the following configuration block to your client settings:
claude_desktop_config.json)~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.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"
}
}
}
}mcp_config.json)~/.gemini/config/mcp_config.json<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"
}
}
}
}.cursor/mcp.json){
"mcpServers": {
"contradiction": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/contradiction-mcp/dist/index.js"]
}
}
}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"
}
}
}
}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.
| Tool Name | Operational Domain | Description | Key Arguments |
|---|---|---|---|
check_health | Diagnostics | Verifies server runtime health, database connectivity, and active connector health | {} |
list_sources | Discovery | Lists registered knowledge sources and connector types with pagination | type, limit, offset |
test_connection | Connectivity | Validates credentials, permissions, and network reachability without persisting data | type, target, credentials |
sync_source | Ingestion | Unified ingestion engine for files, Markdown, Word (.docx), JSON, URLs, or Git repositories | sourceId OR (filePath / url / owner+repo), subject |
scan_contradictions | Intelligence | Scans the knowledge base, a source, or a claim for logical/semantic contradictions | sourceId, claimId, limit, minConfidence, includeDismissed |
analyze_claim_pair | Intelligence | Performs pairwise contradiction and contextual relationship analysis between two claims | claimIdA, claimIdB |
list_claims | Knowledge Base | Lists extracted factual claims with multi-field filtering and pagination | sourceId, subject, predicate, environment, limit, offset |
get_claim | Knowledge Base | Retrieves factual claim details, contextual metadata, and audit supersession history | claimId |
list_contradictions | Lifecycle | Queries detected contradictions filtered by lifecycle status, severity, and confidence | status, severity, minConfidence, limit, offset |
get_contradiction | Lifecycle | Retrieves full contradiction state, conflicting claims, and contextual explanation | contradictionId |
advise_resolution | Advisory | Evaluates source authority, freshness, and evidence quality to recommend canonical truth | contradictionId |
resolve_contradiction | Resolution | Executes lifecycle transitions (REVIEW, RESOLVE, DISMISS, REOPEN) with audit trail | contradictionId, action, actor, reason, canonicalClaimId |
[!TIP] 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.
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.investigate_contradiction — Interactive prompt guiding contradiction investigation, context analysis, and resolution.review_source_consistency — Agent prompt guiding systematic cross-source consistency audits.sync_source / legacy: sync_document)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
}scan_contradictions / legacy: scan_for_contradictions)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"
}
]
}advise_resolution)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
}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();
'| Command | Description |
|---|---|
npm run build | Compiles TypeScript and packages SQL migration scripts |
npm start | Launches compiled production server (node dist/index.js) |
npm run dev | Runs development server with on-the-fly TypeScript execution |
npm test | Runs complete Vitest test suite (181 tests across 25 files) |
npm run test:coverage | Generates detailed V8 code coverage report |
npm run verify | Runs all 62 end-to-end verification gates (protocol, security, heuristics) |
npm run demo | Executes live 17-step end-to-end demonstration scenario |
npm run smoke | Launches compiled server and verifies real MCP Stdio connectivity |
npm run live-test | Runs stdio smoke tests followed by Streamable HTTP integration suite |
npm run typecheck | Validates TypeScript static typing (tsc --noEmit) with 0 errors |
npm run lint | Lints codebase with ESLint 9 Flat Config (0 errors, 0 warnings) |
npm run format:check | Verifies code formatting against Prettier |
npm run format | Auto-formats all code using Prettier |
npm run install-mcp | Automatically configures MCP settings across Antigravity, Cursor, and Claude |
npm run migrate | Executes pending SQLite database schema migrations |
npm run seed | Seeds database with realistic demonstration claims and sources |
npm run backup | Creates zero-downtime online SQLite backup in backups/ |
npm run restore <path> | Restores database from a designated backup archive |
npm run health | Queries system health status and outputs operational JSON |
npm run security:check | Runs npm audit to inspect dependency security vulnerabilities |
| Variable | Default | Description |
|---|---|---|
NODE_ENV | development | Runtime mode: development, test, or production |
DATABASE_PATH | ./data/contradiction.db | Path to SQLite database file or :memory: |
MCP_TRANSPORT | stdio | Transport mode: stdio or http |
HTTP_PORT | 3000 | Port for Streamable HTTP server when MCP_TRANSPORT=http |
HTTP_HOST | 127.0.0.1 | Binding address for HTTP daemon (DNS rebinding guarded) |
API_KEY | (optional) | Secret bearer token required for HTTP authentication |
GITHUB_TOKEN | (optional) | Personal Access Token to prevent GitHub API rate limits |
LOG_LEVEL | error | Logging level: debug, info, warn, error |
ALLOWED_ROOTS | . | Comma-separated directory paths permitted for file ingestion |
MAX_FILE_SIZE_BYTES | 10485760 (10MB) | Maximum file size allowed for document ingestion |
RATE_LIMIT_MAX | 100 | Maximum requests permitted per sliding time window |
RATE_LIMIT_WINDOW_MS | 60000 (1 min) | Sliding rate limiter window in milliseconds |
# 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:latestdocker compose up -d
docker compose ps
docker compose logs -fDocumentConnector with safe execFileSync, eliminating command injection vectors in .docx processing.'specification' and 'deployment' to standard claim source roles with a dedicated authority score of 0.75 in AuthorityScorer, preventing specification claims from falling into low-confidence fallbacks.lineRange, evidence) with EvidenceEvaluator and AuthorityScorer schema expectations to accurately quantify citation directness and snippet quality.ResolutionAdvisor to evaluate evidence quality as a deterministic tie-breaker before falling back to 'uncertain'.ContextAnalyzer environment comparison to recognize non-overlapping tiers (development, staging, testing, production, deployment, ci), eliminating false-positive contradiction flags across distinct environments.ValueComparator (isLikelyNumber, normalizeQuantity, compareNumbers) so formatted numbers (e.g., "5,000") compare accurately against integer values.OFFSET support and primary key tie-breakers (ORDER BY created_at DESC, id ASC) across listSources, listClaims, and listContradictions queries.test_connection to registered connector implementations and forwarded pagination offsets and sync metadata.tests/bugfixes.test.ts), raising test coverage to 181 passing tests across 25 suites.verb_noun tools (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).<w:tr>, <w:tc>) as key-value assertions with XML stripping to eliminate duplicate claims.predicate, environment, valueType, limit, offset).scan_source_for_contradictions for targeted source discovery.## to ######) namespace nested properties (e.g. ### API Gateway $\rightarrow$ api_gateway_port), preventing intra-document collisions while matching nested JSON configurations.claimMatcher requiring $\ge 50%$ token overlap on multi-token phrases, eliminating false matches between distinct properties sharing generic suffixes (node_version vs cache_version, runtime_node_version vs runtime_python_version).flattenJsonObject to emit unique composite paths, avoiding leaf key duplication explosions.4, 3) from short-value extraction warnings..docx, and Kubernetes manifests.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.
Pick your client and paste the snippet. Each one is the same server, written the way that client expects it.
claude mcp add contradiction -- node /ABSOLUTE/PATH/TO/contradiction-mcp/dist/index.js{
"mcpServers": {
"contradiction": {
"env": {
"NODE_ENV": "",
"LOG_LEVEL": "",
"DATABASE_PATH": "",
"MCP_TRANSPORT": ""
},
"args": [
"/ABSOLUTE/PATH/TO/contradiction-mcp/dist/index.js"
],
"command": "node"
}
}
}code --add-mcp '{"name":"contradiction","env":{"NODE_ENV":"","LOG_LEVEL":"","DATABASE_PATH":"","MCP_TRANSPORT":""},"args":["/ABSOLUTE/PATH/TO/contradiction-mcp/dist/index.js"],"command":"node"}'[mcp_servers.contradiction]
command = "node"
args = ["/ABSOLUTE/PATH/TO/contradiction-mcp/dist/index.js"]Runs locally on your device. Your client starts the server itself, so nothing has to be hosted.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/contradiction-mcp to learn what the "Contradiction MCP" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
npx -y contradiction-mcp install antigravity
npx -y contradiction-mcp install cursor
npx -y contradiction-mcp install claude
npx -y contradiction-mcp install claude-code
npx -y contradiction-mcp install windsurf
npx -y contradiction-mcp install allThis server runs locally, so we can't read its tool list over the web yet.
Maintain this server? Claiming proves you own the listing and earns the last 4 points.
Claim this listingPaste this line near the top of your repository's README. The badge always renders the current score.
[](https://aiagentslisting.com/mcp/contradiction-mcp)Nothing comparable is listed yet.
v0.3.2v0.3.2 - Contradiction MCP ServerRelease notesv0.3.1v0.3.1 - Contradiction MCP ServerRelease notesv0.3.0v0.3.0 - Contradiction MCP ServerRelease notesv0.2.1v0.2.1 - Contradiction MCP ServerRelease notesv0.2.0v0.2.0 - Contradiction MCP ServerRelease notesv0.1.1v0.1.1 - Contradiction MCP ServerRelease notesv0.1.0v0.1.0 - Contradiction MCP ServerRelease notesConnect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "contradiction-mcp" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
One email a week. New agents, MCP servers and skills, and what is actually getting traction.