opengrok_search_codeLABSCO SUMMARY
The compound tools are the reason to use it.
Asking "what is this symbol" naively costs four round trips and a great deal of context; the symbol-context tool does the same work in one, and the project puts the saving at roughly 92% fewer tokens. On a codebase where the index is stale, check index health before you trust an empty result — that is the failure mode that otherwise looks like the code not existing.
What it is
A bridge between an existing OpenGrok index and an MCP client. Instead of the model grepping a checkout it does not have, it queries the index your organization already runs — which is what makes this workable on codebases too large to clone, let alone read.
What you get
- Search and read —
opengrok_search_codefor full-text, definitions, references, path and history withfile_typefiltering,opengrok_find_file,opengrok_get_file_content(large files needstart_lineandend_line),opengrok_browse_directory,opengrok_list_projects,opengrok_search_suggest - History —
opengrok_get_file_historyfor commit logs,opengrok_get_file_annotateandopengrok_blamefor line-by-line authorship,opengrok_get_file_difffor a unified diff with surrounding context - Compound tools that merge several round trips:
opengrok_get_symbol_contextfinds the definition, reads the source, fetches headers and gets references in one call;opengrok_search_and_readsearches then immediately reads the context;opengrok_batch_searchruns 2-5 queries and deduplicates hits across them - Investigation tools —
opengrok_what_changedgroups recent line changes by commit with author, date and SHA;opengrok_dependency_mapwalks#includeandimportchains up to depth 3 as a directed graph;opengrok_search_patternfor regex;opengrok_call_graphfor call-chain tracing opengrok_index_health— latency, backend connectivity, staleness score and latency trend, for when results look wrong- A memory bank that survives across turns:
opengrok_memory_status,opengrok_read_memoryandopengrok_update_memoryoveractive-task.mdand an append-onlyinvestigation-log.md - Code Mode, enabled with
OPENGROK_CODE_MODE=true, which replaces the catalog with a small interface —opengrok_apifor the spec andopengrok_executeto run JavaScript in a sandboxed QuickJS VM againstenv.opengrok.*
Requirements
A reachable OpenGrok server: OPENGROK_BASE_URL is the one required setting, with OPENGROK_USERNAME and OPENGROK_PASSWORD only if your instance is not anonymous. The easiest install is the VS Code extension, which ships the server pre-packaged and configures itself. Otherwise npm install -g opengrok-mcp-server then opengrok-mcp setup — an interactive wizard that collects the URL and credentials and registers the server with your client, storing the password in the OS keychain (macOS Keychain, Windows Credential Manager, Linux libsecret) with an encrypted file fallback for headless machines. Set OPENGROK_VERIFY_SSL to false only for internal CA certificates. Package opengrok-mcp-server at 9.2.14.
Setup effort
One command — npm install -g opengrok-mcp-server
USE CASES
Understanding an unfamiliar symbol
One call returns the definition, the surrounding source, the headers and the references, rather than four searches you stitch together.
Finding out what changed under a subsystem lately
Group recent line changes by commit with author and date, then read a diff with enough context to see why.
Tracing what a header drags in
Walk the include and import chain a few levels deep and read it as a graph of what uses what.
Keeping a long investigation coherent
Write findings to the investigation log so the next turn resumes from state instead of re-deriving it.
Working in a client with a small tool budget
Switch to Code Mode so a handful of tools remain and multi-step investigations run as sandboxed JavaScript.
25 tools
Listed in project docs. Your client may show a different list.
opengrok_find_fileopengrok_get_file_contentopengrok_get_file_historyopengrok_browse_directoryopengrok_list_projectsopengrok_get_file_annotateopengrok_get_file_symbolsopengrok_search_suggestopengrok_get_symbol_contextopengrok_search_and_readopengrok_batch_searchopengrok_index_healthopengrok_what_changedopengrok_dependency_mapopengrok_search_patternopengrok_blameopengrok_call_graphopengrok_get_file_diffopengrok_memory_statusopengrok_read_memoryopengrok_update_memoryopengrok_apiopengrok_executeopengrok_get_compile_infoBEFORE YOU INSTALL
What to know first
Tools you get
25 tools named in the project's documentation.
Requires
OPENGROK_BASE_URL in your environment
Optional
- OPENGROK_USERNAME in your environment
- OPENGROK_PASSWORD in your environment
INSTALLATION
Connect your client
Server setup
npm install -g opengrok-mcp-serverMCP Clients
VS Code
Install OpenGrok MCP from the VS Code Marketplace, or search "OpenGrok" in the Extensions panel.
OPENGROK_USERNAME and OPENGROK_PASSWORD are optional; leave them unset for anonymous access. npx opengrok-mcp-server setup asks for your OpenGrok URL and credentials, registers the server with Claude Code, GitHub Copilot CLI or Codex CLI, and keeps the password in your OS keychain. The VS Code extension asks for them in its own settings screen.
Claude Code, GitHub Copilot, Codex
npx opengrok-mcp-server setupOPENGROK_USERNAME and OPENGROK_PASSWORD are optional; leave them unset for anonymous access. npx opengrok-mcp-server setup asks for your OpenGrok URL and credentials, registers the server with Claude Code, GitHub Copilot CLI or Codex CLI, and keeps the password in your OS keychain. The VS Code extension asks for them in its own settings screen.