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. Use it to try ToolHive volume mounts with a local directory.

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.

Usage​

Select the filesystem MCP server in the ToolHive registry.

In the Storage volumes section, add a local directory with /projects as its container path. Choose read-only or read-write access for the mount. If you choose a different container path, use that path in the command arguments too.

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.

Click Install server to start the server.

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 in the UI or use --permission-profile none in the CLI to block outbound network access.

Next steps​