Skip to main content
MCP server CX Codex

OpenGrok MCP Server — Claude Code MCP server: setup and code search

Connects an AI coding client to an OpenGrok index for symbol search, file reading, blame, history, and call relationships across large codebases.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env OPENGROK_BASE_URL=<OPENGROK_BASE_URL> --env OPENGROK_USERNAME=<OPENGROK_USERNAME> --env OPENGROK_PASSWORD=<OPENGROK_PASSWORD> --env OPENGROK_VERIFY_SSL=<OPENGROK_VERIFY_SSL> --env OPENGROK_CODE_MODE=<OPENGROK_CODE_MODE> --transport stdio opengrok-mcp-server -- npx -y opengrok-mcp-server
Open on GitHub

What OpenGrok MCP Server does

OpenGrok MCP Server gives an MCP client access to an OpenGrok instance through its REST API, with a web fallback. An agent can search source and history, locate files and symbols, read selected code ranges, inspect blame, review file history, and trace calls or dependencies.

Code Mode exposes opengrok_api and opengrok_execute. The agent writes one JavaScript script for a multi-step investigation, while intermediate results stay inside the sandbox. Two files, active-task.md and investigation-log.md, can retain investigation state between turns. A working OpenGrok URL, username, and password are required for setup.

What it helps with

  • find symbol definitions and references
  • read a selected range from a large file
  • inspect who changed a line or file
  • trace callers of a service or method
  • map dependencies before a refactor

Example prompts for the agent

  • Find every reference to authenticate and group the results by file.
  • Read the implementation of PaymentService, then inspect its change history and authors.
  • Trace callers of parseConfig and record the findings in investigation-log.md.

How to install OpenGrok MCP Server

Platform CLI

claude mcp add --env OPENGROK_BASE_URL=<OPENGROK_BASE_URL> --env OPENGROK_USERNAME=<OPENGROK_USERNAME> --env OPENGROK_PASSWORD=<OPENGROK_PASSWORD> --env OPENGROK_VERIFY_SSL=<OPENGROK_VERIFY_SSL> --env OPENGROK_CODE_MODE=<OPENGROK_CODE_MODE> --transport stdio opengrok-mcp-server -- npx -y opengrok-mcp-server

Replace <…> with your own values. 26 more environment variables are in the server README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about OpenGrok MCP Server

How do I install OpenGrok MCP Server in Claude Code?

Run `claude mcp add --env OPENGROK_BASE_URL=<OPENGROK_BASE_URL> --env OPENGROK_USERNAME=<OPENGROK_USERNAME> --env OPENGROK_PASSWORD=<OPENGROK_PASSWORD> --env OPENGROK_VERIFY_SSL=<OPENGROK_VERIFY_SSL> --env OPENGROK_CODE_MODE=<OPENGROK_CODE_MODE> --transport stdio opengrok-mcp-server -- npx -y opengrok-mcp-server`.

What does OpenGrok MCP Server do?

It lets an AI client query OpenGrok for source, symbols, references, blame, history, diffs, and call relationships. The client can investigate an indexed codebase through MCP.

What does the server need to connect?

You need an OpenGrok endpoint plus its username and password. Code Mode is available for running JavaScript investigations inside a sandbox.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor