OpenGrok MCP Server

OpenGrok MCP Server

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.

Category
访问服务器

README

<div align="center">

<img src="images/icon.png" width="120" alt="OpenGrok MCP Server icon">

OpenGrok MCP Server

Search your OpenGrok code index directly from GitHub Copilot Chat

VS Code Marketplace Installs npm CI GitHub Release

🔌 Zero Install  ·  🧠 Compound Tools  ·  🔄 Auto-Updates  ·  🔒 Secure Credentials

</div>


<details> <summary>📋 Table of Contents</summary>

</details>


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 Code Search for Copilot" in the VS Code Extensions panel (Ctrl+Shift+X) and click Install.

Option 2 — Install pre-built VSIX

  1. Download the latest VSIX file from GitHub Releases.
  2. 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.
  3. Updates are automatic — the extension checks GitHub Releases once per day and offers one-click install.

<details> <summary>🛠️ Option 3 — Build from source <em>(For developers)</em></summary>

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

</details>


Setup & Configuration

  1. 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 Configuration in the Command Palette.)
  2. 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
search_code Full-text, symbol definition, reference, path, or commit message search. Optional file_type filter.
find_file Find files by path or name pattern.
get_file_content Retrieve file contents — pass start_line/end_line to limit output.
get_file_history Commit history for a file.
browse_directory List directory contents.
list_projects List all accessible projects.
get_file_annotate Git blame with optional line range.
get_file_symbols List all top-level symbols in a file.
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
get_symbol_context search_code(defs)get_file_contentsearch_code(refs) ~92%
search_and_read search_codeget_file_content ~92%
batch_search Multiple sequential search_code calls ~73%
index_health Manual connection diagnostics

file_type filtersearch_code, batch_search, search_and_read, and 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.

<details> <summary>⚙️ Local Source Layer (Optional)</summary>

Tool Description
get_compile_info Compiler flags, include paths, defines, and language standard for a source file. Requires compile_commands.json in your workspace.

</details>


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

<details> <summary>View settings reference</summary>

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.

</details>


Architecture

<details> <summary>View architecture diagram</summary>

┌─────────────────┐     ┌──────────────────────────────┐     ┌──────────────┐
│  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.

</details>


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.


License

This project is licensed under the PolyForm Noncommercial License 1.0.0.

This project is free for personal and non-commercial use. For enterprise or commercial licensing, please contact me at rudroy09@gmail.com.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选