mcp-grep

mcp-grep

Python-based MCP server exposing grep functionality to LLMs, with regex, context, and recursion.

20
Stars
3
Forks
3
Releases

Overview

MCP-Grep is a Python-based server that exposes grep capabilities through the Model Context Protocol (MCP), enabling large language models and other MCP clients to perform text search operations against files and directories. It provides a resource grep://info that returns metadata about the system grep binary (path, version, and supported features) and a tool named grep that performs pattern matching using the system grep. The server can be installed via pip or via Smithery, and runs as mcp-grep-server or, for interactive debugging, mcp-grep-inspector. Key features include discovering the grep binary specifics, performing regex-based searches across files, and supporting common grep options such as case-insensitive matching, showing context lines, limiting results, and fixed-string searches, plus recursive directory traversal. It also supports natural language prompts to simplify queries for LLMs and offers MCP Inspector integration for interactive debugging and testing, including exploring resources, testing queries with different parameters, and viewing formatted results.

Details

Owner
erniebrodeur
Language
Python
License
GNU General Public License v3.0
Updated
2025-12-07

Features

Grep binary information

Provides information about the system grep binary, including path, version, and supported features.

Regex-based pattern search

Searches for patterns in files using regular expressions via the system grep binary.

Case-insensitive matching

Supports case-insensitive search.

Context lines

Shows surrounding context lines before and after matches for easier interpretation.

Maximum match count

Allows limiting the number of results returned.

Fixed string matching

Supports fixed-string (non-regex) searches.

Recursive directory searching

Can search directories recursively.

MCP Inspector integration

Provides interactive debugging and testing via the MCP Inspector UI.

Audience

MCP clientsInteract with the MCP-Grep server to perform grep queries via MCP tools and resources.

Tags

grepMCPgrep-infotext searchregexcase-insensitivecontext linesrecursive searchfixed string searchnatural language promptsMCP InspectorPython