greplm-mcp
Model Context Protocol (MCP) stdio server for greplm.
Exposes the greplm trigram code index to LLM agents in Cursor, Claude Desktop, and other MCP clients. All logging goes to stderr; stdout is reserved for the protocol.
Install
With Rust:
From this workspace:
Install both binaries at once:
Client configuration
Point your MCP client at the greplm-mcp binary and pass the project root as the first argument:
Cursor — add to .cursor/mcp.json or global MCP settings.
Claude Desktop — add to claude_desktop_config.json.
The server only indexes paths under the configured root. A caller-supplied root in index_project is honored only when it stays within that boundary.
Tools
Call index_project once before searching, or after large changes. For new tasks, prefer build_context to load exactly the relevant code on a token budget instead of reading whole files.
| Tool | Purpose |
|---|---|
index_project |
Build or refresh the index (incremental or force) |
search_code |
Content search (literal / regex / whole-word / filters) |
find_symbol |
Symbol lookup (exact / prefix / substring / fuzzy) |
find_references |
Occurrences of an identifier (definitions first) |
resolved_references |
Resolved refs from the structural index |
find_callers |
Who calls a function/method |
find_callees |
What a function/method calls |
impact_of |
Blast radius via the reverse call graph |
goto_definition |
Typed go-to-definition at file:line:col |
references_at |
Resolved references at file:line:col |
structural_search |
Tree-sitter query / $NAME pattern search |
build_context |
Task-driven, token-budgeted context pack |
git_blame |
Commit/author that last changed a line |
symbol_history |
Commits that touched a symbol |
changed_since |
Files (with symbols) changed since a revision |
get_file_outline |
Symbol outline of one file |
read_snippet |
Read a file slice with surrounding context |
repo_summary |
Language breakdown, file/symbol counts |
index_status |
Index stats |
All tools return JSON payloads suitable for agent consumption.
Typical agent workflow
index_project— ensure the project is indexedbuild_context— load a token-budgeted context pack for the tasksearch_code/find_symbol/goto_definition— drill into specificsfind_callers/find_callees/impact_of— understand dependencies before editingread_snippet— fetch exact code at reported line numbers
Run manually
The process speaks MCP over stdin/stdout. Use an MCP inspector or your IDE to interact with it.
Environment
| Variable | Effect |
|---|---|
GREPLM_LOG=debug |
Verbose logging to stderr |
GREPLM_NO_SAVINGS=1 |
Disable token-savings recording |
Related crates
greplm-core— indexing and search librarygreplm-cli— command-line interface (greplm)
See the MCP docs for the full tool reference and getting started for agent setup (greplm agent add).
License
MIT