opengrok-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@opengrok-mcpfind where parseConfig is defined"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
opengrok-mcp
An MCP server that lets an AI agent search and read source code indexed by an OpenGrok instance. Read-only, stdio transport.
Tested against OpenGrok 1.14. It uses the REST search API and the /raw file route, both of which
work anonymously on a default install.
Tools
Tool | Purpose |
| Search by |
| Find files by name or path pattern. |
| Read a file (line-numbered) by the path returned from search, with an optional line range. |
| List the project names on the instance. |
Searches are scoped to the configured default project(s); pass projects to pick others or
all_projects: true to search everything.
Related MCP server: Semantic Code Search MCP Server
Install
Requires Node.js 20+.
git clone https://github.com/jenkeeri/opengrok-mcp.git
cd opengrok-mcp
npm install && npm run buildConfiguration
All settings are environment variables, normally set in your MCP client's server entry:
Variable | Required | Description |
| yes | Base URL, e.g. |
| no | Comma-separated default project(s). Empty means all projects. |
| no | Free text appended to the server instructions the agent sees. Use it to describe your project layout (what each project is, naming conventions). |
| no | Bearer token, if the instance needs one. |
| no | Basic auth, if the instance needs it. |
| no | Per-request timeout (default |
Example MCP client entry:
{
"mcpServers": {
"opengrok": {
"command": "node",
"args": ["/path/to/opengrok-mcp/dist/index.js"],
"env": {
"OPENGROK_URL": "https://opengrok.example.com",
"OPENGROK_DEFAULT_PROJECT": "myproject",
"OPENGROK_INSTRUCTIONS": "Project 'myproject' is the main branch; 'myproject-1.2' is a release branch."
}
}
}
}Notes
Use the REST parameter names
projects,def,symbolandstart. The web UI names (project,defs,refs) are silently ignored by the API, which makes project filtering appear broken.typetakes an OpenGrok analyzer name (c,cxx,java,python, ...); an unknown name returns zero results.defandsymbolrely on OpenGrok's language-aware indexing; usefullfor file types it cannot parse.
Development
npm test # unit tests (synthetic fixtures, no network)
npm run typecheck
npm run buildLicense
GPL-3.0, see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Search indexed code, trace dependencies, assess change impact, and recall repository memory.
Search GitHub, npm, PyPI, StackOverflow, ArXiv from one MCP — built for coding agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to perform high-performance code search and analysis across multiple languages using symbol indexing, regex text search, and structural AST pattern matching. It also provides tools for technology stack detection and dependency analysis with persistent caching for optimized performance.9-

Semantic Code Search MCPofficial
FlicenseNot gradedqualityDmaintenanceProvides AI coding agents with structured access to indexed codebases via semantic search, symbol analysis, and file reading tools.13-- AlicenseNot gradedqualityDmaintenanceEnables file reading with pagination and regex-based code search across a codebase using grep.13 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to explore, search, and read codebase repositories and API specifications efficiently, with support for file searching, content search via ripgrep, and reading API specs.6 npmISC