Code Oracle
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Code Oracleverify this patch for cycle issues"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Code Oracle
In-memory patch verification for AI coding agents.
Deterministic AST topology via Tarjan SCC and sub-20ms semantic risk calibration via Tyranid-BERT (164M INT8).
The Problem: Autoregressive Verification Overhead
When coding agents (Claude Code, Cursor, OpenCode, Codex) inspect code modifications, they face three operational bottlenecks:
Confirmation Bias: Generative models reviewing their own diffs frequently rationalize their own logic errors.
Latency and Token Overhead: Re-evaluating complete files through a frontier model introduces 2,000 to 6,000 ms of round-trip latency and consumes output tokens on conversational explanations.
Tool Schema Bloat: Standard MCP servers inject sprawling multi-tool schemas into the prompt context on every turn, reducing effective agent window capacity.
Related MCP server: Symbol Delta Ledger
Architecture
Code Oracle separates code generation from verification, running in-process as an offline gatekeeper.
Tree-sitter builds a localized AST graph from the diff. Tarjan's strongly connected components algorithm checks topological cycles and contract invariants symbolically. For structurally valid patches, Tyranid-BERT (a 164M parameter ModernBERT multi-task model quantized to INT8) scores semantic risk and multi-label taxonomy vectors in under 20 milliseconds on CPU.
Verification Pipeline
flowchart TD
Agent["š¤ AI Coding Agent / Developer<br/>(Claude Code, Cursor, Antigravity)"]
subgraph Engine ["ā” CODE ORACLE ENGINE (< 20-50ms)"]
direction TD
Stage1["Stage 1: Tree-sitter & k-Hop TopoSlice<br/>⢠Multi-language AST parsing (< 8ms)<br/>⢠Extracts callers, callees & interfaces<br/>⢠Isolates k-hop neighborhood graph"]
Stage2{"Stage 2: Deterministic Symbolic Gate<br/>Tarjan's SCC & Contract Invariants"}
HardVeto["š« Hard Veto Early Exit (< 25ms)<br/>Instant rejection on cycles & signature drift"]
Stage3["š§ Stage 3: Tyranid-BERT 164M INT8 Head<br/>⢠Evaluates linearized Micro-DSL subgraph<br/>⢠Sub-20ms ONNX Runtime CPU inference<br/>⢠Multi-Task: Risk Regression, 5-Class Taxonomy & Uncertainty"]
Stage1 --> Stage2
Stage2 -- "Cycle / Invariant Breach" --> HardVeto
Stage2 -- "Topologically Valid" --> Stage3
end
Agent -->|"(1) Proposes Patch / Refactor"| Stage1
HardVeto -->|"(2) Fast-Fail Verdict"| Verdict["šÆ Structured Typed Verdict<br/>VERDICT: APPROVED / REJECTED<br/>Risk Score & Invariant Telemetry"]
Stage3 -->|"(2) Calibrated Verdict"| VerdictKey Characteristics
In-Memory Execution: Evaluates diffs on local CPU via standalone ONNX Runtime. Latency runs under 8 ms for Stage 1-2 symbolic checks and under 20 ms for Stage 3 neural scoring.
Zero Token Overhead: Returns structured status codes and calibrated probability vectors (
Pass,Fail,Risk Score) without autoregressive text generation.Minimal MCP Surface: Exposes a single focused verification endpoint (
verify_patch), saving agent context window tokens.Fully Offline: Operates without external API calls, cloud telemetry, or network access.
Architectural Targets vs. Frontier LLM Review
Metric | Autoregressive LLM Code Review | Code Oracle (Neuro-Symbolic) |
Response Latency | 2,500 ms to 6,500 ms | < 50 ms (Local In-Memory) |
Output Token Cost | 150 to 500 tokens / check | 0 tokens |
Monetary Cost | $0.003 to $0.02 / call | $0.00 (Local / Offline) |
Verification Method | Probabilistic text generation | Deterministic AST + Calibrated Score |
Context Consumption | Multi-KB schema injection | Single-tool lean schema (< 100 tokens) |
Operational Scope and Boundaries
Code Oracle operates within explicit technical boundaries:
Verification Only: Code Oracle validates proposed edits against existing syntax and graph topology. It does not generate, autocomplete, or rewrite source code.
Syntax Gate: Proposed changes must parse into a valid Tree-sitter AST. Syntax errors fail at Stage 1 before invoking graph traversals or neural evaluation.
Static Topology Focus: Checks structural invariants, dependency cycles, and interface contracts. It complements rather than replaces integration test suites or dynamic runtime profilers.
Hardware Footprint: Requires ~150 MB of RAM for INT8 quantized inference via standalone
onnxruntimeon CPU. Zero PyTorch or GPU hardware required.
Pretrained Model Weights
The fine-tuned Tyranid-BERT (164M INT8) multi-task decision head weights are hosted on Hugging Face:
š¤ wxsys/tyranid-bert
Code Oracle automatically downloads and caches these weights to ~/.cache/code_oracle/weights/ on first invocation when --neural is enabled, or reads from local ./weights_base/ if present.
Installation & Quickstart
1. Install via pip
# Core AST Symbolic Verification Engine (< 8ms, zero neural footprint)
pip install code-oracle
# With Tyranid-BERT ONNX Runtime decision model (< 20ms INT8 CPU)
pip install "code-oracle[neural]"
# Full developer setup with test suites & packaging tools
pip install "code-oracle[all]"The core wheel is 142 KB and runs deterministic AST and Tarjan SCC verification with zero neural dependencies. The 145 MB Tyranid-BERT ONNX INT8 model is downloaded on-demand and cached to~/.cache/code_oracle/weights/ on first execution with --neural.
2. FastMCP Server for Coding Agents
Run Code Oracle as an MCP sidecar for Claude Code, Cursor, or Antigravity:
code-oracle serve3. CLI Verification & Analysis
# Verify proposed patch against current repository state
code-oracle verify --patch /path/to/patch.diff
# Incremental workspace symbol indexing
code-oracle index .
# Dead code & orphan symbol scan (0 in-degree reachability)
code-oracle dead-code .
# Static performance anti-pattern & resource leak audit
code-oracle perf-lint .
# Install Git pre-commit verification hook
code-oracle hook installRoadmap
Architecture Specification & Subgraph Slicing Design
TopoSlice AST Slicer & Incremental Workspace Indexer
Tarjan's SCC Cycle Detector & Deterministic Symbolic Gate
Multi-Task Risk Taxonomy (5 Classes) & Epistemic Uncertainty Estimation (ADR-0003)
Embedded Dead Code Semantics Classifier with ModernBERT Representations
Standalone ONNX Runtime Inference & Dynamic INT8 Quantization (
code-oracle export-onnx)Tyranid-BERT Official Model Release (
wxsys/tyranid-bert)Golden Hybrid v3 Multi-Language Dataset (~4,900 balanced samples across Go, Python, TypeScript, Rust)
Lean FastMCP Server interface (
verify_patch)Agentic
SKILL.mddistribution for Claude Code, Cursor, and AntigravityGit pre-commit & pre-push verification hook with unblock toggle (
code-oracle hook)Multi-language AST extractors for Tier 1 languages (Python, TypeScript, Go, Rust)
Dead Code & Orphan Symbol Scanner (
code-oracle dead-codevia 0-in-degree graph reachability)Static Performance Anti-Patterns & Resource Leak Detector (
code-oracle perf-lint: nested loop complexity, unclosed handles)Official Git Tagging & GitHub Release pipeline (
v0.1.0)Python Package Wheel Distribution & PyPI Publishing (
pip install code-oracle)Multi-Agent Ecosystem Integrations (Claude Code, Cursor, Antigravity, OpenCode, and Cline sidecars)
License & Attribution
Distributed under the Apache-2.0 License. See LICENSE for details.
Architect & Maintainer:
Wahyu Febri Tamtomo (@wahyuzero)
Founder of frugaldev.biz.id (Radical AI Efficiency & Frugal Computing).
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Change-aware CI validation and affected-test guidance for coding agents.
Change-aware CI validation and affected-test guidance for coding agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to query a pre-built semantic knowledge graph of code, reducing token usage and tool calls. Supports 16 tools for code exploration, analysis, and context building.14 npm7MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI coding agents to efficiently query code context via a symbol graph, reducing token usage by up to 20x.398 npm490-
- FlicenseAqualityDmaintenanceProvides AI coding agents with dependency analysis, impact detection, and build verification tools.14-
- AlicenseNot gradedqualityCmaintenanceSupercharges AI coding agents with semantic code intelligence, providing pre-built knowledge graphs for surgical context, faster answers, and fewer tool calls.MIT