Filesystem MCP Server provides a secure interface for AI agents to interact with local filesystems through standardized tools. Developed by Casey Hand (@cyanheads), this TypeScript implementation offers essential file operations including reading, writing, updating, and managing directories with robust path resolution, error handling, and logging. The server maintains session state for relative path resolution and implements comprehensive security measures like path sanitization and validation. It's particularly useful for AI workflows requiring file manipulation, code generation, or document analysis while maintaining a clean separation between AI agents and the underlying filesystem.
Sets a default absolute path for the current session. Relative paths used in subsequent tool calls will be resolved against this default. Resets on server restart.
Reads the entire content of a specified file as UTF-8 text. Accepts relative (resolved against default) or absolute paths.
Writes content to a specified file. Creates the file (and necessary parent directories) if it doesn't exist, or overwrites it if it does. Accepts relative or absolute paths.
Performs targeted search-and-replace operations within an existing file using an array of `{search, replace}` blocks. Supports plain text or regex search (`useRegex: true`) and replacing all occurrences (`replaceAll: true`). Accepts relative or absolute paths.
Lists files and directories within a specified path. Options include recursive listing (`includeNested: true`) and limiting the number of entries (`maxEntries`). Accepts relative or absolute paths.
Permanently removes a specific file. Accepts relative or absolute paths.
Permanently removes a directory. Use `recursive: true` to remove non-empty directories and their contents. Accepts relative or absolute paths.
Creates a new directory at the specified path. By default (`create_parents: true`), it also creates any necessary parent directories. Accepts relative or absolute paths.
Moves or renames a file or directory from a source path to a destination path. Accepts relative or absolute paths.
Copies a file or directory from a source path to a destination path. For directories, it copies recursively by default (`recursive: true`). Accepts relative or absolute paths.
No reviews yet. Be the first to review!
Sign in to join the conversation
Our bundler currently only supports TypeScript-based servers. Check back soon!