LabscoMCP early access ↗
rokaskliveMCP SERVER

OpenGrok Go MCP

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

by rokasklive ↗Code Intelligence & Repository IndexingCommunity

LABSCO 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 — opengrok_search on the default compact surface, search_code on the full one
  • A symbol's definitions and its references traced separately — opengrok_symbols (definitions, references), or search_symbol_definitions and search_symbol_references on the full surface
  • Files read with stable pagination cursors, and the context around a specific location fetched on its own — opengrok_read, or read_file and get_file_context on the full surface
  • The indexed projects and a file's symbols listed — opengrok_projects and opengrok_symbols, or list_projects and list_symbols on the full surface
  • 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

One command — go run github.com/rokasklive/opengrok-go-mcp/cmd/opengrok-go-mcp@v0.6.0