AST-based semantic code search CLI and MCP server that indexes your codebase so coding agents can find code by meaning.
yoanbernabeu/grepai
A privacy-first CLI for semantic code search with local embeddings, call-graph tracing, and an MCP server for AI coding agents.
- Stars
- 1,940
- Forks
- 160
- Open issues
- 81
- Last commit
- 6 days ago
What is it?
grepai is a command-line tool for searching codebases by meaning rather than exact text. It builds a vector index of your code using embeddings, so a natural language query like "user authentication flow" can surface relevant functions even when they use different names.
The tool runs entirely on your machine and works with a local embedding provider such as Ollama, with LM Studio or OpenAI also supported. A background file watcher keeps the index updated as files change. It also includes call graph tracing, so you can see who calls a function before modifying it.
grepai exposes itself as an MCP server, letting AI agents such as Claude Code, Cursor, and Windsurf call it as a tool. The project states that this reduces the input tokens agents spend reading code, since they receive targeted context instead of raw search output.
Key features
- 01Semantic search that matches code by intent, not exact text
- 02Call graph tracing to find callers of a function
- 03Fully local operation with Ollama, LM Studio, or OpenAI embeddings
- 04File watcher that keeps the index up to date automatically
- 05MCP server for calling grepai from AI agents
Use cases
- Letting Claude Code or Cursor find relevant code without reading whole files
- Locating code by concept when you do not know the exact function name
- Checking callers of a function before refactoring it
- Searching a private codebase without sending code to external services
Quick start
- 1
Install via Homebrew (macOS)
brew install yoanbernabeu/tap/grepai - 2
Install an embedding provider: pull the Ollama model nomic-embed-text
ollama pull nomic-embed-text - 3
Initialize grepai in your project, then start the indexing daemon
grepai init && grepai watch - 4
Search your code by meaning
grepai search "error handling"
Things to know
- Requires a separate embedding provider such as Ollama, LM Studio, or OpenAI.
- Linux and Windows installs use a curl or PowerShell install script rather than a package manager in the README.
In collections
Topics
FAQ
- What is grepai?
- A privacy-first CLI for semantic code search with local embeddings, call-graph tracing, and an MCP server for AI coding agents. grepai is a command-line tool for searching codebases by meaning rather than exact text. It builds a vector index of your code using embeddings, so a natural language query like "user authentication flow" can surface relevant functions even when they use different names.
- Is grepai free to use? What license does it have?
- grepai is open source under the MIT license. Check the license terms before using it in commercial products.
- Is grepai still maintained?
- Actively maintained. The last commit to grepai was on Nov 2, 2026.
- What can I use grepai for?
- Letting Claude Code or Cursor find relevant code without reading whole files Locating code by concept when you do not know the exact function name Checking callers of a function before refactoring it Searching a private codebase without sending code to external services
- How do I install grepai?
- Install via Homebrew (macOS): brew install yoanbernabeu/tap/grepai Install an embedding provider: pull the Ollama model nomic-embed-text: ollama pull nomic-embed-text Initialize grepai in your project, then start the indexing daemon: grepai init && grepai watch Search your code by meaning: grepai search "error handling"
- Where can I get grepai?
- The source code and installation instructions are on GitHub: https://github.com/yoanbernabeu/grepai
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A local-first semantic code search engine that combines vector embeddings with ripgrep so you can query a codebase in natural language.
Local-first search CLI and agent tool that combines ripgrep, BM25 and vector search over your workspace.
Local semantic code search MCP server that gives Claude Code, Codex, Cursor and OpenCode meaning-based lookup over your codebase using Ollama or LM Studio embeddings.
A CLI and TUI that searches package registries, GitHub and Hacker News for existing tools matching a plain-English dev tool idea before you build it.
A curated, validated registry of installable skills that extend AI coding agents such as Claude Code, Cursor and Copilot, with a CLI to install them.