Labsco
MCP SERVER

Ripgrep MCP Server

by mcollina

Search a codebase with ripgrep from the session — with context lines, type filters, literal-string mode and inverted matches — or just count the hits instead of drowning in them.

Local Filesystem AccessVerified
Summary
A search across a large repository stops costing you the context window it fills.

count-matches answers "how common is this" without returning a single hit, list-files answers "what would this even search" before you pay for the scan, and maxResults bounds whatever is left. advanced-search carries the flags that usually decide the outcome — fixedStrings when the pattern is literal text that looks like a regex, invertMatch when the interesting files are the ones without the match, includeHidden when the answer is in something ripgrep skips by default.

What it is

A ripgrep wrapper in five tools: a plain pattern search, an advanced search that exposes ripgrep's flags as parameters, a count-only mode, a dry run that lists the files a search would cover, and ripgrep's own type list.

What you get
  • Pattern search with case sensitivity, a file glob, surrounding context lines and a result cap
  • The flags that decide whether a search is useful, as parameters: fileType, fixedStrings, invertMatch, includeHidden, followSymlinks, showFilenamesOnly
  • Counts instead of matches, per file or per matching line
  • The set of files a search would cover, listed without running the search
  • The file types ripgrep knows, so fileType is passed a name it recognises
Requirements

Ripgrep (rg) available on the machine, and Node on your PATH.

Setup effort

One command — npx -y mcp-ripgrep@latest