Ripgrep MCP server

Provides high-performance text search capabilities by wrapping ripgrep, enabling powerful file exploration, pattern matching, and content discovery across local filesystems.
Back to servers
Provider
Matteo Collina
Release date
Mar 08, 2025
Language
TypeScript
Package
Stats
632 downloads
13 stars

This MCP Ripgrep Server provides a Model Context Protocol interface to the powerful ripgrep search tool, allowing Claude AI and other MCP-compatible clients to perform high-performance text searches across files on your system.

Prerequisites

  • Node.js (v18 or higher)
  • ripgrep (rg) command installed and available in your PATH
    • Install on macOS with: brew install ripgrep

Setting Up with Claude for Desktop

  1. Edit your Claude for Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the following configuration:

    {
      "mcpServers": {
        "ripgrep": {
          "command": "npx",
          "args": ["-y", "mcp-ripgrep@latest"]
        }
      }
    }
    
  3. Restart Claude for Desktop to apply the changes.

Available Search Tools

The MCP server provides several search capabilities that you can use:

Basic Search

The simplest way to search for patterns in files:

Pattern: error
Path: ./src

Advanced Search

For more control over your search parameters:

Pattern: function
Path: ./src
FixedStrings: true
FileType: ts
IncludeHidden: false

Counting Matches

Count the occurrences of a pattern:

Pattern: TODO
Path: ./src
CountLines: true

Listing Files

List files that would be included in a search without actually searching:

Path: ./src
FileType: js

Listing File Types

Display all supported file types in ripgrep.

Security Note

This server executes shell commands using ripgrep. While input arguments are escaped for safety, exercise caution as commands are executed on your local machine.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later