Zero-OOM Enterprise Engine (Net-New Core Architecture)
This release completely rebuilds the core indexing architecture to scale to massive 50,000+ file monorepos without memory exhaustion or graph loss.
- Asynchronous Background Indexer: Completely eradicated legacy global in-memory maps and lock contention. Replaced with isolated local variables and sequential SQLite streaming (
InsertSymbolNodes).
- Massive-Repo Graph Preservation: Fixed the massive-repo fallback mode to explicitly persist and read import nodes, ensuring dependency graphs (especially for Java) are no longer lost at scale.
- Schema Auto-Migration: Implemented
_v2.db workspace hashing to guarantee clean, native background re-indexing upon major schema upgrades.
Data Loss Prevention & IDE Protection
- API-Level Compression Guardrail (
injector_write_file): Completely eliminated the "Compression Trap." The daemon now aggressively intercepts write operations via a dedicated tool and statically analyzes the payload, hard-rejecting attempts to write fold markers.
- Anti-EOF Handshake State: Removed hard
os.Exit(1) background crashes. Free-tier limit violations now enter a degraded fatalErr state, keeping lightweight tools active and returning graceful JSON-RPC explanations.
Enterprise Resilience
- OS File Watcher Auto-Remediation: Intercepts Linux
inotify queue limit crashes (ENOSPC / "too many open files"). It safely pauses indexing, opens a direct /dev/tty interactive bridge to prompt for a sysctl limit increase, and dynamically resumes.
Surgical Scope Filtering
path_prefixes for Project Maps: Agents can now generate architectural maps strictly scoped to specific microservices or packages, drastically reducing payload bloat.
search_paths for Semantic Search: Allows agents to search for symbols within a specific isolated folder via FTS5 constraints.
Context Window Circuit Breakers
- LIMIT 50 Graph Expander: Added a hard ceiling to
injector_retrieve (expand_graph) to prevent accidental inlining of thousands of 1st-degree dependencies.
- Standard-Library Pruning: Dependency graph explicitly ignores framework bloat (
java.lang.*, java.util.*, go/ast) at query level.
- Diagram Node Breaker: Mermaid generator automatically halts after traversing 500 unique nodes to protect LLM context window.
Agent Feedback Loops
- Raw FTS5 Boolean Logic: Agents can now use advanced SQLite FTS5 syntax (e.g.,
user AND (auth OR login)).
- Self-Correcting Syntax Errors: Daemon intercepts SQLite errors and explicitly returns invalid search syntax payloads.
- Implicit State Synchronization: Added a 3-second non-blocking sync hook (
PendingEvents.Wait()) into read tools. injector_sync is now deprecated.
- Index Desync "Busy" Warnings: Read tools dynamically inject a clear "Results may be stale" warning if the indexer lags by >100 files.
- Diagram Noise Filtering: Added
include_primitives parameter to actively prune language primitives and framework boundaries for crisp business-logic sequences.
Net-New Tools
injector_diagram: Architectural Mermaid sequence generator via BFS traversal.
injector_regex_search: Fallback tool that bypasses FTS5 for native punctuation matching and extended regex syntax.
injector_write_file: Strict, FOLD-aware file-writing bridge mandated for all edits to prevent data loss.
injector_clear_cache: Manual cache wiping tool for automated recovery.
injector_stats: Lightweight repository metrics, replacing the deprecated audit tool.
Agent UX (AX) Overhaul
This patch focuses entirely on feedback from AI Agents (Claude Sonnet 5 & GPT-4o) to drastically reduce their blind retrievals and hallucination loops.
- Zero-Friction Search:
injector_search now returns line_start, line_end, symbol_type, and a context_snippet so agents can instantly verify symbols without wasting tokens on full file retrievals.
- Smart Search Ranking: The BM25 search engine now explicitly ranks symbol definitions (classes, functions, methods) above references and comments to eliminate search noise.
- Sync Transparency:
injector_sync now returns an array of files_reindexed so agents receive immediate, concrete proof that their OS-level edits were picked up by the daemon.
- Agent Proactivity: We updated the MCP tool description for
get_project_map to inject a system prompt override that commands conservative AI agents to proactively use the tool when exploring unfamiliar architectures.
- Explicit Fold Markers: Replaced ambiguous
... (folded) stubs with explicit FOLDWORK: CODE COMPRESSED markers to prevent LLM confusion when reading heavily compressed files.
Agent UX & Stability Fixes
This update solidifies the daemon for AI coding agent workflows by eliminating race conditions and fixing concurrency crashes under heavy load.
- Architectural Stability: Migrated from WASM to native
modernc.org/sqlite to fix OOM panics and database locking issues. Fixed interleaved JSON-RPC payloads by introducing Mutex-locked atomic stdout writes.
- Synchronous File Indexing: Introduced the
injector_sync tool to let AI agents intentionally wait for pending filesystem edits to finish indexing, removing race conditions between writing files and querying the map.
- Surgical Context Extraction:
injector_retrieve now accepts start_line and end_line arguments to retrieve exact snippets rather than massive file dumps.
- Actionable Search Results:
injector_search now explicitly returns the relative FilePath for each matched symbol to allow immediate, zero-guesswork retrieval by AI agents.
- Java Module Intelligence: Implemented robust parsing for Java packages and Spring annotations (
@RestController, @Service, etc.) to semantically group enterprise Spring Boot applications inside a new layer_summary output.
- Read-Only Warnings: The daemon now explicitly warns AI agents via the MCP handshake and JSON responses to prevent them from attempting to modify folded, read-only code.
Initial Release
This is the first public release of mcp-injector. Core architecture highlights include:
- AST body folding for Go, Python, TypeScript, JavaScript, Java, and Rust, achieving 41-89% token reduction on popular real-world repositories.
- Persistent SQLite WAL-mode catalog powered by highly optimized background FSEvents/inotify file watchers.
- Canonical determinism guaranteeing byte-identical output across consecutive runs for maximum Anthropic KV cache hits.
- Branch-aware re-indexing using a lightweight git hook that triggers atomic catalog swaps on branch checkout.
- Always-on secret/credential filtering using Shannon entropy and 16 custom patterns to redact values locally before context delivery.
- Offline Ed25519 license validation for Pro tiers, preserving a zero-telemetry, offline-first execution model.
Exposed MCP Tools
get_project_map: Fetches the compressed catalog structure, module hierarchy, and dependency stubs.
injector_retrieve: Recovers raw, full-body implementations for specific files/methods on-demand.
injector_stats: Reports file counts, current compression ratio, and active workspace status.