MCP ExplorerExplorer

Mcp Opengrok

@reemshai10on 12 days ago
1 MIT
FreeCommunity
AI Systems
this is an mcp agent for opengrok

Overview

What is Mcp Opengrok

mcp-opengrok is an MCP (Model Context Protocol) server designed to integrate OpenGrok code search capabilities into the MCP ecosystem, allowing users to perform various code searches directly from their IDE.

Use cases

Use cases include performing code searches for specific terms, finding definitions of functions or classes, retrieving file paths and types, and enhancing productivity through chat-style command interactions within IDEs.

How to use

To use mcp-opengrok, clone the repository, install the dependencies using ‘npm install’, and build the project with ‘npm run build’. Configure the necessary environment variables for OpenGrok credentials and start the server using ‘node dist/index.js’.

Key features

Key features include full-text search in code repositories, searching for definitions, symbols, file paths, and file types, support for chat-style commands, and seamless integration with MCP clients and tools.

Where to use

mcp-opengrok can be used in software development environments where OpenGrok is deployed, particularly for teams that need efficient code search capabilities integrated into their development workflow.

Content

OpenGrok MCP Server

I created this project to provide an MCP (Model Context Protocol) server for integrating OpenGrok code search with the MCP ecosystem. It enables you to perform code searches (full text, definitions, symbols, file paths, and file types) in your OpenGrok instance via chat-style commands or programmatic requests—directly from your IDE.

Features

  • Full-text search in code repositories
  • Search for definitions, symbols, file paths, and file types
  • Chat-style command support (e.g., search_full_text, project=pro, full_text=python)
  • Seamless integration with MCP clients and tools

Prerequisites

  • Node.js (v18+ recommended)
  • Access to an OpenGrok instance with user and password credentials

Installation

Clone this repository and install dependencies:

npm install

Build the project:

npm run build

Configuration

Set the following environment variables:

  • OPENGROK_URL: Base URL of your OpenGrok instance (without /source, e.g., https://opengrok.example.com)
  • OPENGROK_USERNAME: Your OpenGrok username
  • OPENGROK_PASSWORD: Your OpenGrok password

You can set these in your environment or configure them in your VS Code settings.json:

Usage

Start the server:

node dist/index.js

Or, if using VS Code MCP integration, the server will be started automatically with the correct environment.

Example Chat Commands

  • Search full text:
    search_full_text, project=jess_main, full_text=python
  • Search by type:
    search_by_type, project=pro, type=python
  • Search for a symbol:
    search_symbol, project=pro, symbol=MyFunction

Development

  • Source code is in the src directory.
  • TypeScript is used; build output is in dist.
  • Dockerfile is provided for containerized builds.

Tools

No tools

Comments