Skip to main content
Glama

Filesystem MCP Server

by rawr-ai

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

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
read_file

Read the complete contents of a file from the file system. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Requires maxBytes parameter. Only works within allowed directories.

read_multiple_files

Read the contents of multiple files simultaneously. This is more efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation. Requires maxBytesPerFile parameter. Only works within allowed directories.

list_directory

Get a detailed listing of all files and directories in a specified path. Results clearly distinguish between files and directories with [FILE] and [DIR] prefixes. This tool is essential for understanding directory structure and finding specific files within a directory. Only works within allowed directories.

directory_tree

Get a recursive tree view of files and directories as a JSON structure. Supports depth limiting to control traversal depth and exclusion patterns using glob syntax. Each entry includes 'name', 'type' (file/directory), and 'children' for directories. Files have no children array, while directories always have a children array (which may be empty). Requires maxDepth parameter (default 2) to limit recursion. Use excludePatterns to filter out unwanted files/directories. The output is formatted with 2-space indentation for readability. Only works within allowed directories.

search_files

Recursively search for files and directories matching a pattern. Searches through all subdirectories from the starting path. The search is case-insensitive and matches partial names. Returns full paths to all matching items. Requires maxDepth (default 2) and maxResults (default 10) parameters. Great for finding files when you don't know their exact location. Only searches within allowed directories.

find_files_by_extension

Recursively find all files with a specific extension. Searches through all subdirectories from the starting path. Extension matching is case-insensitive. Returns full paths to all matching files. Requires maxDepth (default 2) and maxResults (default 10) parameters. Perfect for finding all XML, JSON, or other file types in a directory structure. Only searches within allowed directories.

get_file_info

Retrieve detailed metadata about a file or directory. Returns comprehensive information including size, creation time, last modified time, permissions, and type. This tool is perfect for understanding file characteristics without reading the actual content. Only works within allowed directories.

list_allowed_directories

Returns the list of directories that this server is allowed to access. Use this to understand which directories are available before trying to access files.

get_permissions

Returns the current permission state of the server, including which operations are allowed (create, edit, move, delete) and whether the server is in read-only mode or has full access. Use this to understand what operations are permitted before attempting them.

xml_query

Query XML file using XPath expressions. Provides powerful search capabilities without reading the entire file into memory. Supports standard XPath 1.0 query syntax for finding elements, attributes, and text content. Requires maxBytes parameter (default 10KB). Can be used to extract specific data from large XML files with precise queries. The path must be within allowed directories.

xml_structure

Analyze XML file structure without reading the entire file. Returns statistical information about element counts, attribute usage, namespaces, and hierarchical structure. Useful for understanding the structure of large XML files before performing detailed queries. Requires maxBytes (default 10KB) and maxDepth (default 2) parameters. The path must be within allowed directories.

xml_to_json_string

Convert an XML file to a JSON string and return it directly. This is useful for quickly inspecting XML content as JSON without creating a new file. Requires maxBytes parameter (default 10KB). Uses fast-xml-parser for conversion. The input path must be within allowed directories. This tool is fully functional in both readonly and write modes (respecting maxBytes) since it only reads the XML file and returns the parsed data.

json_query

Query JSON data using JSONPath expressions. Provides powerful search capabilities for selecting data within JSON structures. Supports standard JSONPath syntax for finding values, arrays, and nested structures. Requires maxBytes parameter (default 10KB). The path must be within allowed directories.

json_structure

Get the structure of a JSON file by analyzing its top-level keys and their types. Returns a mapping of key names to their corresponding data types (string, number, array, etc). For arrays, it also indicates the type of the first element if available. This is useful for understanding the shape of large JSON files without loading their entire content. Requires maxBytes (default 10KB) and maxDepth (default 2) parameters. The path must be within allowed directories.

json_filter

Filter JSON array data using flexible conditions. Supports various comparison operators (equals, greater than, contains, etc.) and can combine multiple conditions with AND/OR logic. Requires maxBytes parameter (default 10KB). Perfect for filtering collections of objects based on their properties. The path must be within allowed directories.

json_get_value

Get a specific value from a JSON file using a field path. Supports dot notation for accessing nested properties and array indices. Requires maxBytes parameter (default 10KB). Returns the value directly, properly formatted. The path must be within allowed directories.

json_transform

Transform JSON data using a sequence of operations. Supports operations like mapping array elements, grouping by fields, sorting, flattening nested arrays, and picking/omitting fields. Requires maxBytes parameter (default 10KB). Operations are applied in sequence to transform the data structure. The path must be within allowed directories.

json_sample

Sample JSON data from a JSON file. Requires maxBytes parameter (default 10KB). Returns a random sample of data from the JSON file. The path must be within allowed directories.

json_validate

Validate JSON data against a JSON schema. Requires maxBytes parameter (default 10KB) for the data file. Returns true if the JSON data is valid against the schema, or false if it is not. The path must be within allowed directories.

json_search_kv

Search for key-value pairs in JSON files within a directory. Requires maxBytes (default 10KB), maxDepth (default 2), and maxResults (default 10) parameters. Returns all key-value pairs that match the search pattern. The path must be within allowed directories.

regex_search_content

Recursively search file content using a regex pattern. Searches through subdirectories from the starting path. Returns a list of files containing matches, including line numbers and matching lines. Requires regex pattern. Optional: path, filePattern, maxDepth, maxFileSize, maxResults. Only searches within allowed directories.

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

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