Go to file
Jeremy Anderson d803e69751 MCP-Drift-State-Tracker initial release 1 2026-06-10 22:04:50 -04:00
.gitignore MCP-Drift-State-Tracker initial release 1 2026-06-10 22:04:50 -04:00
LICENSE MCP-Drift-State-Tracker initial release 1 2026-06-10 22:04:50 -04:00
QuickStart.text MCP-Drift-State-Tracker initial release 1 2026-06-10 22:04:50 -04:00
README.md MCP-Drift-State-Tracker initial release 1 2026-06-10 22:04:50 -04:00
mcp_config.json MCP-Drift-State-Tracker initial release 1 2026-06-10 22:04:50 -04:00
mcp_drift_state_tracker.py MCP-Drift-State-Tracker initial release 1 2026-06-10 22:04:50 -04:00
pyproject.toml MCP-Drift-State-Tracker initial release 1 2026-06-10 22:04:50 -04:00

README.md

MCP-Drift-State-Tracker

An industrial-grade Model Context Protocol (MCP) server engineered to enforce code completeness, intercept context erosion, and neutralize LLM laziness across multi-language repository workspaces.

Optimized for local, high-throughput developer stacks (such as Odysseus, Aider, and Hermes driving local Ollama instances), this tracker acts as a deterministic pre-commit and post-mutation gatekeeper. It eliminates the "laziness trap" (where local models substitute production code with pass, todo!(), or comments) and the "truncation trap" (where attention compression causes functions to collapse mid-generation).


? Core Architecture

Unlike fragile pattern-matching text scanners, MCP-Drift-State-Tracker evaluates code modifications using language-aware structural definitions:

  1. Python AST Driver: Uses native compilation parsing (ast) to capture an explicit footprint of every class, function signature, decorator chain, and package dependency.
  2. Deterministic Brace Scoping Engine: Tracks character-by-character lexical nesting depths to monitor structural boundaries across curly-brace ecosystems, including Rust, Go, TypeScript, JavaScript, C, C++, Java, and C#.
  3. State Persistence Layer: Automatically stores baseline repository structures securely inside a hidden workspace index (.mcp_drift_state.json), ensuring tracking metrics survive agent crashes or tool stack restarts.

? Interception Capabilities

  • The Laziness Trap: Instantly flags and rejects mutations that introduce placeholder stubs or shortcuts (pass, NotImplementedError, todo!(), panic!(), // Insert code here).
  • The Compression Trap: Monitors line-span volatility. If an LLM drops code to save token context window allocations, any function or scope contraction exceeding 50% triggers an immediate blocker.
  • The Dependency Vault: Catches subtle regressions where a model strips package imports, type hints, or critical API annotations (such as @mcp.tool() or #[inline]) during extensive refactors.

? Installation & Integration

Prerequisites

Manage execution isolation cleanly via uv to preserve a pure bare-metal host environment:

# Verify uv availability
uv --version