프로토타입 · 미리 보기: 공식 레지스트리의 모든 서버를 담고 있으며 30분마다 동기화해요. 리뷰와 계정 기능은 다음 단계에서 열려요.
PopNx MCPAI를 쓰는 사람을 위한 MCP 서버 · 쉬운 말로 설명해요

OpenGrok MCP Server

제작자: IcyHot09버전 9.6.0i★ –i내 컴퓨터에서 실행
레지스트리 이름io.github.IcyHot09/opengrok-mcp-server

설치

개요

제작자가 쓴 설명(영어 원문)

MCP server bridging OpenGrok search engine with AI for instant context across massive codebases.

PopNx MCP의 세 기둥

이 세 가지는 절대 하나의 점수로 합치지 않아요. 의견, 측정, 인기는 서로 다른 것이니까요.

할 수 있는 일

이 서버는 아직 쉬운 말로 된 요약을 쓰지 못했어요. 아래는 레지스트리에서 읽어 온 사실이에요.

  • 연결 방식: 내 컴퓨터에서 실행
  • 전송 방식: stdio
  • 카테고리: 검색 및 AI 기억
  • 입력해야 할 값: OPENGROK_BASE_URL, OPENGROK_PASSWORD

설치

쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.

설치하기 전에

  • 기본 점검: 1개 중 1개 통과
  • 내 컴퓨터에서 내 사용자 계정의 권한(파일, 네트워크, 앱)으로 실행돼요.
  • 직접 입력할 값: OPENGROK_BASE_URL, OPENGROK_USERNAME, OPENGROK_PASSWORD, OPENGROK_VERIFY_SSL, OPENGROK_CODE_MODE, OPENGROK_ENABLE_MEMORY_TOOLS, OPENGROK_DEFAULT_PROJECT, OPENGROK_CONTEXT_BUDGET, OPENGROK_API_VERSION, HTTP_PROXY, OPENGROK_RESPONSE_FORMAT_OVERRIDE, OPENGROK_MEMORY_BANK_DIR, OPENGROK_LOCAL_COMPILE_DB_PATHS, OPENGROK_ENABLE_ELICITATION, OPENGROK_ENABLE_SAMPLING, OPENGROK_SAMPLING_MODEL, OPENGROK_ENABLE_FILES_API, OPENGROK_ENABLE_OBSERVATION_MASKER, OPENGROK_OBSERVATION_MASKER_TURNS, OPENGROK_SAMPLING_MAX_TOKENS, OPENGROK_AUDIT_LOG_FILE, OPENGROK_RATELIMIT_RPM, OPENGROK_PER_TOOL_RATELIMIT, OPENGROK_TIMEOUT, OPENGROK_DEFAULT_MAX_RESULTS, OPENGROK_PASSWORD_FILE, OPENGROK_MAX_RESPONSE_BYTES, OPENGROK_SEARCH_AND_READ_CAP, OPENGROK_STRICT_SSRF, OPENGROK_JWT_ISSUER, OPENGROK_GRAMMAR_DIR

비밀로 표시된 값은 내 계정의 열쇠예요. 절대 다른 사람과 공유하거나 채팅에 붙여 넣지 마세요.

필요한 것

  • npmNode.js 설치(npx 명령어용)

어떤 앱을 쓰세요?

위에서 앱을 고르세요. 기억해 두었다가 다음부터는 버튼에 “…에 설치”라고 표시해요.

Claude Desktop → Settings → Developer → Edit Config를 열고 claude_desktop_config.json에 이 내용을 붙여 넣으세요

