Skip to main content

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.

PyPI Python PyPI - Client License: MIT

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, and INHERITS edges 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 indexer run   # builds and publishes the semantic code graph
mimir query search "how does authentication work?"
mimir query 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

Metadata

Release files for mimir-context-server 1.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mimir-context-server 1.1.4
File Size Uploaded Provenance
mimir_context_server-1.1.4.tar.gz 6.0 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mimir-context-server 1.1.4
File Interpreter ABI Platform
mimir_context_server-1.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 6.2 MB

Release files / mimir_context_server-1.1.4.tar.gz

Download URL mimir_context_server-1.1.4.tar.gz
Size 6.0 MB
Tags Source
SHA-256 checksum
How to use checksums
2fd183bac661bb0226bac5ff2b4068e68811f48f2986b51307b0f8f7e0116dbd
BLAKE2b-256 checksum
How to use checksums
41c9ad9f7061f4eabe7603bb5ea6796fa09b26c89f6164bace7364b9e81b0ac3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / mimir_context_server-1.1.4-py3-none-any.whl

Download URL mimir_context_server-1.1.4-py3-none-any.whl
Size 187.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f877224de588d08c7f96c0cf266bca2047e3bdd342dfe823d8dcfae1e8f0ea51
BLAKE2b-256 checksum
How to use checksums
c8eeb3a8dbd962c3a3e0e19e6736248440548548735ae31ffef83cacfa235c2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Security for mimir-context-server 1.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mimir_context_server-1.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page