Mimir — Context Server: intelligent code context engine for LLMs working with large, multi-repo codebases
Project description
Mimir — Context Server
In Norse mythology, Mimir was the wisest being in all the Nine Realms — guardian of the Well of Wisdom beneath Yggdrasil, the World Tree. Odin sacrificed his eye for a single drink from that well. Mimir brings that same depth of knowledge to your codebase.
Mimir is an intelligent context engine that helps LLMs understand large, multi-repo codebases. Instead of dumping raw files into a prompt, Mimir builds a semantic code graph with real cross-file dependency edges, ranks nodes by relevance and recency, and assembles a minimal, connected, token-budget-aware context bundle — exactly what the model needs, nothing it doesn't.
The Problem
When you ask Claude or GPT to help with a large codebase, you face a brutal choice:
- Too little context — the model hallucinates or misses related code
- Too much context — you burn tokens on irrelevant files and hit limits
- Copy-paste — fragile, manual, doesn't scale across repos
The Solution
Mimir indexes your code into a hierarchical graph of repositories, files, classes, and functions. Cross-file dependencies — function calls, type references, inheritance hierarchies — are resolved into typed edges. At query time, a hybrid search finds seed nodes and a beam search assembles the tightest connected subgraph that answers your question — within your token budget.
Key Features
- Hierarchical beam search — finds connected code paths, not isolated snippets
- Cross-file symbol resolution — automatically discovers
CALLS,USES_TYPE, andINHERITSedges across files using tree-sitter AST analysis - Hybrid search — combines semantic embeddings, BM25 keyword matching, and name/path scoring for precise retrieval
- Live file watching — monitors your repos for changes and re-indexes on every save
- Query intent classification — automatically detects query type (locate, trace, write, debug) and tunes retrieval parameters
- Subgraph expansion — automatically surfaces callers, callees, type definitions, and config references
- Connectivity quality scoring — nodes scored by edge density, embedding presence, and content completeness; gap detection identifies under-indexed areas
- Temporal reranking — recently and frequently changed code scores higher
- Session deduplication — exponential decay model tracks what the LLM remembers
- Write-path context — shows interfaces, sibling implementations, test files, and DI registrations before you edit
- Impact analysis — reverse-traces callers and transitive dependencies to show blast radius
- Architectural guardrails — validates AI-generated changes against structural rules (layer violations, cycles, coupling, blast radius, scope bans) before commit, with agent policy for bounded autonomy and audit logging
- Backstage catalog integration — auto-populates service catalogs from the code graph with dependency drift detection
- Multi-repo — single server spans multiple repositories with cross-repo edge detection
- MCP server — plug-and-play with Claude Desktop, Cursor, and any MCP-compatible IDE
- HTTP API — shared team server for enterprise environments
- Docker-ready — zero Python setup, embedding model pre-baked
- 100% offline — local embeddings, no API keys required for indexing
Quick Start
pip install mimir-context-server
cd /your/project
mimir init # creates mimir.toml
mimir index # builds the semantic code graph
mimir search "how does authentication work?"
mimir serve # start MCP server for your IDE
# Architectural guardrails
mimir guardrail init # generate example rules + agent policy
git diff | mimir guardrail check --diff - # validate changes before committing
Installation
| Package | Install | Who needs it |
|---|---|---|
mimir-context-server |
pipx install mimir-context-server |
Server operators — devs who index repos and run the server |
mimir-server-client |
pipx install mimir-server-client |
Client devs — devs who query a remote server without repos locally |
# Server (full install)
pipx install mimir-context-server
# Client only (lightweight)
pipx install mimir-server-client
# From source
git clone https://github.com/repfly/mimir && cd mimir
pip install -e .
Documentation
| Topic | Description |
|---|---|
| Configuration | mimir.toml reference with all sections and keys |
| How It Works | Indexing pipeline, retrieval pipeline, session dedup, incremental indexing, live watching, quality scoring |
| Serving Modes | Local MCP, shared HTTP server, remote proxy, MCP tools, HTTP API reference |
| Docker Deployment | Build, run, Compose, entrypoint modes, environment variables |
| Workspaces | Per-project isolation and workspace management |
| Web Inspector | Browser-based graph visualization |
| Backstage Integration | Auto-discovered service catalog and dependency drift detection |
| Architectural Guardrails | Rule types, agent policy, enforcement points, audit logging |
| CLI Reference | Full command reference for mimir and mimir-client |
| Architecture | Hexagonal architecture, project structure, data storage, supported languages |
| Contributing | Development setup, testing, PyPI publishing |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mimir_context_server-1.1.3.tar.gz.
File metadata
- Download URL: mimir_context_server-1.1.3.tar.gz
- Upload date:
- Size: 5.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89fca914733006e4563c34ef39ffa18dbff4395110acabd7c7952b2f1f5cf959
|
|
| MD5 |
ca8d0d40b973df7ae46b8014b523ae6b
|
|
| BLAKE2b-256 |
c29b91a408652461e015069aa5a02aa46f9ca6d21756b335bed6762a254b1b64
|
Provenance
The following attestation bundles were made for mimir_context_server-1.1.3.tar.gz:
Publisher:
publish.yml on repfly/mimir-context-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mimir_context_server-1.1.3.tar.gz -
Subject digest:
89fca914733006e4563c34ef39ffa18dbff4395110acabd7c7952b2f1f5cf959 - Sigstore transparency entry: 1283095273
- Sigstore integration time:
-
Permalink:
repfly/mimir-context-server@cabc76e9f4ef52892be70d59fa526e356a571732 -
Branch / Tag:
refs/tags/v1.1.3 - Owner: https://github.com/repfly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cabc76e9f4ef52892be70d59fa526e356a571732 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mimir_context_server-1.1.3-py3-none-any.whl.
File metadata
- Download URL: mimir_context_server-1.1.3-py3-none-any.whl
- Upload date:
- Size: 160.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db3b610ee5dcb406f65549bb54afb125ca7a0e04a4834a0380cf48c8445cf74d
|
|
| MD5 |
f918d7838ad64300e1dbd63801c4db70
|
|
| BLAKE2b-256 |
ec8a6b92d512bc788d314b457cd8131d941567d1f83aa958bb17e86a2c4498d3
|
Provenance
The following attestation bundles were made for mimir_context_server-1.1.3-py3-none-any.whl:
Publisher:
publish.yml on repfly/mimir-context-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mimir_context_server-1.1.3-py3-none-any.whl -
Subject digest:
db3b610ee5dcb406f65549bb54afb125ca7a0e04a4834a0380cf48c8445cf74d - Sigstore transparency entry: 1283095308
- Sigstore integration time:
-
Permalink:
repfly/mimir-context-server@cabc76e9f4ef52892be70d59fa526e356a571732 -
Branch / Tag:
refs/tags/v1.1.3 - Owner: https://github.com/repfly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cabc76e9f4ef52892be70d59fa526e356a571732 -
Trigger Event:
push
-
Statement type: