Home › Search & Research › OpenGrok MCP Server

OpenGrok MCP Server

MCP server bridging OpenGrok search engine with AI for instant context across massive codebases.

TypeScript
★ 10 stars Last pushed 2026-09-25 License: NOASSERTION

Connect

Review any command before running it. Package names and URLs come from the server's own registry entry.

Package (npm 9.6.0)

npx -y [email protected]

Or add to your MCP client config:

{
  "mcpServers": {
    "opengrok-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "OPENGROK_BASE_URL": "<YOUR_VALUE>",
        "OPENGROK_USERNAME": "<YOUR_VALUE>",
        "OPENGROK_PASSWORD": "<YOUR_VALUE>",
        "OPENGROK_VERIFY_SSL": "<YOUR_VALUE>",
        "OPENGROK_CODE_MODE": "<YOUR_VALUE>",
        "OPENGROK_ENABLE_MEMORY_TOOLS": "<YOUR_VALUE>",
        "OPENGROK_DEFAULT_PROJECT": "<YOUR_VALUE>",
        "OPENGROK_CONTEXT_BUDGET": "<YOUR_VALUE>",
        "OPENGROK_API_VERSION": "<YOUR_VALUE>",
        "HTTP_PROXY": "<YOUR_VALUE>",
        "OPENGROK_RESPONSE_FORMAT_OVERRIDE": "<YOUR_VALUE>",
        "OPENGROK_MEMORY_BANK_DIR": "<YOUR_VALUE>",
        "OPENGROK_LOCAL_COMPILE_DB_PATHS": "<YOUR_VALUE>",
        "OPENGROK_ENABLE_ELICITATION": "<YOUR_VALUE>",
        "OPENGROK_ENABLE_SAMPLING": "<YOUR_VALUE>",
        "OPENGROK_SAMPLING_MODEL": "<YOUR_VALUE>",
        "OPENGROK_ENABLE_FILES_API": "<YOUR_VALUE>",
        "OPENGROK_ENABLE_OBSERVATION_MASKER": "<YOUR_VALUE>",
        "OPENGROK_OBSERVATION_MASKER_TURNS": "<YOUR_VALUE>",
        "OPENGROK_SAMPLING_MAX_TOKENS": "<YOUR_VALUE>",
        "OPENGROK_AUDIT_LOG_FILE": "<YOUR_VALUE>",
        "OPENGROK_RATELIMIT_RPM": "<YOUR_VALUE>",
        "OPENGROK_PER_TOOL_RATELIMIT": "<YOUR_VALUE>",
        "OPENGROK_TIMEOUT": "<YOUR_VALUE>",
        "OPENGROK_DEFAULT_MAX_RESULTS": "<YOUR_VALUE>",
        "OPENGROK_PASSWORD_FILE": "<YOUR_VALUE>",
        "OPENGROK_MAX_RESPONSE_BYTES": "<YOUR_VALUE>",
        "OPENGROK_SEARCH_AND_READ_CAP": "<YOUR_VALUE>",
        "OPENGROK_STRICT_SSRF": "<YOUR_VALUE>",
        "OPENGROK_JWT_ISSUER": "<YOUR_VALUE>",
        "OPENGROK_GRAMMAR_DIR": "<YOUR_VALUE>"
      }
    }
  }
}
  • OPENGROK_BASE_URL required — OpenGrok server base URL (e.g. https://opengrok.example.com/source/)
  • OPENGROK_USERNAME — OpenGrok authentication username. Leave unset for anonymous access.
  • OPENGROK_PASSWORD secret — OpenGrok authentication password. Prefer storing via OS keychain using 'npx opengrok-mcp-server setup'.
  • OPENGROK_VERIFY_SSL — Verify TLS certificates. Set to false for self-signed or internal CA certs.
  • OPENGROK_CODE_MODE — Enable Code Mode: 2-tool sandbox interface with env.opengrok.* JavaScript API. Reduces AI token usage by ~90%.
  • OPENGROK_ENABLE_MEMORY_TOOLS — Register the 3 memory tools in Code Mode (memory status, read, update). Off = api + execute only.
  • OPENGROK_DEFAULT_PROJECT — Default project to scope all searches. Can be overridden per call.
  • OPENGROK_CONTEXT_BUDGET — Response size tier controlling token usage.
  • OPENGROK_API_VERSION — OpenGrok REST API version. Use v2 for call graph features (requires OpenGrok 1.12+).
  • HTTP_PROXY — HTTP/HTTPS proxy URL for all OpenGrok API requests (e.g. http://proxy.company.com:8080). Also set as HTTPS_PROXY.
  • OPENGROK_RESPONSE_FORMAT_OVERRIDE — Force a specific response format for all tools. Leave unset for per-tool auto-selection (recommended).
  • OPENGROK_MEMORY_BANK_DIR — Directory 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_PATHS — Comma-separated paths to compile_commands.json for C/C++ compiler flag and include-path extraction. Leave unset for automatic workspace discovery.
  • OPENGROK_ENABLE_ELICITATION — Interactive 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_SAMPLING — AI 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_MODEL — Model preference for MCP Sampling (used for error explanation and query reformulation).
  • OPENGROK_ENABLE_FILES_API — Files API Cache — avoids re-uploading unchanged investigation notes. Requires Files API support in the MCP client.
  • OPENGROK_ENABLE_OBSERVATION_MASKER — Observation 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_TURNS — Number of most-recent opengrok_execute results to keep as full text before masking older ones. Default: 10.
  • OPENGROK_SAMPLING_MAX_TOKENS — Maximum tokens for AI sampling responses (error explanation, query reformulation). Range: 64–4096.
  • OPENGROK_AUDIT_LOG_FILE — Path to write structured audit events (CSV/JSON). Appends tool invocations, elicitation events, and errors. Leave unset to disable.
  • OPENGROK_RATELIMIT_RPM — Maximum requests per minute to the OpenGrok server. Default: 60.
  • OPENGROK_PER_TOOL_RATELIMIT — Per-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_TIMEOUT — HTTP request timeout in seconds for OpenGrok API calls. Increase for slow servers. Default: 30.
  • OPENGROK_DEFAULT_MAX_RESULTS — Default maximum number of results returned per search query. Default: 25.
  • OPENGROK_PASSWORD_FILE — Path 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_BYTES — Hard cap on response payload size in bytes. Overrides the context-budget default. Non-positive values are ignored.
  • OPENGROK_SEARCH_AND_READ_CAP — Cap 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_SSRF — When true, reject OPENGROK_BASE_URL values pointing at private/loopback IPs at startup. Default: false (warn only; per-request guards still apply).
  • OPENGROK_JWT_ISSUER — Expected JWT issuer (iss claim) for HTTP transport OAuth. When set, JWTs from other issuers are rejected.
  • OPENGROK_GRAMMAR_DIR — Directory containing tree-sitter WASM grammars. Overrides the bundled grammar lookup.

This repository has 2 servers listed in the Official MCP Registry.

Other names: io.github.IcyHot09/opengrok

Related servers

Data from the Official MCP Registry