FalsifySQL MCP Gateway
Runs CI PR Guard over SQL and dbt model files to catch silent semantic failures before merge.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
FalsifySQL — Neurosymbolic Verification, Conformal Plausibility & RLVR Control Plane for AI Data Agents
FalsifySQL is an open-core Neurosymbolic Verification Gateway, Conformal Plausibility Adjudicator, and Reinforcement Learning with Verifiable Rewards (RLVR) Self-Healing Control Plane for AI data agents (Claude, Cursor, LangGraph, Snowflake Cortex, Databricks Genie).
Instead of trusting text-to-SQL wrappers that cheerfully return plausible, silently wrong numbers to executive dashboards, FalsifySQL intercepts queries at the Model Context Protocol (MCP) boundary and attempts to mathematically, structurally, and statistically falsify every query before a result leaves the warehouse.

Full 720p H.264 Captioned Demo Video:
assets/falsifysql_demo.mp4(1280×720, 30s 6-scene walkthrough — ready for LinkedIn / job applications)
Why FalsifySQL? The Silent Semantic Failure Crisis
A syntax error fails safely. The expensive production failure is SQL that compiles cleanly, runs in under a millisecond, and silently corrupts a financial or operational metric:
Fan-Out & Chasm Traps (Grain Multiplication):
SUM(orders.amount)joined to 1:Npaymentsororder_itemssilently inflates a$150order across 3 installments into$450.Snapshot-Sum Overcounts: Summing
inventory_snapshots.inventory_valueacross 90 daily partitions turns$10Mof daily stock into$900M(90× overcount).Partial-Period Comparison Bias: Comparing 12 days of month-to-date revenue against a full 31-day prior month fabricates an artificial collapse.
Fabricated Filter Literals & Implicit Exclusions:
WHERE region = 'APAC'against'Asia-Pacific'silently returns zero rows, while droppingstatus = 'completed'counts churned trials as revenue.Undocumented Regime Breaks & Causal Hallucinations: A mid-quarter
lead_scorecutoff shift (70 → 80) looks like a marketing collapse unless caught by PELT changepoints, and observationalGROUP BYchurn correlations masquerade as causal effects without backdoor + placebo refutation.
Related MCP server: Semantic BI MCP
5-Layer Neurosymbolic & RLVR Architecture

