Skip to main content
Glama

Filesystem MCP Server

search_files

Search for files recursively in a specified directory using a glob-style name pattern. Excludes files based on optional patterns and respects .gitignore rules. Ideal for locating files within restricted directory roots.

Instructions

Search for files by name pattern in a directory recursively.

Args: dir (str): Directory to search in (absolute or relative to allowed directories) pattern (str): Glob-style pattern to match file names (e.g., '.py', 'test_') exclude (str, optional): Glob-style pattern to exclude file names

Returns: List[str] | str: List of matching absolute file paths, or error message if failed

Note: - Directory must be within allowed directory roots - Searches recursively through subdirectories - Respects .gitignore files, and ignores hidden files and folders - Returns list for successful searches, string for errors

Input Schema

NameRequiredDescriptionDefault
dirYes
excludeNo
patternYes

Input Schema (JSON Schema)

{ "properties": { "dir": { "title": "Dir", "type": "string" }, "exclude": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Exclude" }, "pattern": { "title": "Pattern", "type": "string" } }, "required": [ "dir", "pattern" ], "type": "object" }
Install Server

Other Tools from Filesystem 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/Preston-Harrison/fs-mcp-py'

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