mcp ripgrep
Provides ripgrep search capabilities to MCP clients like Claude, allowing high-performance text searches across files on your system.
Provides ripgrep search capabilities to MCP clients like Claude, allowing high-performance text searches across files on your system.
An MCP server that provides ripgrep (rg) search capabilities to any MCP client such as Claude.
This server provides a Model Context Protocol (MCP) interface for the powerful ripgrep search tool. It enables Claude AI and other MCP-compatible clients to perform high-performance text searches across files on your system.
rg
) command installed and available in your PATH. Install it with brew install ripgrep
on macOS.To use this MCP server with Claude for Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%Claudeclaude_desktop_config.json
Add the following to your configuration:
{
"mcpServers": {
"ripgrep": {
"command": "npx",
"args": ["-y", "mcp-ripgrep@latest"]
}
}
}
Replace /path/to/mcp-ripgrep
with the absolute path to where you cloned this repository.
Basic search with ripgrep:
Pattern: error
Path: ./src
More advanced search with additional options:
Pattern: function
Path: ./src
FixedStrings: true
FileType: ts
IncludeHidden: false
Count occurrences of a pattern:
Pattern: TODO
Path: ./src
CountLines: true
List files that would be searched without actually searching them:
Path: ./src
FileType: js
List all supported file types in ripgrep.
This MCP server executes shell commands using the ripgrep tool. While efforts have been made to safely escape arguments, use caution when providing input as it runs commands on your machine.
MIT
[
{
"description": "Search files for patterns using ripgrep (rg)",
"inputSchema": {
"properties": {
"caseSensitive": {
"description": "Use case sensitive search (default: auto)",
"type": "boolean"
},
"context": {
"description": "Show N lines before and after each match",
"type": "number"
},
"filePattern": {
"description": "Filter by file type or glob",
"type": "string"
},
"maxResults": {
"description": "Limit the number of matching lines",
"type": "number"
},
"path": {
"description": "Directory or file(s) to search.",
"type": "string"
},
"pattern": {
"description": "The search pattern (regex by default)",
"type": "string"
},
"useColors": {
"description": "Use colors in output (default: false)",
"type": "boolean"
}
},
"required": [
"pattern",
"path"
],
"type": "object"
},
"name": "search"
},
{
"description": "Advanced search with ripgrep with more options",
"inputSchema": {
"properties": {
"caseSensitive": {
"description": "Use case sensitive search (default: auto)",
"type": "boolean"
},
"context": {
"description": "Show N lines before and after each match",
"type": "number"
},
"filePattern": {
"description": "Filter by file type or glob",
"type": "string"
},
"fileType": {
"description": "Filter by file type (e.g., js, py)",
"type": "string"
},
"fixedStrings": {
"description": "Treat pattern as a literal string, not a regex",
"type": "boolean"
},
"followSymlinks": {
"description": "Follow symbolic links",
"type": "boolean"
},
"includeHidden": {
"description": "Search in hidden files and directories",
"type": "boolean"
},
"invertMatch": {
"description": "Show lines that Do not match the pattern",
"type": "boolean"
},
"maxResults": {
"description": "Limit the number of matching lines",
"type": "number"
},
"path": {
"description": "Directory or file(s) to search.",
"type": "string"
},
"pattern": {
"description": "The search pattern (regex by default)",
"type": "string"
},
"showFilenamesOnly": {
"description": "Only show filenames of matches, not content",
"type": "boolean"
},
"showLineNumbers": {
"description": "Show line numbers",
"type": "boolean"
},
"useColors": {
"description": "Use colors in output (default: false)",
"type": "boolean"
},
"wordMatch": {
"description": "Only show matches surrounded by word boundaries",
"type": "boolean"
}
},
"required": [
"pattern",
"path"
],
"type": "object"
},
"name": "advanced-search"
},
{
"description": "Count matches in files using ripgrep",
"inputSchema": {
"properties": {
"caseSensitive": {
"description": "Use case sensitive search (default: auto)",
"type": "boolean"
},
"countLines": {
"description": "Count matching lines instead of total matches",
"type": "boolean"
},
"filePattern": {
"description": "Filter by file type or glob",
"type": "string"
},
"path": {
"description": "Directory or file(s) to search.",
"type": "string"
},
"pattern": {
"description": "The search pattern (regex by default)",
"type": "string"
},
"useColors": {
"description": "Use colors in output (default: false)",
"type": "boolean"
}
},
"required": [
"pattern",
"path"
],
"type": "object"
},
"name": "count-matches"
},
{
"description": "List files that would be searched by ripgrep without actually searching them",
"inputSchema": {
"properties": {
"filePattern": {
"description": "Filter by file type or glob",
"type": "string"
},
"fileType": {
"description": "Filter by file type (e.g., js, py)",
"type": "string"
},
"includeHidden": {
"description": "Include hidden files and directories",
"type": "boolean"
},
"path": {
"description": "Directory or file(s) to search.",
"type": "string"
}
},
"required": [
"path"
],
"type": "object"
},
"name": "list-files"
},
{
"description": "List all supported file types in ripgrep",
"inputSchema": {
"properties": {},
"type": "object"
},
"name": "list-file-types"
}
]