Labsco
MCP SERVER

OpenGrok Go MCP

by rokasklive

Search, navigate and read a large indexed codebase through OpenGrok without cloning it — paginated results with stable cursors and citation URLs on every hit.

Code Intelligence & Repository Indexing
Summary
Honest about what OpenGrok is not.

The project states its own ceiling: OpenGrok gives full-text search plus ctags definitions, not a semantic call graph or an AST engine, so structural questions should use it to find the right files and symbols and then be verified with a language-aware tool. That framing is rarer than it should be. The tool-surface setting is the practical lever — the compact surface registers far fewer schemas than the full one, which is a real saving on every session's tool list.

What it is

An agent-oriented front end for OpenGrok. It turns full-text search and ctags definitions into a surface a model can work through safely: tools appear only when the backing OpenGrok feature actually works, results carry citation URLs, and broad or best-effort answers are flagged rather than presented as certain.

What you get
  • Code searched across an indexed project, with automatic context expansion around each hit and explicit limits on how far that goes — `search_code`
  • A symbol's definitions and its references traced separately — `search_symbol_definitions`, `search_symbol_references`
  • Files read with stable pagination cursors, and the context around a specific location fetched on its own — `read_file`, `get_file_context`
  • The indexed projects and a file's symbols listed — `list_projects`, `list_symbols`
  • Warnings attached to results that are broad, heuristic, truncated or best-effort, so an agent can tell a confident answer from a partial one
  • Three tool surfaces for different agent styles: `compact` with 4 consolidated tools as the default, `full` with 18 fine-grained tools, and an experimental `gateway` pair
Requirements

An OpenGrok instance, with its API base URL ending in `/api/v1` in `OPENGROK_MCP_BASE_URL` — the only required setting. On startup the server discovers projects, probes capabilities and registers only the tools that work. `OPENGROK_MCP_API_TOKEN` carries the full `Authorization` value (`Bearer …` or `Basic …`) when the instance needs auth; without it, search tools stay gated and the server logs what to fix rather than failing silently. `OPENGROK_MCP_DEFAULT_PROJECT` sets an implicit project and is filled in automatically when exactly one is discovered. Run a released binary, or `go run github.com/rokasklive/opengrok-go-mcp/cmd/opengrok-go-mcp@v0.6.0`. HTTP transport is available via `OPENGROK_MCP_TRANSPORT` but adds no inbound authentication, so keep it on loopback or behind your own controls.

Setup effort

Build from source — clone the repository and build it, then point your client at the binary