MCP Ripgrep Server

by mcollina
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Provides specific configuration support for macOS users, with documented paths for Claude for Desktop configuration and installation instructions for ripgrep via Homebrew.

  • Integrates with Node.js environment to run the ripgrep search functionality, enabling the MCP server to execute high-performance text searches across the filesystem.

MCP Ripgrep 服务器

为任何 MCP 客户端(例如 Claude)提供 ripgrep(rg)搜索功能的 MCP 服务器。

概述

该服务器为强大的ripgrep搜索工具提供了模型上下文协议 (MCP) 接口。它使 Claude AI 和其他兼容 MCP 的客户端能够在系统上的文件中执行高性能文本搜索。

先决条件

  • Node.js(v18 或更高版本)
  • ripgrep ( rg ) 命令已安装并添加到你的 PATH 中。在 macOS 上使用brew install ripgrep命令安装。

与 Claude 桌面版一起使用

要将此 MCP 服务器与 Claude for Desktop 一起使用:

  1. 编辑 Claude for Desktop 配置文件:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. 将以下内容添加到您的配置中:
    { "mcpServers": { "ripgrep": { "command": "npx", "args": ["-y", "mcp-ripgrep@latest"] } } }
    /path/to/mcp-ripgrep替换为您克隆此存储库的绝对路径。
  3. 重新启动 Claude 桌面版。

可用工具

搜索

使用 ripgrep 进行基本搜索:

Pattern: error Path: ./src

高级搜索

具有附加选项的更高级搜索:

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

计数匹配

计算某个模式出现的次数:

Pattern: TODO Path: ./src CountLines: true

列出文件

列出将被搜索但不实际搜索的文件:

Path: ./src FileType: js

列出文件类型

列出 ripgrep 中支持的所有文件类型。

安全注意事项

此 MCP 服务器使用 ripgrep 工具执行 shell 命令。虽然已尽力安全地转义参数,但在输入时请务必谨慎,因为它会在您的计算机上运行命令。

执照

麻省理工学院

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

为 Claude 等 MCP 客户端提供 ripgrep 搜索功能,允许在系统上的文件之间进行高性能文本搜索。

  1. Overview
    1. Prerequisites
      1. Usage with Claude for Desktop
        1. Available Tools
          1. search
          2. advanced-search
          3. count-matches
          4. list-files
          5. list-file-types
        2. Security Considerations
          1. License
            ID: hcia0l3ms0