Skip to main content

Module grep

Module grep 

Source
Expand description

ripgrep-powered file + line search.

Pure Rust — Python bindings are in mcp-methods-py. Two entry points:

  • ripgrep_files walks a directory tree and searches every file matching the glob/type filter. Optional transform callback runs per-file before search (the Python wrapper bridges a callable into &dyn Fn(&str) -> String).
  • ripgrep_lines greps through a Vec<String> of lines with context-window merging. Returns structured matches.

Structs§

RipgrepFilesOpts
Optional knobs for ripgrep_files.
RipgrepLinesGroup
Result of ripgrep_lines — one entry per merged context window.

Functions§

ripgrep_files
Search for a regex pattern across files using ripgrep’s engine.
ripgrep_lines
Grep through text_lines with context-window merging. Returns one RipgrepLinesGroup per merged window.