{
  "mcpServers": {
    "opengrok": {
      "command": "npx",
      "args": [
        "-y",
        "opengrok-mcp-server"
      ],
      "env": {
        "OPENGROK_BASE_URL": "your-value",
        "OPENGROK_USERNAME": "your-value",
        "OPENGROK_PASSWORD": "your-value",
        "OPENGROK_VERIFY_SSL": "your-value",
        "OPENGROK_CODE_MODE": "your-value",
        "OPENGROK_ENABLE_MEMORY_TOOLS": "your-value",
        "OPENGROK_DEFAULT_PROJECT": "your-value",
        "OPENGROK_CONTEXT_BUDGET": "your-value",
        "OPENGROK_API_VERSION": "your-value",
        "HTTP_PROXY": "your-value",
        "OPENGROK_RESPONSE_FORMAT_OVERRIDE": "your-value",
        "OPENGROK_MEMORY_BANK_DIR": "your-value",
        "OPENGROK_LOCAL_COMPILE_DB_PATHS": "your-value",
        "OPENGROK_ENABLE_ELICITATION": "your-value",
        "OPENGROK_ENABLE_SAMPLING": "your-value",
        "OPENGROK_SAMPLING_MODEL": "your-value",
        "OPENGROK_ENABLE_FILES_API": "your-value",
        "OPENGROK_ENABLE_OBSERVATION_MASKER": "your-value",
        "OPENGROK_OBSERVATION_MASKER_TURNS": "your-value",
        "OPENGROK_SAMPLING_MAX_TOKENS": "your-value",
        "OPENGROK_AUDIT_LOG_FILE": "your-value",
        "OPENGROK_RATELIMIT_RPM": "your-value",
        "OPENGROK_PER_TOOL_RATELIMIT": "your-value",
        "OPENGROK_TIMEOUT": "your-value",
        "OPENGROK_DEFAULT_MAX_RESULTS": "your-value",
        "OPENGROK_PASSWORD_FILE": "your-value",
        "OPENGROK_MAX_RESPONSE_BYTES": "your-value",
        "OPENGROK_SEARCH_AND_READ_CAP": "your-value",
        "OPENGROK_STRICT_SSRF": "your-value",
        "OPENGROK_JWT_ISSUER": "your-value",
        "OPENGROK_GRAMMAR_DIR": "your-value"
      }
    }
  }
}

터미널에서 이 명령어를 실행하세요

claude mcp add opengrok --env OPENGROK_BASE_URL=your-value --env OPENGROK_USERNAME=your-value --env OPENGROK_PASSWORD=your-value --env OPENGROK_VERIFY_SSL=your-value --env OPENGROK_CODE_MODE=your-value --env OPENGROK_ENABLE_MEMORY_TOOLS=your-value --env OPENGROK_DEFAULT_PROJECT=your-value --env OPENGROK_CONTEXT_BUDGET=your-value --env OPENGROK_API_VERSION=your-value --env HTTP_PROXY=your-value --env OPENGROK_RESPONSE_FORMAT_OVERRIDE=your-value --env OPENGROK_MEMORY_BANK_DIR=your-value --env OPENGROK_LOCAL_COMPILE_DB_PATHS=your-value --env OPENGROK_ENABLE_ELICITATION=your-value --env OPENGROK_ENABLE_SAMPLING=your-value --env OPENGROK_SAMPLING_MODEL=your-value --env OPENGROK_ENABLE_FILES_API=your-value --env OPENGROK_ENABLE_OBSERVATION_MASKER=your-value --env OPENGROK_OBSERVATION_MASKER_TURNS=your-value --env OPENGROK_SAMPLING_MAX_TOKENS=your-value --env OPENGROK_AUDIT_LOG_FILE=your-value --env OPENGROK_RATELIMIT_RPM=your-value --env OPENGROK_PER_TOOL_RATELIMIT=your-value --env OPENGROK_TIMEOUT=your-value --env OPENGROK_DEFAULT_MAX_RESULTS=your-value --env OPENGROK_PASSWORD_FILE=your-value --env OPENGROK_MAX_RESPONSE_BYTES=your-value --env OPENGROK_SEARCH_AND_READ_CAP=your-value --env OPENGROK_STRICT_SSRF=your-value --env OPENGROK_JWT_ISSUER=your-value --env OPENGROK_GRAMMAR_DIR=your-value -- npx -y opengrok-mcp-server

실행하기 전에 빈 값을 채워 주세요.

Cursor에서 열기

또는 설정을 직접 복사하기

프로젝트의 .cursor/mcp.json 또는 ~/.cursor/mcp.json에 붙여 넣으세요

