ALL INTELLIGENCE
Hacker News AIT2·Tools

OpenAI Releases mcpfs to Mount MCP Servers as Read-Only Filesystems

Original title: OpenAI mcpfs: MCP Filesystem Tools
62AI Score

OpenAI has released mcpfs, a developer demo that exposes one or more MCP servers as a read-only filesystem, mountable locally via Linux FUSE or served to a Linux guest over vhost-user virtio-fs. Users can open resource and skill files with standard Unix tools and invoke each mounted tool as a shell command with named options or JSON input. The project is explicitly not production ready and should only be used with trusted MCP servers.

Full Report

Contents7 sections

mcpfs

Expose one or more MCP servers as a read-only filesystem. Mount it locally with Linux FUSE or serve it to a Linux guest over vhost-user virtio-fs. Open resource and skill files with normal Unix tools. Run each mounted tool as a shell command with named options or JSON input.

mcpfs is a developer demo and is not production ready. Only use it with MCP servers you trust. Mounting a server processes its catalog immediately, before you open a file or run a tool. A slow or faulty server can delay startup for every server on the same mount.

Build

From the repository root on Linux, build all three binaries with Rust and Cargo. The TLS backend needs a C compiler, pkg-config, and OpenSSL development headers.

BASH
cargo build --workspace --locked --release

The binaries are target/release/mcpfs-fusefs (local mounts), target/release/mcpfs-virtiofs (VM backend), and target/release/mcpfs (guest helper).

Examples

To try mcpfs on a FUSE-capable host, run the single-server demo. It mounts the bundled Python fixture, reads a resource and a skill, invokes a tool, and unmounts on exit.

BASH
./examples/fuse-single/run.sh
AdapterOne MCP serverMultiple MCP servers
FUSEfuse-singlefuse-multi
QEMU virtio-fsqemu-singleqemu-multi

Mount with FUSE

Run these commands from the repository root on Linux. For an unprivileged mount, the user needs access to /dev/fuse and the FUSE 3 fusermount3 helper. The mounted tool scripts use Bash.

BASH
mkdir -p /tmp/openai-docs
target/release/mcpfs-fusefs mount https://developers.openai.com/mcp /tmp/openai-docs

The mount runs in the foreground. In another terminal, read the tool's manual, run a search, and unmount it.

BASH
ls /tmp/openai-docs/tools
/tmp/openai-docs/tools/list_api_endpoints --help
/tmp/openai-docs/tools/list_api_endpoints
/tmp/openai-docs/tools/search_openai_docs --pretty --query 'Responses API streaming' --limit=1
fusermount3 -u -- /tmp/openai-docs

This example uses the public documentation server. OpenAI Docs MCP

ServerArguments after mount
Streamable HTTP, including request-scoped SSEhttps://host.example/mcp /tmp/mcp
Local stdio, including authenticated bridgesstdio:// /tmp/mcp -- program arg1 arg2
Concrete resource from a template or an unlisted URIhttps://host.example/mcp /tmp/mcp --resource 'records://team/42'

For the single-server syntax above, set MCPFS_BEARER_TOKEN in the mounting process's environment for an HTTP bearer token. Have the server's auth client acquire or refresh the token and remount after replacing it. Stdio launches the supplied argv directly.

Recommendation

Use an https:// endpoint whenever you supply a bearer token, whether through MCPFS_BEARER_TOKEN or a named server's --bearer-token-env option. With http://, mcpfs sends the token in the clear.

Mount multiple servers

BASH
mkdir -p /tmp/mcp
target/release/mcpfs-fusefs mount /tmp/mcp \
  --server docs https://developers.openai.com/mcp \
  --server local stdio:// --command /path/to/mcp-server

Repeat --server NAME URI to add a server. Put its --resource URI and --bearer-token-env VAR options before --command. For stdio, --command takes the program and its arguments up to the next --server. In a named mount, HTTP bearer tokens come from each server's explicit --bearer-token-env option.

The example exposes docs/tools/ and the namespaces provided by local/. The mount also provides merged tools/, resources/, and skills/ directories wherever there are entries. Unique names keep their paths. If two servers both have a tool named search, the merged directory exposes tools/docs:search and tools/local:search. Resources collide at the same relative path. Skill directory collisions receive the prefix on the directory, so each skill keeps its own SKILL.md and supporting files. A server named search, tools, resources, or skills gets a ~server- prefix on its top-level directory.

Serve a virtio-fs share

Install the mcpfs binary and Bash inside the Linux guest for executable tool and search scripts. On the host, run the virtio-fs backend with that guest binary's path and a socket in a private runtime directory.

BASH
socket="$XDG_RUNTIME_DIR/mcpfs.sock"
target/release/mcpfs-virtiofs \
  --guest-helper /usr/local/bin/mcpfs --uid 1000 --gid 1000 \
  https://developers.openai.com/mcp "$socket"

Pass the socket to a VMM's vhost-user virtio-fs device. For QEMU, these options add the device with the tag mcpfs to a VM configured with 2 GiB of RAM. Adjust the guest UID, GID, and memory size to fit your VM.

TEXT
-object memory-backend-memfd,id=mem,size=2G,share=on
-machine memory-backend=mem
-chardev socket,id=mcpfs,path=/path/to/mcpfs.sock
-device vhost-user-fs-pci,chardev=mcpfs,tag=mcpfs

Inside the guest, run mount -t virtiofs -o ro mcpfs /mnt/mcp. The backend uses the same single-server and named-server arguments as the FUSE CLI, with a socket path in place of the mountpoint. The guest UID and GID default to the daemon's effective IDs. A process that can execute the mounted tools can act with the backend's MCP credentials. QEMU vhost-user backends

Each daemon serves one VMM connection with a high-priority queue and a single request queue. Start a new daemon for a new connection. The guest validation used QEMU with shared memory and an externally managed socket.

For a resource whose size is learned on open, guest programs that use sendfile can see the initial zero size until the kernel refreshes its attributes. A direct read, such as dd if=/mnt/mcp/resources/example, fetches the bytes immediately.

Crates

  • mcpfs provides the common tool and search commands and the helper binary for guests.
  • mcpfs-fusefs adapts the VFS to a local Linux FUSE mount.
  • mcpfs-virtiofs adapts the VFS to guest filesystem requests on vhost-user queues.
  • mcpfs-vfs owns MCP sessions, the namespace, resource and skill caches, open file handles, and tool result selection.
  • mcpfs-ioctl maps the VFS to the Linux tool invocation ABI used by both adapters.

(注:更多技术实现细节与完整 API 文档请查阅原项目 README)