Skip to main content
Glama

MCP Filesystem Server

MIT License
42
  • Apple
  • Linux

grep_files

Search files and directories for specific patterns or regex with customizable filters, context lines, and output formats on the MCP Filesystem Server.

Instructions

Search for pattern in files, similar to grep.

Args: path: Starting directory or file path pattern: Text or regex pattern to search for is_regex: Whether to treat pattern as regex case_sensitive: Whether search is case sensitive whole_word: Match whole words only include_patterns: Only include files matching these patterns exclude_patterns: Exclude files matching these patterns context_lines: Number of lines to show before AND after matches (like grep -C) context_before: Number of lines to show BEFORE matches (like grep -B) context_after: Number of lines to show AFTER matches (like grep -A) results_offset: Start at Nth match (0-based, for pagination) results_limit: Return at most this many matches (for pagination) max_results: Maximum total matches to find during search max_file_size_mb: Skip files larger than this size recursive: Whether to search subdirectories max_depth: Maximum directory depth to recurse count_only: Only show match counts per file format: Output format ('text' or 'json') ctx: MCP context Returns: Search results

Input Schema

NameRequiredDescriptionDefault
case_sensitiveNo
context_afterNo
context_beforeNo
context_linesNo
count_onlyNo
exclude_patternsNo
formatNotext
include_patternsNo
is_regexNo
max_depthNo
max_file_size_mbNo
max_resultsNo
pathYes
patternYes
recursiveNo
results_limitNo
results_offsetNo
whole_wordNo

Input Schema (JSON Schema)

{ "properties": { "case_sensitive": { "default": true, "title": "Case Sensitive", "type": "boolean" }, "context_after": { "default": 0, "title": "Context After", "type": "integer" }, "context_before": { "default": 0, "title": "Context Before", "type": "integer" }, "context_lines": { "default": 0, "title": "Context Lines", "type": "integer" }, "count_only": { "default": false, "title": "Count Only", "type": "boolean" }, "exclude_patterns": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Exclude Patterns" }, "format": { "default": "text", "title": "Format", "type": "string" }, "include_patterns": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Include Patterns" }, "is_regex": { "default": false, "title": "Is Regex", "type": "boolean" }, "max_depth": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Max Depth" }, "max_file_size_mb": { "default": 10, "title": "Max File Size Mb", "type": "number" }, "max_results": { "default": 1000, "title": "Max Results", "type": "integer" }, "path": { "title": "Path", "type": "string" }, "pattern": { "title": "Pattern", "type": "string" }, "recursive": { "default": true, "title": "Recursive", "type": "boolean" }, "results_limit": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Results Limit" }, "results_offset": { "default": 0, "title": "Results Offset", "type": "integer" }, "whole_word": { "default": false, "title": "Whole Word", "type": "boolean" } }, "required": [ "path", "pattern" ], "title": "grep_filesArguments", "type": "object" }

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/safurrier/mcp-filesystem'

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