OpenGrok MCP Server
MCP server bridging OpenGrok search engine with AI for instant context across massive codebases.
The current version, v9.6.0, was published to the official MCP registry on 2026-09-16. It is distributed as opengrok-mcp-server on npm, filed under Search by this index, and declares 31 environment variables. Removals and unreachable sources are measured across every server this index tracks, contract drift across the servers that answer in consecutive snapshots; the index's current counts put this record in context.
Using OpenGrok MCP Server in Claude, Cursor, Gemini CLI, Cline, or Zed?
MCP tool contracts can change remotely with no version bump. The mcpindex gate pins each contract and HOLDs the call when it drifts-before your agent acts. Zero credentials. This is not the package install for this server itself (use Install this server for that).
Rewrites your MCP host config so each server launches behind the gate. Inspect first: curl -fsSL https://mcpindex.ai/install.sh | less
uv tool install mcpindex-gate && mcpindex-config-wireSemantic screen found no manipulation pattern in the description. Conformance probe not yet run.
mcpindex.integrity.descriptionpassINFOevidence“Normal capability description”via static_description
- - Semantic screen only - the deterministic conformance probe has not run on this server
- - Confidence is reported but not yet calibrated (v1)
- - Screen reads the tool description, not the live behavior
- - advisory
- - registry description only no input schema
- - screen model 8b
- - Still current: the description we screened is unchanged, re-checked against the registry
- - Past its freshness window - we could not re-confirm this listing
Semantic screen: an LLM judge reads the tool description for hidden instructions (status PARTIAL). A pass means the description is not lying, not that the tool is safe: a high-capability tool with an honest description still warrants caution. The deterministic conformance probe has not been run on this server yet, so the screen here is semantic-only. Posture: advisory. Confidences are reported but not yet calibrated (calibrated=false at v1). Full verdict history is not shown on this page.
Own this server? Test a description on the public screen → It is a separate check from the verdict above, so the two can differ.
That verdict was true at screening time (snapshot 2026-11-26).
Contracts can change after screening, with no version bump. The gate pins OpenGrok MCP Server’s tool contracts on first sight and holds any silent change before your agent acts - the check that keeps being true on Tuesday.
See your first HOLD in 2 minutes →
Related: how to trust an MCP server · screen before install · silent contract drift
People vet a server before wiring it in. One line on your project site or docs answers that with an independent record: screening verdict, registry provenance, contract drift history. It stays current as new screens and drift events land.
[Independent trust record for OpenGrok MCP Server](https://mcpindex.ai/server/io-github-icyhot09-opengrok-mcp-server) - screening verdict, registry provenance, and contract drift monitoring.<a href="https://mcpindex.ai/server/io-github-icyhot09-opengrok-mcp-server">Independent trust record for OpenGrok MCP Server</a> - screening verdict, registry provenance, and contract drift monitoring.A live verdict badge for your README or listing. It reflects the current screen, links back here, and updates when the verdict does.
[](https://mcpindex.ai/server/io-github-icyhot09-opengrok-mcp-server)<a href="https://mcpindex.ai/server/io-github-icyhot09-opengrok-mcp-server"><img src="https://mcpindex.ai/api/v1/badge/io-github-icyhot09-opengrok-mcp-server" alt="mcpindex verdict" height="20" /></a>OPENGROK_BASE_URLOpenGrok server base URL (e.g. https://opengrok.example.com/source/)
OPENGROK_USERNAMEOpenGrok authentication username. Leave unset for anonymous access.
OPENGROK_PASSWORDOpenGrok authentication password. Prefer storing via OS keychain using 'npx opengrok-mcp-server setup'.
OPENGROK_VERIFY_SSLVerify TLS certificates. Set to false for self-signed or internal CA certs.
OPENGROK_CODE_MODEEnable Code Mode: 2-tool sandbox interface with env.opengrok.* JavaScript API. Reduces AI token usage by ~90%.
OPENGROK_ENABLE_MEMORY_TOOLSRegister the 3 memory tools in Code Mode (memory status, read, update). Off = api + execute only.
OPENGROK_DEFAULT_PROJECTDefault project to scope all searches. Can be overridden per call.
OPENGROK_CONTEXT_BUDGETResponse size tier controlling token usage.
OPENGROK_API_VERSIONOpenGrok REST API version. Use v2 for call graph features (requires OpenGrok 1.12+).
HTTP_PROXYHTTP/HTTPS proxy URL for all OpenGrok API requests (e.g. http://proxy.company.com:8080). Also set as HTTPS_PROXY.
OPENGROK_RESPONSE_FORMAT_OVERRIDEForce a specific response format for all tools. Leave unset for per-tool auto-selection (recommended).
OPENGROK_MEMORY_BANK_DIRDirectory where the AI stores investigation notes (active-task.md, investigation-log.md). Defaults to ~/.config/opengrok-mcp/memory-bank/ or workspace-relative when set by the VS Code extension.
OPENGROK_LOCAL_COMPILE_DB_PATHSComma-separated paths to compile_commands.json for C/C++ compiler flag and include-path extraction. Leave unset for automatic workspace discovery.
OPENGROK_ENABLE_ELICITATIONInteractive AI Prompts — the AI pauses to ask questions during investigations (project selection, file disambiguation). Requires Claude Code v2.1.76+ or a client that supports MCP Elicitation.
OPENGROK_ENABLE_SAMPLINGAI Sampling — allow the server to request LLM completions for error explanations and summaries. Off by default to avoid consuming premium requests (e.g. GitHub Copilot).
OPENGROK_SAMPLING_MODELModel preference for MCP Sampling (used for error explanation and query reformulation).
OPENGROK_ENABLE_FILES_APIFiles API Cache — avoids re-uploading unchanged investigation notes. Requires Files API support in the MCP client.
OPENGROK_ENABLE_OBSERVATION_MASKERObservation Masker — prepend compact history summaries to opengrok_execute results after N turns. Disabled by default; has no benefit for clients that retain full context (Claude Code, Cursor).
OPENGROK_OBSERVATION_MASKER_TURNSNumber of most-recent opengrok_execute results to keep as full text before masking older ones. Default: 10.
OPENGROK_SAMPLING_MAX_TOKENSMaximum tokens for AI sampling responses (error explanation, query reformulation). Range: 64–4096.
OPENGROK_AUDIT_LOG_FILEPath to write structured audit events (CSV/JSON). Appends tool invocations, elicitation events, and errors. Leave unset to disable.
OPENGROK_RATELIMIT_RPMMaximum requests per minute to the OpenGrok server. Default: 60.
OPENGROK_PER_TOOL_RATELIMITPer-tool rate limits in requests per minute, as comma-separated tool:rpm pairs (e.g. opengrok_execute:15,opengrok_search_code:30). Overrides OPENGROK_RATELIMIT_RPM for specific tools.
OPENGROK_TIMEOUTHTTP request timeout in seconds for OpenGrok API calls. Increase for slow servers. Default: 30.
OPENGROK_DEFAULT_MAX_RESULTSDefault maximum number of results returned per search query. Default: 25.
OPENGROK_PASSWORD_FILEPath to a file containing the OpenGrok password (file-mounted secret for containers). Takes precedence over the OS keychain when OPENGROK_PASSWORD is unset.
OPENGROK_MAX_RESPONSE_BYTESHard cap on response payload size in bytes. Overrides the context-budget default. Non-positive values are ignored.
OPENGROK_SEARCH_AND_READ_CAPCap for the search_and_read compound tool in bytes. Overrides the context-budget default (2–8 KB depending on tier). Non-positive values are ignored.
OPENGROK_STRICT_SSRFWhen true, reject OPENGROK_BASE_URL values pointing at private/loopback IPs at startup. Default: false (warn only; per-request guards still apply).
OPENGROK_JWT_ISSUERExpected JWT issuer (iss claim) for HTTP transport OAuth. When set, JWTs from other issuers are rejected.
OPENGROK_GRAMMAR_DIRDirectory containing tree-sitter WASM grammars. Overrides the bundled grammar lookup.
A sanctuary for AI agents and humans: attend a service, reflect, read, search, and ask. No auth.
Search the Ankra documentation: clusters, stacks, GitOps, CI/CD and the CLI. No account needed.
Failure-memory layer for coding agents: search evidence-rated failure lessons by error text.