MCP Ripgrep Server
The MCP Ripgrep Server enables high-performance text searches using the ripgrep tool through an MCP interface. You can:
Search: Find patterns in files with options for context lines, colors, and case sensitivity
Advanced Search: Filter by file type, use fixed strings, set word boundaries, include hidden files
Count Matches: Count occurrences of patterns, with options to count lines instead of total matches
List Files: Show files that match search criteria without performing the actual search
List File Types: Display all file types supported by ripgrep
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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Ripgrep Serversearch for 'TODO' comments in my project's src directory"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Ripgrep Server
An MCP server that provides ripgrep (rg) search capabilities to any MCP client such as Claude.
Overview
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.
Related MCP server: MCP Desktop Tools
Prerequisites
Node.js (v18 or higher)
ripgrep (
rg) command installed and available in your PATH. Install it withbrew install ripgrepon macOS.
Usage with Claude for Desktop
To use this MCP server with Claude for Desktop:
Edit your Claude for Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add the following to your configuration:
{ "mcpServers": { "ripgrep": { "command": "npx", "args": ["-y", "mcp-ripgrep@latest"] } } }Replace
/path/to/mcp-ripgrepwith the absolute path to where you cloned this repository.Restart Claude for Desktop.
Available Tools
search
Basic search with ripgrep:
Pattern: error
Path: ./srcadvanced-search
More advanced search with additional options:
Pattern: function
Path: ./src
FixedStrings: true
FileType: ts
IncludeHidden: falsecount-matches
Count occurrences of a pattern:
Pattern: TODO
Path: ./src
CountLines: truelist-files
List files that would be searched without actually searching them:
Path: ./src
FileType: jslist-file-types
List all supported file types in ripgrep.
Security Considerations
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.
License
MIT
Available Tools
5 toolsadvanced-searchC
Advanced search with ripgrep with more options
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | The search pattern (regex by default) | |
| path | Yes | Directory or file(s) to search. | |
| caseSensitive | No | Use case sensitive search (default: auto) | |
| fixedStrings | No | Treat pattern as a literal string, not a regex | |
| filePattern | No | Filter by file type or glob | |
| fileType | No | Filter by file type (e.g., js, py) | |
| maxResults | No | Limit the number of matching lines | |
| context | No | Show N lines before and after each match | |
| invertMatch | No | Show lines that don't match the pattern | |
| wordMatch | No | Only show matches surrounded by word boundaries | |
| includeHidden | No | Search in hidden files and directories | |
| followSymlinks | No | Follow symbolic links | |
| showFilenamesOnly | No | Only show filenames of matches, not content | |
| showLineNumbers | No | Show line numbers | |
| useColors | No | Use colors in output (default: false) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden for behavioral disclosure. It mentions ripgrep but does not reveal important traits like performance impact, default behaviors (e.g., case sensitivity auto), or side effects. This is insufficient for a tool with many configuration options.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence, front-loading the tool's purpose (advanced search with ripgrep). It is not overly verbose, but could be slightly expanded to include key differentiators without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of 15 parameters and no output schema or annotations, the description is too sparse. It fails to explain the tool's advanced features, return format, or typical usage scenarios, leaving the agent to infer from parameter names alone.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
All 15 parameters are described in the schema, achieving 100% coverage. The description adds no additional meaning or context beyond the parameter names and types, meeting the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states it's an advanced search using ripgrep with more options, clearly indicating the tool's function. However, it does not explicitly differentiate from sibling 'search' beyond implying more features, leaving some ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No usage guidance is provided. The description does not indicate when to use this tool over its siblings (count-matches, list-files, list-file-types, search), nor does it mention any prerequisites or restrictions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
count-matchesB
Count matches in files using ripgrep
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | The search pattern (regex by default) | |
| path | Yes | Directory or file(s) to search. | |
| caseSensitive | No | Use case sensitive search (default: auto) | |
| filePattern | No | Filter by file type or glob | |
| countLines | No | Count matching lines instead of total matches | |
| useColors | No | Use colors in output (default: false) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden but only states the basic function. It fails to disclose behavioral details such as regex handling, line count vs match count behavior, or output format.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, no wasted words. Could benefit from slight expansion to include core purpose, but it is efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 6 parameters and no output schema, the description is too minimal. Missing return format, error cases, and how it differs from sibling tools.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds no additional parameter-level context beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool counts matches in files and names the underlying engine (ripgrep). It distinguishes from siblings like 'search' which likely returns matches rather than counts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like 'search' or 'advanced-search'. No mention of prerequisites, performance considerations, or limitations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list-filesA
List files that would be searched by ripgrep without actually searching them
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Directory or file(s) to search. | |
| filePattern | No | Filter by file type or glob | |
| fileType | No | Filter by file type (e.g., js, py) | |
| includeHidden | No | Include hidden files and directories |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It discloses the key non-searching behavior, but lacks details on other behaviors like symlink handling or .gitignore respect, which would be expected from a ripgrep-based tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that is front-loaded with the key action. Every word serves a purpose with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of sibling tools and 4 parameters, the description explains the core purpose well but lacks details about output format, filtering nuances, or potential limitations. Adequate but with gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with each parameter described. The description adds overarching context about ripgrep behavior but does not add significant detail beyond the schema. Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists files that ripgrep would search, with the unique aspect of not actually searching. This distinguishes it from sibling tools like 'search' which perform actual searches.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use for previewing search scope via 'without actually searching them', but does not explicitly mention when to use alternatives or provide exclusion criteria. Context is clear but lacks direct guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list-file-typesA
List all supported file types in ripgrep
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It correctly implies a read-only enumeration with no side effects. For a simple list operation, this is transparent enough.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence with no extraneous words. It earns its place by being informative yet brief.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (no parameters, no output schema, distinct siblings), the description fully conveys the tool's purpose without needing additional detail.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the baseline is 4. The description adds no parameter info, which is fine since there are none.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'list' and the resource 'supported file types in ripgrep'. It distinguishes from sibling tools like 'search' and 'list-files' by focusing specifically on file type enumeration.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus alternatives. There is no mention of context, prerequisites, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
searchC
Search files for patterns using ripgrep (rg)
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | The search pattern (regex by default) | |
| path | Yes | Directory or file(s) to search. | |
| caseSensitive | No | Use case sensitive search (default: auto) | |
| filePattern | No | Filter by file type or glob | |
| maxResults | No | Limit the number of matching lines | |
| context | No | Show N lines before and after each match | |
| useColors | No | Use colors in output (default: false) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden but only mentions using ripgrep. It lacks details on side effects, ownership, or output behavior, though search is inherently read-only.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very concise with a single sentence, but it lacks structure or front-loading of critical information. Efficient but minimal.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 7 parameters and no output schema or annotations, the description is insufficient. It does not cover return format, pagination, or limitations, leaving significant gaps for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds no extra parameter information beyond the schema, such as regex syntax or default values.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool uses ripgrep to search files, with a direct verb and resource. However, it does not explicitly differentiate from sibling tools like 'advanced-search', leaving some ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus siblings such as 'advanced-search' or 'count-matches'. The agent must infer usage from the name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
- First observed
advanced-search - First observed
count-matches - First observed
list-file-types - First observed
list-files - First observed
search
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose with no ambiguity. 'search' is the basic search, 'advanced-search' adds more options, 'count-matches' focuses on counting, 'list-files' shows files without searching, and 'list-file-types' enumerates file types. The descriptions make it easy to tell them apart.
All tools follow a consistent verb_noun pattern with hyphens (e.g., 'advanced-search', 'count-matches'). The naming is predictable and readable throughout the set, with no deviations in style.
With 5 tools, the server is well-scoped for a ripgrep utility. Each tool earns its place by covering distinct aspects of searching and file listing, avoiding bloat while providing essential functionality.
The tool surface is nearly complete for a ripgrep server, covering search, advanced search, counting, and file listing. A minor gap might be the lack of a tool for managing search contexts or filtering results, but core workflows are well-covered.
Maintenance
Related MCP Connectors
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Agentic search over your Dewey document collections from any MCP-compatible client.
Search the HeyClaude directory of Claude Code agents, MCP servers, skills, and tools.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables file and directory searching through the greply CLI tool with configurable search options like context lines, case sensitivity, and pattern matching. Provides direct access to powerful grep-like functionality from MCP-compatible clients.25 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables searching text across configured local workspaces using ripgrep. Provides secure text search capabilities within defined workspace boundaries through both MCP server and CLI interfaces.MIT
- AlicenseAqualityDmaintenanceProvides ripgrep search capabilities to MCP clients like Claude, enabling high-performance text searches across files on your system.59 npmMIT
- AlicenseNot gradedqualityDmaintenanceA grep server implementation that exposes grep functionality through the Model Context Protocol (MCP), supporting natural language prompts and common grep options such as case-insensitive matching, context lines, and recursive searching.GPL 3.0