MipCode
Provides a git pre-commit hook to intercept commits and enforce L1 contract and blast-radius hydration before file changes are committed.
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., "@MipCodemap this repo and show the blast radius before I edit auth.ts"
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.
MipCode (.mip / .mip.json) v0.4 — 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.
Why MipCode?
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.4 solves both by combining computer-graphics mipmapping (L0–L3), Stateful Fog-of-War resolution gating, and Active Pre-Edit Guardrails:
Mip Level | Resolution Name | Contents | Access & Guardrail Rule |
L0 |
| Active mission, decisions, global rules, and top modules ranked by coupling centrality within a strict token budget + exact | Mounted first via |
L1 |
| Public contracts, 3-tier epistemic rules ( | Required before |
L2 |
| Compact symbol signatures, line spans, outgoing calls, and symbol-filtered inline module constants. | Compact diet by default ( |
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.*)
Tool ( | Purpose |
| Mount budgeted |
| Query the cross-language symbol & call-reference index across all mipmap levels. |
| Progressive |
| 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 ( |
(Legacy lod_* tool aliases and .lod.json containers remain supported for backward compatibility.)
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 gradedqualityAmaintenanceProvides AI coding agents with an embedded knowledge graph and architecture governance tools, enabling blast radius analysis, compliance checks, and smart context extraction from codebases.Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables coding agents to pre-compute repository structure and access structured intelligence briefs, including dependency graphs, hotspots, and blast radius, reducing token usage and improving code understanding.55 npm1-