Layer | Core Engine | What It Guarantees |
Gate 1: AST & Empirical Grain-FD ( |
| Single-statement |
Gate 2: Regime, Conformal & SHAP ( |
| Flags structural time-series breaks linked to Living Context commits; enforces distribution-free 95% conformal intervals $P(Y \in \hat{C}_\alpha(X)) \ge 1 - \alpha$; computes Shapley slice attributions & ratio-of-totals invariants. |
Gate 3: Causal Refutation ( |
| Enforces Specify → Identify → Estimate → Refute (placebo permutation + unobserved confounder sensitivity) before allowing causal narration. |
Layer 4: RLVR Repair & Serving ( | Unsloth 4-bit QLoRA GRPO ( | Rewrites broken SQL via grain-safe CTEs / snapshot pins / calibrated |
Layer 5: MCP Gateway & SaaS Plane ( | FastMCP ( | One-line agent integration, versioned analyst-confirmed rules, usage-based Stripe metering, and GitHub Actions SQL PR checks. |
SilentSQL-Bench Results (260 Adversarial Tasks + 20 Clean Controls)

System Configuration | Business Truth Rate (BTR) | False Success Rate (FSR) | Clean Control Precision | Gateway Latency |
Raw Unguarded SQL |
|
|
| — |
Gate 1 Only (Detection) |
|
|
| — |
FalsifySQL Full Control Plane |
|
|
|
|
Reproduce locally in < 10 seconds:
PYTHONPATH=src python3 benchmarks/run_benchmarks.py --assert-btr-min 0.9830-Second Quickstart & Interactive Control Plane
Launch the Zero-Signup Interactive Web Playground & Control Plane (with live AST/Grain SVG topology, PELT + Conformal Canvas, SHAP attributions, Counterexample Micro-DB diff, DoWhy Causal Refutation, and Stripe Meter telemetry):
git clone https://github.com/Sumesh-Chakkaravarthi/falsifysql.git
cd falsifysql
PYTHONPATH=src python3 -m falsifysql.cli playground --port 8787
# Open http://127.0.0.1:8787CLI & MCP Gateway Commands
# Verify & auto-repair a single SQL query via CLI
PYTHONPATH=src python3 -m falsifysql.cli verify \
--sql "SELECT o.order_id, SUM(o.amount) AS rev FROM orders o JOIN payments p ON o.order_id = p.order_id WHERE o.order_id = 1001 GROUP BY o.order_id" \
--prompt "Total revenue for Order 1001"
# Launch stdio MCP server for Claude Desktop / Cursor / Claude Code
PYTHONPATH=src python3 -m falsifysql.cli mcp --transport stdio
# Run CI PR Guard over SQL / dbt files
PYTHONPATH=src python3 -m falsifysql.cli pr-guard path/to/models/
# Validate 4-signal GRPO/RLVR training corpus & rewards (no GPU needed for dry-run)
PYTHONPATH=src python3 -m falsifysql.cli train-grpo --dry-run
# Run full unit & integration test suite (22 tests)
PYTHONPATH=src python3 -m unittest discover -s tests -vRepository Layout
falsifysql/
├── assets/ # Architecture card, SilentSQL-Bench chart, animated demo GIF
├── benchmarks/ # 260-task SilentSQL-Bench generator & evaluation runner
├── deploy/k8s/ # Production Kubernetes Deployment, Service & ConfigMap
├── docs/ # ARCHITECTURE.md, BENCHMARK_REPORT.md, MONETIZATION_AND_COMPLIANCE.md
├── scripts/ # Visual asset generator & macOS AVAssetWriter helper
├── src/falsifysql/
│ ├── sql_ast.py # SQL lexer/AST parser, sqlglot[c] adapter & tenant node injector
│ ├── warehouse/ # Read-only connectors, enterprise demo warehouse, Counterexample Micro-DB
│ ├── gate1/ # Empirical Grain-FD profiler, AST security & deterministic verifiers
│ ├── gate2/ # PELT changepoints, TabICLv2/MAPIE CQR + ACI + Martingale, SHAP & invariants
│ ├── gate3/ # DoWhy/EconML causal DAG, AIPW backdoor & placebo/sensitivity refutation
│ ├── rlvr/ # Silent-bug mutator, 4-signal reward, repair solver, Unsloth/TRL GRPO, vLLM/XGrammar
│ ├── gateway/ # FalsifyPipeline, pgvector Living Context Store, FastMCP, Stripe Meters, PR Guard
│ └── web/ # Flask API + Obsidian Cyber-FinTech Interactive Playground UI
└── tests/ # Comprehensive unit, integration, MCP, and benchmark CI gate testsSee docs/ARCHITECTURE.md, docs/BENCHMARK_REPORT.md, and docs/MONETIZATION_AND_COMPLIANCE.md.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
MCP enforcement layer that intercepts AI agent actions and blocks rule violations before execution.
Zero-trust SQL AST & MCP firewall enforcing tenant isolation, PII scrubbing, and schema allowlists.
Real-time MCP & A2A prompt-injection, jailbreak, and tool-schema poisoning firewall for AI agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceAgentic data quality MCP server — runs structured validation rules against warehouses (DuckDB, BigQuery, Athena, Databricks, Postgres), diagnoses failures with LLM root cause analysis, and proposes SQL remediations. Full audit trail of every AI decision.686 PyPI6Apache 2.0
- FlicenseNot gradedqualityCmaintenanceModel Context Protocol (MCP) server that gives AI assistants a safe, correct data-analyst capability over business metrics - without raw SQL improvisation.-
- AlicenseBqualityBmaintenanceLocal-first MCP server for data quality that finds suspicious data, explains findings with evidence, tracks drift, and supports human-approved, reversible repair workflows. Deterministic by default, with AI optional.25264 PyPI2Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible AI agents to run policy-checked SQL against MySQL through a self-hosted Streamable HTTP endpoint, where each request is authenticated by bearer token and constrained by role-based statement allowlists, timeouts, and row limits. It also provides identity introspection, admin-gated configuration reload, and JSONL audit logging of allowed, denied, and errored queries.1Apache 2.0