MipCode
Provides a git pre-commit hook to intercept commits and enforce L1 contract and blast-radius hydration before file changes are committed.
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.
MipCode (.mip / .mip.json) v0.5 — Architectural Mipmaps & Stateful Pre-Edit Guardrails for AI Coding Agents
Architectural Mipmaps + Stateful Pre-Edit Guardrails: Compile any polyglot repository (
Rust,Python,TypeScript/JS) into a self-contained.mip.json(.mip) container with incremental SQLite caching, Stateful "Fog-of-War" Resolution Gating, Production-First Blast-Radius Analysis, and a Zero-Tax Compact Markdown Wire Protocol.
"Semantic LOD v0.5 treats a codebase not as a flat file tree, but as a 3D surface geometry rendered under dynamic task lighting. By borrowing anisotropic filtering, BRDF shading, and ray-casting from computer graphics, .lod solves the multi-file byte-budget bottleneck—delivering blazing-fast cross-cutting execution traces while maintaining strict architectural governance through its stateful MMU."
The Dual Problem: Starvation vs. Overload
When coding agents modify complex repositories, two failure modes dominate:
Context Starvation (Flat RepoMaps / Naive Lexical Search): Signature dumps and raw grep strip out project-level decisions (
DEC-01), doc-comment invariants (//! INVARIANT), inline module constants, and cross-language coupling. The agent edits a signature or constant and triggers cascading regressions across uninspected callers.Context Overload (Verbose JSON / Raw File Dumps): Dumping entire files or repeating verbose JSON schemas and 64-character SHA-256 hashes per line exhausts tight agent token and byte budgets before the agent can inspect all affected callers.
MipCode v0.5 solves both by combining computer-graphics mipmapping (L0–L3), Stateful Fog-of-War resolution gating, Active Pre-Edit Guardrails, and anisotropic ray-slicing:
Mip Level | Resolution Name | Contents | Access & Guardrail Rule |
L0 |
| Top modules by PageRank centrality, project decisions ( | Always accessible without pre-conditions. |
L1 |
| Extracted module facts ( | Required before requesting |
L2 |
| Compact module symbol index with non-zero child counts or full function/class signatures + docstrings + auto-inlined module constants. | Accessible once |
L3 |
| Exact 1-based line-numbered source slices + auto-inlined referenced constants unpacked from embedded | Gated by Fog-of-War: Jumping straight to |
Related MCP server: Hoplon
MCP Tool Namespace (mip.* / Dual-Layer Tool Surface)
MipCode v0.5 establishes a Dual-Layer Architecture: the public MCP interface uses intuitive developer verbs so agents never burn reasoning tokens translating graphics jargon, while the under-the-hood engine executes the physical simulation model (BRDF shading, foveated raycasting, ambient occlusion).
Upgraded Public MCP Tool | What It Does | Engine Alias |
| Mount budgeted |
|
| Query the cross-language symbol & call-reference index across all mipmap levels. |
|
| If |
|
| Cross-file foveated call-graph tracer. Hop 0/1 render foveated L3 source; hop 2+ stays at L2 signatures. Host-module |
|
| Transitive BFS blast-radius analysis ranking production callers ahead of test callers and separating executable calls from docstrings/prose/imports. |
|
| Single-call Pre-Edit Guardrail packet rendered in Compact Markdown ( |
|
| Host Pre-Edit Interception Hook ( |
|
| Governed working-context writeback backed by cryptographic hydration receipts ( |
|
(All legacy lod_* tool aliases and .lod.json containers remain fully supported for 100% backward compatibility. Detailed anisotropic insights and mathematical foundations are documented in ANISOTROPIC_INSIGHTS.md and docs/NAMING_AND_TOOL_ALIGNMENT_V05.md.)
Origins: Why Passive Multi-Resolution Summaries Weren't Enough
MipCode began as an empirical investigation into hierarchical context compression (often discussed conceptually as "Semantic LOD" or multi-resolution repo summaries). Across five heldout benchmark iterations (v0.1 $\rightarrow$ v0.4), we discovered that passive hierarchical text summaries alone fail as a replacement for rg + file reads:
Under equal byte budgets, verbose JSON multi-resolution schemas lose to fast lexical grep (
rg) on pure navigation tasks.Coding agents routinely ignore passive
expand_whenadvisory hints when rushing to patch a file.
What actually moved first-attempt cross-module refactoring pass rates from 0% to 100% was replacing passive summaries with MipCode's active guardrail architecture:
Stateful "Fog-of-War" Session Gating & Pre-Edit Hooks (
mip.verify_edit/mip.guardrail) that actively intercept blind edits (exit_code=2/exit_code=3) and auto-hydrate missing contracts and blast-radius callers.Three-Tier Epistemic Typing (
EXTRACTED_FACT,DECLARED_RULE,HEURISTIC_HAZARD) + explicit omission accounting (l0_loss,omitted_at_l1).Production-First Blast Radius (
mip.blast) separating genuine executable call sites from docstring/comment prose mentions and import statements.Zero-Tax Compact Markdown Wire Protocol (
render_compact_markdown) cutting agent wire overhead by79%–86%while preserving internalSHA-256provenance.
Quick Start
1. Install
pip install -e .
# Optional: enable native Tree-Sitter AST backend and MCP SDK
pip install -e ".[ast,mcp]"2. Compile a .mip.json Container (Full or Incremental)
python -m mipcode.compiler demo_engine 500 --mip --incremental3. Run the Pre-Edit Guardrail Audit on Any Repository
python -m mipcode.real_repo_deploy demo_engine sym://src/projection.rs#OwnedProposal --markdown4. Run the Full Multi-Condition Benchmark Suite
python -m mipcode.benchmark demo_engine --live-agentLicense
Apache License 2.0 — Copyright 2026 Brian Gansz. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Code-map tools for AI agents: see a repo's structure first, then edit only what matters.
Enforces architectural invariants and code quality rules inside your AI agent's edit loop.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI coding assistants to perform high-speed structural codebase analysis and dynamic context management by mapping repositories as byte-streams and detecting architectural chaos.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents and hosts to enforce deterministic repository boundaries via MCP, providing structured reads, supervised edits, snapshots, audits, and recovery with machine-readable evidence.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to access evidence-backed repository memory, code graph, project DNA, and deterministic change validation so they understand design decisions, past bugs, and invariants while working.830 npm15Functional Source , Version 1.1, ALv2 Future
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to automatically compile the most relevant slice of a repository into context for a given task.12 npm1MIT