Skip to main content

Filesystem MCP server guide

Overview

The Filesystem MCP server provides access to the local filesystem, allowing AI agents to read and write files as part of their workflows.

note

Since most AI agent host applications like IDEs already have access to your working directory, this MCP server is primarily useful for access to files outside your working directory, headless environments where the host application does not provide filesystem access, or for demonstrating MCP capabilities.

Metadata

Error: Failed to fetch metadata for MCP server "filesystem".
Error details
# Error fetching data for filesystem
# Failed to fetch MCP server data. See logs for details.
# Please check that the server exists in the registry and thv command is available

Usage

Select the filesystem MCP server in the ToolHive registry.

In the Storage volumes section, add local files or folders to expose to the MCP server. In the drop-down, choose whether to mount the volume as read-only or read-write.

note

By default, the server expects files to be located in /projects. If you use a different container path, you must update the command arguments to replace /projects with your custom path.

Filesystem MCP server UIFilesystem MCP server UI
Security tip

Since the server does not require any network access, enable network isolation and do not add any hosts or ports to completely restrict its outbound network access.

Sample prompts

Here are some sample prompts you can use to interact with the Filesystem MCP server:

  • "List all files in the /projects directory"
  • "Read the contents of the file /projects/example.txt"
  • "Write 'Hello, World!' to the file /projects/hello.txt"
  • Mount only the directories or files required for your AI agent's tasks to minimize resource usage and improve performance.
  • Use read-only mounts for directories or files that do not need to be modified by the AI agent to prevent accidental changes.
  • Enable network isolation to restrict the server's outbound network access, since the filesystem MCP server does not require any network connectivity.