这是一个提供 ripgrep(rg)搜索功能的 MCP 服务器,适用于如 Claude 等 MCP 客户端。
此服务器提供了强大的 ripgrep 搜索工具的模型上下文协议(MCP)接口。它使 Claude AI 和其他兼容 MCP 的客户端能够在系统文件中执行高性能文本搜索。
rg) 命令。在 macOS 上使用 brew install ripgrep 进行安装。要在桌面版 Claude 中使用此 MCP 服务器:
编辑你的桌面版 Claude 配置文件:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json将以下内容添加到你的配置中:
{
"mcpServers": {
"ripgrep": {
"command": "npx",
"args": ["-y", "mcp-ripgrep@latest"]
}
}
}
将 /path/to/mcp-ripgrep 替换为你克隆此仓库的绝对路径。
重启桌面版 Claude。
基本的 ripgrep 搜索:
模式: error
路径: ./src
带有额外选项的高级搜索:
模式: function
路径: ./src
固定字符串: true
文件类型: ts
包含隐藏文件: false
统计模式出现次数:
模式: TODO
路径: ./src
计数行: true
列出将被搜索的文件,但不实际进行搜索:
路径: ./src
文件类型: js
列出 ripgrep 支持的所有文件类型。
此 MCP 服务器使用 ripgrep 工具执行 shell 命令。尽管已尽力安全地转义参数,但在提供输入时仍需谨慎,因为这些命令会在您的机器上运行。
MIT