{
  "mcpServers": {
    "opengrok": {
      "command": "npx",
      "args": [
        "-y",
        "opengrok-mcp-server"
      ],
      "env": {
        "OPENGROK_BASE_URL": "your-value",
        "OPENGROK_USERNAME": "your-value",
        "OPENGROK_PASSWORD": "your-value",
        "OPENGROK_VERIFY_SSL": "your-value",
        "OPENGROK_CODE_MODE": "your-value",
        "OPENGROK_ENABLE_MEMORY_TOOLS": "your-value",
        "OPENGROK_DEFAULT_PROJECT": "your-value",
        "OPENGROK_CONTEXT_BUDGET": "your-value",
        "OPENGROK_API_VERSION": "your-value",
        "HTTP_PROXY": "your-value",
        "OPENGROK_RESPONSE_FORMAT_OVERRIDE": "your-value",
        "OPENGROK_MEMORY_BANK_DIR": "your-value",
        "OPENGROK_LOCAL_COMPILE_DB_PATHS": "your-value",
        "OPENGROK_ENABLE_ELICITATION": "your-value",
        "OPENGROK_ENABLE_SAMPLING": "your-value",
        "OPENGROK_SAMPLING_MODEL": "your-value",
        "OPENGROK_ENABLE_FILES_API": "your-value",
        "OPENGROK_ENABLE_OBSERVATION_MASKER": "your-value",
        "OPENGROK_OBSERVATION_MASKER_TURNS": "your-value",
        "OPENGROK_SAMPLING_MAX_TOKENS": "your-value",
        "OPENGROK_AUDIT_LOG_FILE": "your-value",
        "OPENGROK_RATELIMIT_RPM": "your-value",
        "OPENGROK_PER_TOOL_RATELIMIT": "your-value",
        "OPENGROK_TIMEOUT": "your-value",
        "OPENGROK_DEFAULT_MAX_RESULTS": "your-value",
        "OPENGROK_PASSWORD_FILE": "your-value",
        "OPENGROK_MAX_RESPONSE_BYTES": "your-value",
        "OPENGROK_SEARCH_AND_READ_CAP": "your-value",
        "OPENGROK_STRICT_SSRF": "your-value",
        "OPENGROK_JWT_ISSUER": "your-value",
        "OPENGROK_GRAMMAR_DIR": "your-value"
      }
    }
  }
}

브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.

VS Code에서 열기

또는 설정을 직접 복사하기

프로젝트의 .vscode/mcp.json에 붙여 넣으세요

{
  "servers": {
    "opengrok": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "opengrok-mcp-server"
      ],
      "env": {
        "OPENGROK_BASE_URL": "your-value",
        "OPENGROK_USERNAME": "your-value",
        "OPENGROK_PASSWORD": "your-value",
        "OPENGROK_VERIFY_SSL": "your-value",
        "OPENGROK_CODE_MODE": "your-value",
        "OPENGROK_ENABLE_MEMORY_TOOLS": "your-value",
        "OPENGROK_DEFAULT_PROJECT": "your-value",
        "OPENGROK_CONTEXT_BUDGET": "your-value",
        "OPENGROK_API_VERSION": "your-value",
        "HTTP_PROXY": "your-value",
        "OPENGROK_RESPONSE_FORMAT_OVERRIDE": "your-value",
        "OPENGROK_MEMORY_BANK_DIR": "your-value",
        "OPENGROK_LOCAL_COMPILE_DB_PATHS": "your-value",
        "OPENGROK_ENABLE_ELICITATION": "your-value",
        "OPENGROK_ENABLE_SAMPLING": "your-value",
        "OPENGROK_SAMPLING_MODEL": "your-value",
        "OPENGROK_ENABLE_FILES_API": "your-value",
        "OPENGROK_ENABLE_OBSERVATION_MASKER": "your-value",
        "OPENGROK_OBSERVATION_MASKER_TURNS": "your-value",
        "OPENGROK_SAMPLING_MAX_TOKENS": "your-value",
        "OPENGROK_AUDIT_LOG_FILE": "your-value",
        "OPENGROK_RATELIMIT_RPM": "your-value",
        "OPENGROK_PER_TOOL_RATELIMIT": "your-value",
        "OPENGROK_TIMEOUT": "your-value",
        "OPENGROK_DEFAULT_MAX_RESULTS": "your-value",
        "OPENGROK_PASSWORD_FILE": "your-value",
        "OPENGROK_MAX_RESPONSE_BYTES": "your-value",
        "OPENGROK_SEARCH_AND_READ_CAP": "your-value",
        "OPENGROK_STRICT_SSRF": "your-value",
        "OPENGROK_JWT_ISSUER": "your-value",
        "OPENGROK_GRAMMAR_DIR": "your-value"
      }
    }
  }
}

브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.

이 서버는 내 컴퓨터에서 실행되는데, ChatGPT는 인터넷에 있는 서버에만 연결할 수 있어요. 다른 앱을 고르세요.

