Skip to main content
Glama

MCP Smart Filesystem Server

by lofcz

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_LINES_PER_PAGENoLines per page when reading files500
MCP_MAX_SEARCH_RESULTSNoSearch results per page100

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
list_directory

List contents of a directory with metadata including file sizes and line counts

read_file

Read file contents. For large files (>500 lines), use start_line to read in chunks (e.g., 0, 500, 1000). Each call returns up to 500 lines. Binary files return metadata only.

search_code

Search for code patterns using ripgrep (very fast). Supports regex patterns and advanced filtering.

PATTERN EXAMPLES:

  • Exact text: "functionName"

  • Multiple options: "\b(class|struct|record|interface|enum)\s+TypeName\b" (finds: class TypeName, record TypeName, interface TypeName, etc.)

  • Regex: "async.Promise<.>" (finds async functions returning Promise)

  • Any declaration: "\b(public|private|protected)\s+\w+\s+methodName"

COMMON USE CASES:

  • Find type declaration: "\b(class|struct|interface|record|enum)\s+TypeName\b"

  • Find method: "\b(public|private|protected|internal).\s+methodName\s\("

  • Find property: "\bpublic\s+\w+\s+propertyName\s*\{"

  • Find async methods: "async.*Task<"

  • Find implementations: ":\s*IInterfaceName\b"

TIPS:

  • Use \b for word boundaries

  • Use \s+ for whitespace

  • Combine alternatives with (opt1|opt2|opt3)

  • Escape special chars: \( \) \{ \}

search_in_file

Search for patterns within a specific file using ripgrep. Like Ctrl+F but with regex support. Useful for finding specific sections in a known file.

find_files

Find files by name using fast pattern matching.

PATTERN EXAMPLES:

  • Exact name: "config.json"

  • Wildcard: "*.config" or "Handler"

  • Multiple extensions: "*.{ts,tsx,js}"

TIPS:

  • Use * for any characters

  • Use ? for single character

  • Use {a,b,c} for alternatives

get_file_info

Get file metadata without reading contents. Useful to check size/line count before reading. For large files, provides reading strategy recommendations.

list_allowed_directories

Show which directories this server can access (security boundaries). No parameters required.

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

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