返回市场
麦克佩格REPgrep

麦克佩格REPgrep

作者:mcollina42 星标更新:2025-04-30

项目介绍

MCP Ripgrep 服务器

这是一个提供 ripgrep(rg)搜索功能的 MCP 服务器,适用于如 Claude 等 MCP 客户端。

概述

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

预备条件

  • Node.js(v18 或更高版本)
  • 已安装并可在 PATH 中访问的 ripgrep (rg) 命令。在 macOS 上使用 brew install ripgrep 进行安装。

在桌面版 Claude 中使用

要在桌面版 Claude 中使用此 MCP 服务器:

  1. 编辑你的桌面版 Claude 配置文件:

    • 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。

可用工具

search

基本的 ripgrep 搜索:

模式: error
路径: ./src

advanced-search

带有额外选项的高级搜索:

模式: function
路径: ./src
固定字符串: true
文件类型: ts
包含隐藏文件: false

count-matches

统计模式出现次数:

模式: TODO
路径: ./src
计数行: true

list-files

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

路径: ./src
文件类型: js

list-file-types

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

安全注意事项

此 MCP 服务器使用 ripgrep 工具执行 shell 命令。尽管已尽力安全地转义参数,但在提供输入时仍需谨慎,因为这些命令会在您的机器上运行。

许可证

MIT