선택한 앱은 이 기기의 쿠키에만 저장돼요. 계정은 필요 없어요.

직접 입력할 값

  • OPENGROK_BASE_URL 필수 env
    OpenGrok server base URL (e.g. https://opengrok.example.com/source/)
  • OPENGROK_USERNAME env
    OpenGrok authentication username. Leave unset for anonymous access.
  • OPENGROK_PASSWORD 비밀 env
    OpenGrok authentication password. Prefer storing via OS keychain using 'npx opengrok-mcp-server setup'.
  • OPENGROK_VERIFY_SSL env
    Verify TLS certificates. Set to false for self-signed or internal CA certs.
  • OPENGROK_CODE_MODE env
    Enable Code Mode: 2-tool sandbox interface with env.opengrok.* JavaScript API. Reduces AI token usage by ~90%.
  • OPENGROK_ENABLE_MEMORY_TOOLS env
    Register the 3 memory tools in Code Mode (memory status, read, update). Off = api + execute only.
  • OPENGROK_DEFAULT_PROJECT env
    Default project to scope all searches. Can be overridden per call.
  • OPENGROK_CONTEXT_BUDGET env
    Response size tier controlling token usage.
  • OPENGROK_API_VERSION env
    OpenGrok REST API version. Use v2 for call graph features (requires OpenGrok 1.12+).
  • HTTP_PROXY env
    HTTP/HTTPS proxy URL for all OpenGrok API requests (e.g. http://proxy.company.com:8080). Also set as HTTPS_PROXY.
  • OPENGROK_RESPONSE_FORMAT_OVERRIDE env
    Force a specific response format for all tools. Leave unset for per-tool auto-selection (recommended).
  • OPENGROK_MEMORY_BANK_DIR env
    Directory where the AI stores investigation notes (active-task.md, investigation-log.md). Defaults to ~/.config/opengrok-mcp/memory-bank/ or workspace-relative when set by the VS Code extension.
  • OPENGROK_LOCAL_COMPILE_DB_PATHS env
    Comma-separated paths to compile_commands.json for C/C++ compiler flag and include-path extraction. Leave unset for automatic workspace discovery.
  • OPENGROK_ENABLE_ELICITATION env
    Interactive AI Prompts — the AI pauses to ask questions during investigations (project selection, file disambiguation). Requires Claude Code v2.1.76+ or a client that supports MCP Elicitation.
  • OPENGROK_ENABLE_SAMPLING env
    AI Sampling — allow the server to request LLM completions for error explanations and summaries. Off by default to avoid consuming premium requests (e.g. GitHub Copilot).
  • OPENGROK_SAMPLING_MODEL env
    Model preference for MCP Sampling (used for error explanation and query reformulation).
  • OPENGROK_ENABLE_FILES_API env
    Files API Cache — avoids re-uploading unchanged investigation notes. Requires Files API support in the MCP client.
  • OPENGROK_ENABLE_OBSERVATION_MASKER env
    Observation Masker — prepend compact history summaries to opengrok_execute results after N turns. Disabled by default; has no benefit for clients that retain full context (Claude Code, Cursor).
  • OPENGROK_OBSERVATION_MASKER_TURNS env
    Number of most-recent opengrok_execute results to keep as full text before masking older ones. Default: 10.
  • OPENGROK_SAMPLING_MAX_TOKENS env
    Maximum tokens for AI sampling responses (error explanation, query reformulation). Range: 64–4096.
  • OPENGROK_AUDIT_LOG_FILE env
    Path to write structured audit events (CSV/JSON). Appends tool invocations, elicitation events, and errors. Leave unset to disable.
  • OPENGROK_RATELIMIT_RPM env
    Maximum requests per minute to the OpenGrok server. Default: 60.
  • OPENGROK_PER_TOOL_RATELIMIT env
    Per-tool rate limits in requests per minute, as comma-separated tool:rpm pairs (e.g. opengrok_execute:15,opengrok_search_code:30). Overrides OPENGROK_RATELIMIT_RPM for specific tools.
  • OPENGROK_TIMEOUT env
    HTTP request timeout in seconds for OpenGrok API calls. Increase for slow servers. Default: 30.
  • OPENGROK_DEFAULT_MAX_RESULTS env
    Default maximum number of results returned per search query. Default: 25.
  • OPENGROK_PASSWORD_FILE env
    Path to a file containing the OpenGrok password (file-mounted secret for containers). Takes precedence over the OS keychain when OPENGROK_PASSWORD is unset.
  • OPENGROK_MAX_RESPONSE_BYTES env
    Hard cap on response payload size in bytes. Overrides the context-budget default. Non-positive values are ignored.
  • OPENGROK_SEARCH_AND_READ_CAP env
    Cap for the search_and_read compound tool in bytes. Overrides the context-budget default (2–8 KB depending on tier). Non-positive values are ignored.
  • OPENGROK_STRICT_SSRF env
    When true, reject OPENGROK_BASE_URL values pointing at private/loopback IPs at startup. Default: false (warn only; per-request guards still apply).
  • OPENGROK_JWT_ISSUER env
    Expected JWT issuer (iss claim) for HTTP transport OAuth. When set, JWTs from other issuers are rejected.
  • OPENGROK_GRAMMAR_DIR env
    Directory containing tree-sitter WASM grammars. Overrides the bundled grammar lookup.

이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.

할 수 있는 일

내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.

기본 점검i

누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 8일 점검

  • ✓ 통과

    제작자와 저장소 일치

    레지스트리 이름이 GitHub 계정 IcyHot09 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요

  • … 아직 점검 안 함

    계속 관리되고 있음

    아직 GitHub에서 이 저장소를 읽어 오지 않았어요

  • … 아직 점검 안 함

    라이선스 있음

    아직 GitHub에서 이 저장소를 읽어 오지 않았어요

  • – 해당 없음

    엔드포인트 응답

    내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요

  • – 해당 없음

    OAuth로 로그인

    내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요

  • … 아직 점검 안 함

    도구 설명에 숨겨진 지시 없음

    내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요

검색 및 AI 기억 카테고리의 다른 서버와 비교i

  • 이 카테고리의 다른 서버 5670개 중 0%보다 스타가 많아요
  • 이 카테고리의 다른 서버 5670개 중 44%보다 최근에 레지스트리에 공개됐어요
  • 기본 점검 결과가 이 카테고리의 다른 서버 5670개 중 100%와 같거나 더 좋아요

레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.

자주 묻는 질문

OpenGrok MCP Server, 안전한가요?

해당하는 기본 점검 1개 중 1개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.

어떤 키나 코드가 필요한가요?

입력해야 할 값: OPENGROK_BASE_URL, OPENGROK_PASSWORD

내 컴퓨터에서 실행되나요, 클라우드에서 실행되나요?

내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).

아직 관리되고 있나요?

GitHub 저장소는 마지막으로 – 변경됐고, 최신 버전(9.6.0)은 2개월 전 레지스트리에 올라왔어요.

어떤 앱에서 쓸 수 있나요?

Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Node.js도 있어야 해요.

대신 쓸 수 있는 건 뭐가 있나요?

같은 카테고리에는: Context7, Codebase Memory, Exa

대안

같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.

카드 보는 법:★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i

Context7

제작자: upstash

Up-to-date docs for AI agents

컴퓨터 또는 클라우드★ 64,224MIT어제 업데이트
설치

Codebase Memory

제작자: DeusData

Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.

내 컴퓨터에서 실행★ 48,148MIT21일 전 업데이트
설치

Exa

제작자: exa-labs

Connect AI agents to Exa for web search, content fetching, and multi-step research.

클라우드에서 실행★ 5,213MIT2개월 전 업데이트
설치

제작자의 README

README 열기

제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.

OpenGrok MCP Server

Code intelligence for any OpenGrok-indexed codebase — search, read, blame, symbol navigation, diffs, commit history, call graphs, dependency maps, and guided investigation. Optimized for token efficiency through Code Mode and AST-aware code reads.


Quick Start

Option 1 — VS Code Extension

Install OpenGrok MCP from the VS Code Marketplace, or search "OpenGrok" in the Extensions panel. The configuration panel opens on first launch — enter your OpenGrok endpoint, username, and password, then click Save Settings and reload when prompted.

The extension provides a visual configuration UI and manages the MCP server process automatically. No Python, external Node.js install, or manual environment setup required.

Option 2 — npm / npx CLI

npm install -g opengrok-mcp-server

opengrok-mcp setup # interactive wizard: URL, credentials, MCP client registration

Or run without installing:

npx opengrok-mcp-server setup

Other CLI commands:

opengrok-mcp status      # health check: validates connectivity and detects installed MCP clients

opengrok-mcp setup --test # test the stored connection without the wizard opengrok-mcp setup --set contextBudget=generous # update one stored setting non-interactively opengrok-mcp export-audit --format json --output audit.jsonl # export the audit log opengrok-mcp version # print version and exit opengrok-mcp help # show all commands

Works with any MCP-compatible client (CLI or IDE). See MCP_CLIENTS.md for config format and troubleshooting.

Credentials are stored in the OS keychain (macOS Keychain, Windows Credential Manager, Linux libsecret) with an AES-256-GCM encrypted file fallback for headless environments.


[!TIP]

Automatic Updates — The extension checks GitHub for new releases once per 24 hours and notifies you when one is available. Use OpenGrok: Check for Updates to check on demand.


The Problem

Engineers working in large codebases face a specific gap when using AI coding assistants. The model's context window contains the file currently open, the conversation, and whatever has been manually shared — but a production codebase has structure, history, and cross-module relationships that exist entirely outside that window.

A symbol defined in one module and called from seventy others. A function whose behavior only becomes clear from the three commits that shaped it. An include chain stretching across a dozen directories. A call graph showing which components depend on a service before it gets refactored.

Without access to the code index, the model fills these gaps by guessing: it fabricates file paths, invents function signatures, misattributes changes to authors. The model is not wrong because it is unintelligent — it is wrong because it is isolated.

OpenGrok already solves this for human engineers. It indexes source in dozens of programming languages, maintains a full-text index across committed history, and exposes definition lookups, reference graphs, blame, directory traversal, and file history through a REST API. The problem was that AI tools had no way to reach it.


How It Works

┌──────────────────────────────────────────────────────┐

│ AI Client (Claude, Copilot, Cursor, Codex …) │ └─────────────────────┬────────────────────────────────┘ │ MCP (stdio or HTTP) ┌─────────────────────▼────────────────────────────────┐ │ OpenGrok MCP Server (Node.js) │ │ opengrok_api ──── full API spec, once per session │ │ opengrok_execute ─ run JavaScript in sandbox │ │ │ │ OpenGrok client ── search · symbols · blame · diffs │ └─────────────────────┬────────────────────────────────┘ │ HTTP (REST + web fallback) ┌─────────────────────▼────────────────────────────────┐ │ OpenGrok │ │ search · symbols · call graphs · index health │ └──────────────────────────────────────────────────────┘

The server exposes two primary tools. opengrok_api delivers the full API specification at session start. Every subsequent operation goes through opengrok_execute: the AI writes a JavaScript program using the env.opengrok.* object — search, getFileContent, getFileAnnotate, getFileHistory, browseDir, getFileSymbols — and submits it as a single execution.

Intermediate results stay inside the sandbox; only the final return value crosses back to the context window. A complete investigation — find the symbol, read the definition, check who changed it, trace the callers — is one script, not a sequence of round-trips with results flowing through the context between each. Token savings of 80–95% are typical for complex investigations.

All env.opengrok.* calls appear synchronous inside sandbox code — the QuickJS WASM VM bridges async HTTP calls transparently over a SharedArrayBuffer + Atomics channel (8 MB data region, 62 s per-call timeout, 62 s hard execution cap), while keeping the Node.js event loop free.

Memory bank — two files persist across turns and session restarts: active-task.md (4 KB) for current investigation state and investigation-log.md (32 KB) for append-only findings. Inside the sandbox: env.opengrok.readMemory() / env.opengrok.writeMemory(). See the Memory Bank reference below.


Reference

Tool Reference

31 tools total: 2–5 in Code Mode (opengrok_api + opengrok_execute, plus 3 memory tools when OPENGROK_ENABLE_MEMORY_TOOLS=true) and 26 in standard mode (OPENGROK_CODE_MODE=false).

Primary Tools
ToolPurpose
opengrok_search_codeFull-text, definition, reference, path, and history search. Supports file_type filtering and cursor pagination.
opengrok_find_fileLocate files by name or directory pattern. Supports cursor pagination.
opengrok_get_file_contentRead source code. Use start_line / end_line for large files.
opengrok_get_file_historyCommit history for a file. Supports cursor pagination.
opengrok_browse_directoryView folder structure and contained files. Supports cursor / limit pagination.
opengrok_list_projectsList all indexed repositories.
opengrok_get_file_annotateLine-by-line blame annotation. Supports revision, start_line/end_line range, includeContent.
opengrok_get_file_symbolsExtract classes, functions, macros, and structs from a file. Supports cursor pagination.
opengrok_search_suggestQuery autocomplete recommendations. Supports context passthrough for ranking.
Compound Tools

These merge multiple API calls into a single operation.

ToolWhat it replacesSavings
opengrok_get_symbol_contextSearch definition + read source + fetch headers + get references~92% fewer tokens
opengrok_search_and_readSearch + read surrounding context (cap: OPENGROK_SEARCH_AND_READ_CAP)~92% fewer tokens
opengrok_batch_search2–5 parallel searches, deduplicated results~73% fewer tokens
opengrok_index_healthLatency, connectivity, staleness scoreDiagnostic
Investigation Tools
ToolPurpose
opengrok_what_changedRecent line changes grouped by commit — author, date, SHA, changed lines with context
opengrok_dependency_mapBFS traversal of #include/import chains up to depth 3; directed graph with uses/used_by
opengrok_search_patternRegex code search; returns file:line:content matches
opengrok_blameBlame with line range (line_start / line_end) and optional diff
opengrok_call_graphCall chain tracing via OpenGrok API v2 (requires OPENGROK_API_VERSION=v2; refs-based fallback on v1)
opengrok_get_file_diffUnified diff between two revisions with context lines
opengrok_get_compile_infoC/C++ compiler flags and include paths from local compile_commands.json
opengrok_get_all_matchesAll matching lines in a file when search shows truncated hits
opengrok_get_file_history_with_filesCommit history with co-changed file lists via RSS feed
opengrok_get_download_urlDirect download URL for a file (no HTTP call)
opengrok_list_groupsProject groups (empty when admin auth required)
opengrok_get_suggest_popularityPopular suggestions for a project field (empty when admin auth required)
opengrok_get_project_repositoriesRepositories for a project (empty when admin auth required)

*(Note: search tools support language filtering. Pass file_type using the canonical analyzer name — cxx for C++, golang for Go, sh for shell, javascript for JS. Aliases accepted: cpp/c++→cxx, go→golang, bash/shell→sh, js→javascript, ts→typescript, cs→csharp, py→python, rb→ruby, rs→rust.)*

defs/refs/symbol fallback notes — defs, refs, and symbol searches require a project scope (pass projects or set OPENGROK_DEFAULT_PROJECT); without one they may return too many cross-project hits. On instances where the REST endpoint returns an error or empty results for these types, the client automatically falls back to web-UI parsing so the LLM still gets answers. opengrok_call_graph needs API v2 and degrades to a refs-based view on v1.

Code Mode API

Set OPENGROK_CODE_MODE=true (the default). Call opengrok_api once at session start to receive the full API spec. All subsequent operations go through opengrok_execute.

All sandbox API calls are synchronous — flat globals (search(...)), no await. The env.opengrok.* object form (env.opengrok.search(...)) is equivalent.

Search & Discovery

MethodReturns
env.opengrok.search(query, opts?)Full text, defs, refs, symbol, path, hist. Opts: searchType, projects, maxResults (default 5), startIndex, cursor, fileType, sort, maxHitsPerFile, dir, pathFilter, file, expandFunction
env.opengrok.batchSearch(queries[], opts?)One result-set per query (max 10), run in parallel on the host. Per-query expandFunction: true includes enclosing function context
env.opengrok.findFile(pattern, opts?){ totalCount, results: [{project, path}], cursor? }
env.opengrok.searchSuggest(query, opts?){ query, field, suggestions, time }. Opts: field, project/projects, context (other-field values for ranking)
env.opengrok.getAllMatchesInFile(project, path, query, opts?)All matching lines in a file when search results show truncated hits. Also used automatically when search() is given a file: filter (no pagination)

search() uses canonical file type names only (e.g. cxx, golang, sh) — see the alias list above. Pass expandFunction: true to expand matching results to their enclosing function body (adds host-side reads, up to 3 files per call).

Cursor pagination — Methods that return a cursor field (search, findFile, browseDir, getFileSymbols, getFileHistory, `getFileDif

앞부분만 보여 드려요. 나머지는 저장소에서 읽어 보세요

PopNx에게 묻기