OpenGrok MCP Server MCP Server
io.github.IcyHot09/opengrok-mcp-server
What this kind of tool is for
- Automate a build, test, or deployment step you repeat by hand.
- Review or refactor code in an existing repository without leaving your agent.
- Bridge an internal service or CLI into the agent toolset.
How to compare servers like this
- Scope of control:
- Repos and CI are hard to undo; prefer tools that ask before anything irreversible.
- Environment fit:
- Match the runtime it expects (Node, Python, a container) to what you actually run.
- Maintenance signal:
- Check the last-commit date — dev tooling that lags upstream breaks first.
- Config surface:
- Prefer tools whose environment-variable or config keys are documented plainly.
This page carries your copy-paste config: pick your MCP client in the install section on this page and use the copy button.
What is the OpenGrok MCP Server MCP server?
MCP server bridging OpenGrok search engine with AI for instant context across massive codebases.
How to install OpenGrok MCP Server
Copy-paste configuration for popular MCP clients.
OPENGROK_BASE_URLrequiredOpenGrok server base URL (e.g. https://opengrok.example.com/source/)
OPENGROK_USERNAMEOpenGrok authentication username. Leave unset for anonymous access.
OPENGROK_PASSWORDsecretOpenGrok 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.
{
"mcpServers": {
"opengrok-mcp-server": {
"command": "npx",
"args": [
"-y",
"opengrok-mcp-server"
],
"env": {
"OPENGROK_BASE_URL": "<YOUR_OPENGROK_BASE_URL>",
"OPENGROK_USERNAME": "<YOUR_OPENGROK_USERNAME>",
"OPENGROK_PASSWORD": "<YOUR_OPENGROK_PASSWORD>",
"OPENGROK_VERIFY_SSL": "<YOUR_OPENGROK_VERIFY_SSL>",
"OPENGROK_CODE_MODE": "<YOUR_OPENGROK_CODE_MODE>",
"OPENGROK_ENABLE_MEMORY_TOOLS": "<YOUR_OPENGROK_ENABLE_MEMORY_TOOLS>",
"OPENGROK_DEFAULT_PROJECT": "<YOUR_OPENGROK_DEFAULT_PROJECT>",
"OPENGROK_CONTEXT_BUDGET": "<YOUR_OPENGROK_CONTEXT_BUDGET>",
"OPENGROK_API_VERSION": "<YOUR_OPENGROK_API_VERSION>",
"HTTP_PROXY": "<YOUR_HTTP_PROXY>",
"OPENGROK_RESPONSE_FORMAT_OVERRIDE": "<YOUR_OPENGROK_RESPONSE_FORMAT_OVERRIDE>",
"OPENGROK_MEMORY_BANK_DIR": "<YOUR_OPENGROK_MEMORY_BANK_DIR>",
"OPENGROK_LOCAL_COMPILE_DB_PATHS": "<YOUR_OPENGROK_LOCAL_COMPILE_DB_PATHS>",
"OPENGROK_ENABLE_ELICITATION": "<YOUR_OPENGROK_ENABLE_ELICITATION>",
"OPENGROK_ENABLE_SAMPLING": "<YOUR_OPENGROK_ENABLE_SAMPLING>",
"OPENGROK_SAMPLING_MODEL": "<YOUR_OPENGROK_SAMPLING_MODEL>",
"OPENGROK_ENABLE_FILES_API": "<YOUR_OPENGROK_ENABLE_FILES_API>",
"OPENGROK_ENABLE_OBSERVATION_MASKER": "<YOUR_OPENGROK_ENABLE_OBSERVATION_MASKER>",
"OPENGROK_OBSERVATION_MASKER_TURNS": "<YOUR_OPENGROK_OBSERVATION_MASKER_TURNS>",
"OPENGROK_SAMPLING_MAX_TOKENS": "<YOUR_OPENGROK_SAMPLING_MAX_TOKENS>",
"OPENGROK_AUDIT_LOG_FILE": "<YOUR_OPENGROK_AUDIT_LOG_FILE>",
"OPENGROK_RATELIMIT_RPM": "<YOUR_OPENGROK_RATELIMIT_RPM>",
"OPENGROK_PER_TOOL_RATELIMIT": "<YOUR_OPENGROK_PER_TOOL_RATELIMIT>",
"OPENGROK_TIMEOUT": "<YOUR_OPENGROK_TIMEOUT>",
"OPENGROK_DEFAULT_MAX_RESULTS": "<YOUR_OPENGROK_DEFAULT_MAX_RESULTS>",
"OPENGROK_PASSWORD_FILE": "<YOUR_OPENGROK_PASSWORD_FILE>",
"OPENGROK_MAX_RESPONSE_BYTES": "<YOUR_OPENGROK_MAX_RESPONSE_BYTES>",
"OPENGROK_SEARCH_AND_READ_CAP": "<YOUR_OPENGROK_SEARCH_AND_READ_CAP>",
"OPENGROK_STRICT_SSRF": "<YOUR_OPENGROK_STRICT_SSRF>",
"OPENGROK_JWT_ISSUER": "<YOUR_OPENGROK_JWT_ISSUER>",
"OPENGROK_GRAMMAR_DIR": "<YOUR_OPENGROK_GRAMMAR_DIR>"
}
}
}
}Related MCP servers

io.github.IdoAzaCalls/cron-explainer
Cron expression parser: explains any cron + returns next N fire times. Timezone-aware.
Shared app-testing runbook: read the plan, record results per platform, raise and fix issues.

Horoshop MCP
Unofficial server for Horoshop (Хорошоп) stores: catalog, orders, SEO, feeds, admin. 118 tools.

Git-backed failure-memory for AI coding agents: search 290 lessons to avoid repeating known bugs.

UISandbox
Play with your app's design in the browser: load a build, turn the knobs, export the code.

A dead-simple, self-hosted MCP server for securely querying databases via AI agents.
