CLI tool
mixedbread-ai/mgrep avatar
mixedbread-ai/mgrep

mgrep puts a natural language question in front of grep

A calm, CLI-native way to semantically grep everything, like code, images, pdfs and more.

4,437 stars177 forksTypeScriptApache-2.0

At a glance

What is it?
mgrep is a TypeScript CLI from Mixedbread that answers questions about a git repository in plain language instead of exact patterns, and sends the code to Mixedbread's hosted search to do it. It complements grep rather than replacing it, and its default index caps will surprise you on a large monorepo.
Who is it for?
Adopt mgrep for onboarding, feature discovery and questions where you cannot guess the naming pattern a previous engineer used, and skip it for symbol tracing, regex refactoring or any repository you are not allowed to send to a hosted service.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Activity is slowing. The repository last received commits 6 months ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • mixedbread-ai/mgrep4,437 ★ · +30
Star history
Repository2026-09-282026-11-15
mixedbread-ai/mgrep4.4k4.4k

30 Stars in the last 48 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

grep from 1973, and the naming you have to guess first

Exact pattern matching asks you to know the answer before you ask the question. grep was written in 1973, and the project's own argument is that its limits show up on large codebases, where it slows down most and where deeply buried business logic cannot be described well enough to match. The failure mode is specific: you cannot name what you do not know, so you try identifier variants one after another until something hits.

That pattern is worse with a coding agent in the loop. The README describes an agent firing hundreds of patterns, filling its token window and your invoice along with it. mgrep's answer is to let you type a sentence and match on meaning instead, so the retrieval work happens in a service rather than in your context window. Search is described as semantic, multilingual and multimodal, with audio and video support listed as coming soon rather than shipped.

mgrep watch syncs your files to a hosted store before you search anything

Indexing is not a local sidecar. `mgrep watch` performs an initial sync, respects `.gitignore`, then keeps the Mixedbread store updated as files change, and the CLI authenticates against a hosted account with `mgrep login` or the `MXBAI_API_KEY` environment variable. Queries run on top of that remote index. Whatever your organization allows in a terminal, it also allows to Mixedbread.

Usage is visible on the Mixedbread platform, which matters when you are deciding whether a repo is worth indexing. The CLI itself ships under Apache-2.0.

The 1MB file cap and 1,000 files per directory decide what you can find

mgrep enforces default limits on every index: a maximum file size of 1MB per file and a maximum file count of 1,000 files per directory. Both are adjustable through the `--max-file-size` and `--max-file-count` CLI flags, environment variables, or config files, and the README points to its configuration section for the details.

The consequence is that a monorepo will not answer the question you asked it. A directory holding more than 1,000 files hits the per-directory file count limit, and a file over 1MB, such as a generated bundle, exceeds the size limit.

Raising `--max-file-size` and `--max-file-count` before your first index is the difference between a useful answer and a confident wrong one. Background sync changes the calculation too: files you did not edit are already indexed by the time you go looking for them.

Installing the CLI, authenticating, and asking the first question

The package is published to npm under the `@mixedbread/mgrep` scope, with pnpm and bun named as alternatives.

bash
npm install -g @mixedbread/mgrep    # or pnpm / bun

Authentication happens in a browser, or through an API key in CI and headless environments.

bash
mgrep login
bash
export MXBAI_API_KEY=your_api_key_here

Move into a repository and start the indexer. Searches then default to the current working directory unless you pass a path.

bash
cd path/to/repo
mgrep watch

A first query reads like a question, optionally scoped to a path.

bash
mgrep "where do we set up auth?" src/lib
mgrep -m 25 "store schema"

Background sync starts on its own when a coding agent session begins

Installing into an agent is one command, and it signs you in before wiring mgrep into the agent's configuration.

bash
mgrep install-claude-code

Sibling commands exist for the other supported agents, `mgrep install-opencode`, `mgrep install-codex` and `mgrep install-droid`. After installation the sync process starts automatically when a session begins and stops when the session ends. If you would rather own that lifecycle, point the watcher at a path yourself and it will sync only what you name.

bash
mgrep watch /path/to/your/project

Cursor and Windsurf integrations are named as coming soon, so agent coverage is still a moving target.

mgrep and ripgrep split on exact match versus intent

The project's own comparison table puts symbol tracing, refactoring and regex on the grep side, and code exploration, feature discovery and onboarding on the mgrep side. That is the honest framing: ripgrep and grep stay in the toolkit, mgrep answers the questions they cannot.

The approach difference matters more than the label. ripgrep is a local pattern matcher that never sends anything anywhere, returns byte-accurate matches, and is scriptable with exit codes. mgrep is powered by Mixedbread Search, which combines semantic retrieval models with context-aware parsing to match a sentence you type. A query like `mgrep --web --answer "How do I integrate a JavaScript runtime into Deno?"` also reaches beyond your files, which no local grep can do.

The npm tarball ships dist and README.md, and the plugins arrive by copy

The package version is 0.1.13, and three releases landed in April 2026: v0.1.11, v0.1.12 and v0.1.13 on the 8th, 14th and 25th. One packaging detail is easy to miss. The `files` array in package.json lists `dist` and `README.md`, while the build step copies `plugins` into `dist` as a postbuild action. The agent integrations therefore exist in the tarball through the build, not through a declared top-level entry, and the repository root carries `.claude-plugin/`, `claude.md`, `AGENTS.md` and a `guides/` directory that ship to nobody.

Editorial conclusion

Adopt mgrep for onboarding, feature discovery and questions where you cannot guess the naming pattern a previous engineer used, and skip it for symbol tracing, regex refactoring or any repository you are not allowed to send to a hosted service. Verify first what leaves your machine: `mgrep watch` uploads content to the Mixedbread store, the 1MB per file and 1,000 file per directory defaults decide what ever gets indexed, and your current usage is visible on the Mixedbread platform.

Frequently asked questions

What is mgrep?

mgrep is a command line tool from Mixedbread that searches code, text, PDFs and images by meaning, so you can ask a repository a question in plain language instead of supplying exact patterns. It is powered by Mixedbread Search, a hosted service, and is meant to sit alongside grep rather than replace it.

How do I install mgrep?

Install the npm package globally with `npm install -g @mixedbread/mgrep`, using pnpm or bun if that is your package manager. After installing you authenticate with `mgrep login`, or set `MXBAI_API_KEY` in CI and headless environments.

How do I use mgrep?

Run `mgrep watch` inside a repository to do an initial sync that respects `.gitignore` and then keep the index updated, then query with a sentence such as `mgrep "where do we set up auth?"`. Searches cover the current working directory unless you pass a path.

Is mgrep safe to use?

mgrep syncs your files to the Mixedbread store, so content leaves the machine and usage is reported on the Mixedbread platform. The repository is published under the Apache-2.0 licence.

What is a free alternative to mgrep?

grep and ripgrep are the local tools the project points to for exact matches, symbol tracing and refactoring, and neither sends files anywhere. mgrep itself is distributed under Apache-2.0, but its indexing and querying run against a hosted Mixedbread service.

How does mgrep compare to grep?

The project positions grep for exact matches, symbol tracing, refactoring and regex, and mgrep for intent search, code exploration, feature discovery and onboarding. grep matches patterns locally with exact results, while mgrep ranks remote semantic matches to a sentence you type.

Official sources

  1. License: Apache-2.0
  2. mixedbread-ai/mgrep on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mixedbread-ai-mgrep.svg)](https://hysenlabs.com/projects/mixedbread-ai-mgrep)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/mixedbread-ai-mgrep.svg)](https://hysenlabs.com/projects/mixedbread-ai-mgrep)

Was this useful?