home / mcp / ripgrep mcp server

Ripgrep MCP Server

An MCP server to wrap ripgrep

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "mcollina-mcp-ripgrep": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-ripgrep@latest"
      ]
    }
  }
}

You have a dedicated MCP server that exposes ripgrep search capabilities to MCP clients. It lets you perform fast text searches across files on your machine from any MCP-enabled tool, enabling powerful, targeted queries with patterns, file types, and path constraints.

How to use

Connect any MCP client that supports the Model Context Protocol to perform ripgrep searches. You can run basic searches to find a pattern, or use advanced options to refine results by file type, path, and other ripgrep flags. Common workflows include locating code references, scanning for TODOs, and counting matches across a project.

How to install

Prerequisites you need on your machine before starting:

- Node.js (v18 or higher)

- ripgrep (rg) installed and available in your PATH

Step by step commands you can run to set up the MCP ripgrep server on your machine:

Install ripgrep on macOS (if you use Homebrew):

brew install ripgrep

Install Node.js v18+ from your preferred source (official installers or package managers).

Install the MCP server package via npx when you are ready to run locally. The standard local (stdio) startup uses npx to launch the server package.

Example configuration for Claude Desktop usage

{
  "mcpServers": {
    "ripgrep": {
      "command": "npx",
      "args": ["-y", "mcp-ripgrep@latest"]
    }
  }
}

Available tools

search

Basic ripgrep search to find a pattern within a specified path.

advanced-search

Advanced ripgrep search with options such as FixedStrings, FileType, IncludeHidden, and more to refine results.

count-matches

Count occurrences of a given pattern, with optional line counting.

list-files

List files that would be searched without performing the actual search.

list-file-types

List all supported file types that ripgrep can recognize.