Finds the files a coding task touches, so your AI agent reads less. Local CLI and MCP server.
pip install mimry==0.6.3 Copy PIP instructions
On 92 real pull requests, agents read 50% fewer tokens with MIMRY.
If MIMRY saves your agent tokens, please star it.
MIMRY is a command-line tool that tells AI coding agents which files, and which lines in them, to read for a task. It parses a repository into symbols and a dependency graph, keeps the index on your machine, and ranks the files that matter for a task described in plain words. The index is deterministic: the same code gives the same graph, rankings and context pack on Windows, Linux and macOS, and no LLM is involved in building it. Agents call it from the shell or through its MCP server.
uv tool install mimry Requires Python 3.11 or newer on Windows, Linux or macOS. pipx install mimry also works. On distros that block system pip, see Without uv.
The first index downloads the tree-sitter grammars it needs, once per user, and keeps them in a cache.
uv is the recommended way to install MIMRY, but it is not required. MIMRY needs Python 3.11 or newer in an environment of its own. pipx and a venv use the Python 3 on your PATH, which must be 3.11 or newer.
On distros that block system pip, a plain pip install mimry fails with externally-managed-environment. These include Arch, CachyOS, Debian 12 and later, and Ubuntu 23.04 and later, so one of the options above is needed there. Do not use --break-system-packages.
On Arch, sudo pacman -S uv also works. An AUR package is coming, see #64.
mimry upgrade uses the same tool that installed MIMRY, so run it the same way.
The image ghcr.io/jbacalso24/mimry has every tree-sitter grammar built in, so indexing needs no network. Tags are latest, the full version such as 0.5.0, and the minor line such as 0.5.
Mount your repo at /repo and keep the index in a named volume at /cache. Without the volume, each container starts with no index. On Linux, add --user "$(id -u):$(id -g)" so the .mimry/ folder MIMRY writes in your repo belongs to you.
docker run --rm -v "$PWD:/repo" -v mimry-cache:/cache ghcr.io/jbacalso24/mimry init docker run --rm -v "$PWD:/repo" -v mimry-cache:/cache ghcr.io/jbacalso24/mimry index docker run --rm -v "$PWD:/repo" -v mimry-cache:/cache ghcr.io/jbacalso24/mimry find " " For an agent, run the MCP server over stdio with the same mounts:
docker run -i --rm -v "$PWD:/repo" -v mimry-cache:/cache ghcr.io/jbacalso24/mimry mcp In an MCP client config, use the repo's absolute path, because $PWD is not expanded there:
{ "mcpServers": { "mimry": { "command": "docker", "args": ["run", "-i", "--rm", "-v", "/absolute/path/to/repo:/repo", "-v", "mimry-cache:/cache", "ghcr.io/jbacalso24/mimry", "mcp"] } } } Claude Code plugin In Claude Code, the plugin gives the agent the MIMRY skill, the hooks and the MCP server in one step. It needs uv on your PATH and nothing else.
/plugin marketplace add jbacalso24/mimry /plugin install mimry@mimry It replaces mimry install --platform claude-code, so use one or the other.
It installs the skill only; for the MCP server and hooks, run mimry install --platform (see Supported agents).
npx skills add jbacalso24/mimry Quick start Run mimry preflight in your repository with a task description. The first run builds the index.
mimry preflight "Fix session cookie not refreshed when SESSION_REFRESH_EACH_REQUEST is set" Output on the Flask repository:
Start with 1 src/flask/sessions.py name matches · path matches · connected to other matches read first: lines 202-206 (get_cookie_secure), 233-247 (should_set_cookie) 2 src/flask/ctx.py name matches · connected to other matches read first: lines 154-206 (copy_current_request_context), 395-403 (session) 3 src/flask/testing.py name matches · connected to other matches read first: lines 135-183 (session_transaction), 193-202 (_request_from_builder_args) The same result is written to .mimry/mimry-out/context/latest.md as a context pack for the agent, with the matched symbols, related files and the project's test commands.
To have your agent use MIMRY on its own, install it for that agent:
mimry install --platform claude-code Features Feature Description Ranked lookup Ranks files by name, path, content, symbol and graph matches, and shows why each one ranked Line ranges Names the functions, classes or sections to read first in each file Code graph Maps imports, calls and inheritance across 41 languages with tree-sitter Deterministic The same code gives the same symbols, graph, rankings and context pack on every machine; CI checks every change against committed golden values (how) Documents Indexes Markdown, text, PDF, Word, Excel and PowerPoint files alongside code Incremental indexing Re-reads only changed files, and refreshes the index before the main lookups answer Feedback Ranks files recorded as useful higher for similar tasks MCP server Exposes every lookup as an MCP tool Local Runs without an LLM, API key or telemetry, and keeps your code on your machine Supported languages MIMRY parses these languages with tree-sitter for symbols, imports, calls and inheritance.
Fortran is read in free form only. Fixed-form .f and .for files do not parse with the grammar MIMRY uses, so they get no symbols or edges.
.pp and .m are checked first, because most .pp files are Puppet and most .m files are MATLAB. A .pp file is Pascal only when it has a unit, program or library line, and a .m file is Objective-C only when it has an @interface, @implementation, @protocol or #import line. Any other .pp or .m file is indexed as searchable text with no symbols.
The markup and style languages get what an agent searches them by. CSS and SCSS give their class and id selectors, custom properties, keyframes, Sass mixins, functions, placeholders and variables, with @import, @use and @forward as imports. HTML gives each element id and the local stylesheets and scripts it loads. Vue and Svelte give each component (named after its file) and run the JavaScript or TypeScript and CSS or SCSS passes over their and blocks, so their line numbers match the file.
MIMRY also indexes Markdown (headings, links, frontmatter), plain text, PDF, Word, Excel and PowerPoint files. Results name the page, section, sheet or slide that matches.
Some files get more structure than their text:
SQL files name each schema object as the source writes it, such as public.users: tables, views, materialized views, indexes, sequences, schemas and types, and functions, procedures and triggers. A view, function, trigger or index that reads or writes a table gets a call edge to it, and so does a foreign key's REFERENCES target. A plain query or an ALTER TABLE belongs to no object, so it adds no edge. A statement the parser does not know costs only itself, and the objects around it are kept. A trigger written with a BEGIN ... END body gives its name and table, but its body is not read. Files over 256 KiB get no symbols, so a large dump stays text-searchable.
Groovy and Gradle files name each class, interface, trait, enum, method and top-level def function as the source writes it. A Spock feature method keeps its string, such as adds two numbers, as its name. A Gradle task name or tasks.register("name") gives a task, and plugins {} and dependencies {} entries are not symbols. An import of a Groovy class links exactly to the file that declares it, and a wildcard import such as a.b.* links to every file of package a.b. A static wildcard such as import static a.b.C.* links to the file of class C. Calls inside a method body, and the extends and implements clauses of a type, give call and inheritance edges, and a paren-less name arg call counts only for a method of the same file. A piece of a file the parser cannot read costs only itself, so an annotated type such as @Service(Book) keeps its methods. Closure-assigned fields and operator methods such as << are not symbols.
Other extensions can be mapped to a supported language in mimry.toml, see Configuration.
mimry install --platform installs a skill that teaches the agent when to use MIMRY, and registers the MCP server where the agent supports it.
✅ means mimry install sets it up, and manual means you add the MCP server by hand. none means the agent has no MCP support, so the skill alone covers it. not yet means mimry install does not register an MCP server for the agent yet.
See docs/agents.md for where each agent's files go and how its MCP server is registered.
claude mcp add --scope user mimry -- mimry-mcp # Claude Code codex mcp add mimry -- mimry-mcp # Codex Other MCP clients:
{ "mcpServers": { "mimry": { "command": "mimry-mcp" } } } uvx mimry mcp runs the server without installing it.
By default the server lists 9 core tools: mimry_status, mimry_preflight, mimry_find, mimry_related, mimry_symbol, mimry_path, mimry_impact, mimry_why and mimry_feedback. The other tools stay off by default to keep the tool list small, so use the CLI for them unless you ask for them. Set MIMRY_MCP_TOOLS=all in the server's environment to list all 24 tools, or give a comma-separated list of tool names, such as MIMRY_MCP_TOOLS=mimry_find,mimry_path. Commands with no tool, such as mimry callers, mimry callees, mimry bench, mimry doctor, mimry report and mimry install, stay CLI-only. An unknown name prints one line to stderr and falls back to the core tools.
MIMRY is listed in the MCP Registry as io.github.jbacalso24/mimry.
mimry preflight " " # list the files and lines to read first, and write a context pack mimry find " " # rank files for a query mimry symbol # find where a function, class or heading is defined mimry callers # list the functions that call a function, from the graph mimry callees # list the functions a function calls, from the graph mimry related " " # list files connected through imports and calls mimry explain " " # show the key files and symbols, and how they connect mimry why --query " " # explain why a file ranked mimry feedback ... # record which files helped mimry status # check whether the index is current mimry doctor # diagnose the install and the index See docs/commands.md for every command and option. When something misbehaves, see docs/troubleshooting.md.
A mimry.toml at the repository root controls which files are indexed. Commit it so everyone on the team gets the same index.
[index] include = ["src/**", "docs/**"] # index only these paths exclude = ["**/fixtures/**", "legacy/**"] # never index these paths max_file_bytes = 2_000_000 # size limit per file (default 1 MB) [index.languages] ".inc" = "php" # parse .inc files as PHP ".h" = "cpp" # parse .h headers as C++ instead of C MIMRY always skips folders named build, bin, obj, dist, target, node_modules and vendor, at any depth, along with caches and virtual environments. include does not bring them back, so MSBuild project and props files in build/, such as build/Common.props, get no symbols.
Tokens an agent read before it found the code each pull request changed, measured on 92 merged pull requests from 12 open-source projects.
See benchmarks/tokens for the method, per-project results and how to reproduce them.
On the 500 issues of SWE-bench Verified, one mimry find with the issue text puts every file the fix changes in the top 10 for 74.6% of issues, in the top 5 for 63.8%, and first for 34.8%. See benchmarks/localization for the protocol and per-repository results.
To measure MIMRY on your own repository's merged pull requests, run mimry bench; see Benchmark your repository.
Task fastapi/typer#1820 from the holdout2 run: "Respect wait=False when launching URLs with xdg-open". The fix changed typer/main.py. Its 75.3% saving is the median for that run, so it is a typical task, not the best one.
The agent runs seven keyword searches for respect, wait, false, launching, urls, xdg and open, which cost 1,927 tokens. It then reads typer/main.py from the top, up to the benchmark's 2,000-line limit per read, which costs 13,491 tokens. Total: 15,418 tokens.
mimry preflight "Respect wait=False when launching URLs with xdg-open" costs 1,876 tokens. The agent then reads six line ranges in the order of the context pack, which cost 1,937 tokens:
MIMRY opened six files instead of one and still read 75.3% fewer tokens: 3,813 against 15,418.
The numbers come from results.holdout2.ranges.0.4.1.json, measured with MIMRY 0.4.1 in token benchmark run 38884765315. To reproduce them, see Running it.
Indexing and search run locally. Credential files are skipped, secret-looking values are redacted from feedback, and untracked files named in .gitignore are not indexed.
Bug reports and pull requests are welcome. See CONTRIBUTING.md for setup and checks. MIMRY is in public alpha, and its interfaces may change before 1.0.
coding-agents mcp repository-intelligence semantic-search
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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 verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.




