OpenGrok
OpenGrok MCP Server is a native Model Context Protocol (MCP) VS Code extension that seamlessly bridges the gap between your organization's OpenGrok indices and GitHub Copilot Chat. It arms your AI assistant with the deep, instantaneous repository context required to traverse, understand, and search massive codebases using only natural language.
OpenGrok MCP Server
MCP server bridging OpenGrok search engine with AI for instant context across massive codebases
π Zero Install Β Β·Β π§ Compound Tools Β Β·Β π Auto-Updates Β Β·Β π Secure Credentials
- Do I need anything installed?
- Installation
- Setup & Configuration
- Usage
- Available Tools
- Extension Commands
- Extension Settings
- Architecture
- Development
- License
Do I need anything installed?
π‘ No. Installing the VSIX is enough. The MCP server is bundled inside the extension β no Python, no Node.js, no separate installs required.
Installation
Option 1 β VS Code Marketplace (Recommended)
Search for "OpenGrok MCP Server" in the VS Code Extensions panel (Ctrl+Shift+X) and click Install.
Option 2 β npm
npx opengrok-mcp-server
Or install globally:
npm install -g opengrok-mcp-server
Option 3 β MCP Registry
This server is listed on the MCP Registry as io.github.IcyHot09/opengrok-mcp-server. Any MCP-compatible client that supports the registry can discover and install it automatically.
Option 4 β Install pre-built VSIX
- Download the latest VSIX file from GitHub Releases.
- Install it in VS Code:
- Open the terminal in VS Code and run:
code --install-extension opengrok-mcp-server-X.Y.Z.vsix - OR go to the Extensions tab β click the
Β·Β·Β·menu β Install from VSIXβ¦ and select the file.
- Open the terminal in VS Code and run:
- Updates are automatic β the extension checks GitHub Releases once per day and offers one-click install.
git clone https://github.com/IcyHot09/opengrok-mcp-server.git
cd opengrok-mcp-server
npm install
npm run vsix # Creates opengrok-mcp-server-*.vsix
code --install-extension opengrok-mcp-server-*.vsix
Setup & Configuration
-
Configure Credentials:
- Upon installing, the Configuration Manager webview opens automatically.
- Enter your OpenGrok server URL, username, and password, then click Save Settings. (Password is saved securely in the OS keychain.)
- A connection test runs automatically. First-time setup requires a Reload Window to enable tools.
- (Manage configuration later via the gear icon in the Status Bar, or
OpenGrok: Manage Configurationin the Command Palette.)
-
Enable the Tools in Copilot (First Time Only):
- Open GitHub Copilot Chat in Agent mode.
- Click the
π§(Tools icon) in the chat input box. - If you see Update Tools, click it first.
- Check OpenGrok in the list and click Done.
β οΈ Tool selection is per workspace β re-enable in each new workspace as needed.
π Using with Other MCP Clients
The standalone MCP server works with any MCP-compatible client:
Claude Code Β· Cursor Β· Windsurf Β· Claude Desktop Β· OpenCode Β· Google Antigravity
π See MCP_CLIENTS.md for the one-command installer, per-client config snippets, and security considerations.
Usage
In GitHub Copilot Chat, describe what you're looking for in natural language:
Use OpenGrok to search for RenderPipeline in the my-project project
Ask OpenGrok to show me the file at /path/to/file.cpp lines 100-200
Have OpenGrok find the definition of CacheManager and show me the header too
Search for all references to TaskScheduler across the codebase
Available Tools
Core Tools
| Tool | Description |
|---|---|
opengrok_search_code | Full-text, symbol definition, reference, path, or commit message search. Optional file_type filter. |
opengrok_find_file | Find files by path or name pattern. |
opengrok_get_file_content | Retrieve file contents β pass start_line/end_line to limit output. |
opengrok_get_file_history | Commit history for a file. |
opengrok_browse_directory | List directory contents. |
opengrok_list_projects | List all accessible projects. |
opengrok_get_file_annotate | Git blame with optional line range. |
opengrok_get_file_symbols | List all top-level symbols in a file. |
opengrok_search_suggest | Autocomplete/suggestions for partial queries. |
π Compound Tools β Use These First
π‘ These collapse common multi-step patterns into a single call, saving ~75β92% of tokens.
| Tool | What it replaces | Token savings |
|---|---|---|
opengrok_get_symbol_context | opengrok_search_code(defs) β opengrok_get_file_content β opengrok_search_code(refs) | ~92% |
opengrok_search_and_read | opengrok_search_code β opengrok_get_file_content | ~92% |
opengrok_batch_search | Multiple sequential opengrok_search_code calls | ~73% |
opengrok_index_health | Manual connection diagnostics | β |
file_type filter β opengrok_search_code, opengrok_batch_search, opengrok_search_and_read, and opengrok_get_symbol_context accept an optional file_type to restrict results by language: cxx, c, java, python, javascript, typescript, csharp, golang, ruby, perl, sql, xml, yaml, shell, makefile.
| Tool | Description |
|---|---|
opengrok_get_compile_info | Compiler flags, include paths, defines, and language standard for a source file. Requires compile_commands.json in your workspace. |
Extension Commands
| Command | Description |
|---|---|
OpenGrok: Manage Configuration | Open visual configuration panel |
OpenGrok: Configure Credentials | Quick-configure via input prompts |
OpenGrok: Test Connection | Verify connectivity to OpenGrok |
OpenGrok: Show Server Logs | View MCP server diagnostic logs |
OpenGrok: Check for Updates | Check GitHub Releases for new versions |
OpenGrok: Status Menu | Quick-pick menu (also accessible from status bar) |
Extension Settings
| Name | Type | Default | Description |
|---|---|---|---|
opengrok-mcp.baseUrl | string | OpenGrok server URL | |
opengrok-mcp.username | string | Your username | |
opengrok-mcp.verifySsl | boolean | false | Verify SSL certificates |
opengrok-mcp.proxy | string | HTTP proxy URL |
Local Source Layer
The local layer is zero-config β if your workspace contains compile_commands.json, get_compile_info is enabled automatically.
Architecture
βββββββββββββββββββ ββββββββββββββββββββββββββββββββ ββββββββββββββββ
β GitHub Copilot ββββββΆβ opengrok-mcp-server (MCP) ββββββΆβ OpenGrok β
β Chat βstdioβ βHTTP β Server β
βββββββββββββββββββ β Compound tools: β ββββββββββββββββ
β² β Β· get_symbol_context β
β β Β· search_and_read β ββββββββββββββββ
β configures β Β· batch_search ββββββΆβ Local FS β
β + bundles β β β (optional) β
βββββββββ΄ββββββββββ β Response cap: 16 KB β ββββββββββββββββ
β VS Code β β MCP instructions block β
β Extension β ββββββββββββββββββββββββββββββββ
βββββββββββββββββββ
The MCP server is compiled and bundled inside the VSIX as out/server/main.js.
VS Code provides its own Node.js runtime β no separate installation needed.
Development
npm install
npm test # Run unit tests (Vitest)
npm run lint # TypeScript type-check + ESLint
npm run compile # esbuild bundle
npm run vsix # Package as .vsix
Releases are automated via GitHub Actions β push a version tag (vX.Y.Z) and the workflow builds, tests, and publishes to GitHub Releases.
See CONTRIBUTING.md for the full development guide.
Troubleshooting
| Problem | Solution |
|---|---|
| Tools not appearing in Copilot | Click π§ Tools β Update Tools in the chat input. Reload the window (Ctrl+Shift+P β "Reload Window"). |
| "Connection failed" on test | Verify OPENGROK_BASE_URL is reachable. Check proxy settings if behind a corporate firewall. |
| 401 Unauthorized | Set OPENGROK_USERNAME and OPENGROK_PASSWORD via OpenGrok: Configure Credentials. |
| Results seem stale | Call opengrok_index_health to check connectivity. OpenGrok index may need a rebuild by an admin. |
| SSL certificate errors | Set opengrok-mcp.verifySsl to false for self-signed or internal CA certificates. |
| Timeouts on large repos | Narrow queries with file_type, specific projects, or smaller max_results. |
| Debug mode | Set OPENGROK_LOG_LEVEL=debug environment variable to enable verbose logging to stderr. |
OpenGrok Version Compatibility
| OpenGrok Version | Support Level | Notes |
|---|---|---|
| 1.13+ | Full | REST API + HTML fallback |
| 1.7.x β 1.12.x | Full | HTML parsing fallback for defs/refs search, annotate |
| < 1.7 | Untested | May work with limited functionality |
License
This project is licensed under the PolyForm Noncommercial License 1.0.0.
β Free for personal, hobby, research, educational, and non-commercial use β Not allowed for any commercial, business, enterprise, or paid use
Enterprises / Companies: If you want to use this MCP server in a commercial context (internal tools, production, SaaS, CI pipelines, etc.), you must purchase a commercial license. Contact [email protected] for pricing and terms.
See LICENSE-COMMERCIAL.md for details.
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Devici MCP Server
Manage threat models, components, and security data on the Devici platform.
Moralis Web3 API
Interact with the Moralis Web3 API to access blockchain data across multiple networks through a structured interface.
Claude-FAF-MCP
Only Persistent Project Context MCP Server - Official Anthropic Registry
Claude Google Apps Script MCP Guide
Integrate Claude AI with Google Apps Script to automate tasks in Google Sheets and Gmail.
Vibetest Use
Automated QA testing for websites to find UI bugs, broken links, and accessibility issues.
CRAN Package README MCP Server
Fetch comprehensive information about CRAN packages, including READMEs, metadata, and search functionality.
Cycode
Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning with Cycode.
Plugged.in
A comprehensive proxy that combines multiple MCP servers into a single MCP. It provides discovery and management of tools, prompts, resources, and templates across servers, plus a playground for debugging when building MCP servers.
AAP Enterprise MCP Server
An MCP server that allows AI assistants to interact with Ansible Automation Platform (AAP) and Event-Driven Ansible (EDA) infrastructure.
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers, without authentication.