Skip to main content
Glama

Grep MCP Server

by 247arjun

grep_regex

Search files or directories using custom regex patterns, configure case sensitivity, whole word matching, inverted results, context lines, and file extensions for precise text search results.

Instructions

Search using a direct regex pattern

Input Schema

NameRequiredDescriptionDefault
case_sensitiveNoWhether the search should be case sensitive
context_linesNoNumber of context lines to show before/after matches
file_extensionsNoOnly search files with these extensions (e.g., ['js', 'ts'])
invert_matchNoShow lines that don't match the pattern
max_resultsNoMaximum number of results to return
patternYesRegular expression pattern to search for
show_contextNoShow surrounding lines for context
targetYesFile or directory path to search in
whole_wordsNoMatch whole words only

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "case_sensitive": { "default": false, "description": "Whether the search should be case sensitive", "type": "boolean" }, "context_lines": { "default": 2, "description": "Number of context lines to show before/after matches", "type": "number" }, "file_extensions": { "description": "Only search files with these extensions (e.g., ['js', 'ts'])", "items": { "type": "string" }, "type": "array" }, "invert_match": { "default": false, "description": "Show lines that don't match the pattern", "type": "boolean" }, "max_results": { "description": "Maximum number of results to return", "type": "number" }, "pattern": { "description": "Regular expression pattern to search for", "type": "string" }, "show_context": { "default": false, "description": "Show surrounding lines for context", "type": "boolean" }, "target": { "description": "File or directory path to search in", "type": "string" }, "whole_words": { "default": false, "description": "Match whole words only", "type": "boolean" } }, "required": [ "pattern", "target" ], "type": "object" }
Install Server

Other Tools from Grep MCP Server

Related Tools

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/247arjun/mcp-grep'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server