OpenAI published mcpfs on December 1, 2026. It mounts one or more MCP (Model Context Protocol) servers as a read-only filesystem. Resources and skills become files you can open with cat. Each tool becomes an executable Bash script that you run like any other command. A coding agent that already knows ls, grep and pipes can then use an MCP server without any special tool-calling support.
This mcpfs tutorial explains what the project does and how to build it. It then mounts a real public MCP server, walks through tool arguments, and lists the limits to know before you point it at anything important. Unless a snippet is marked as coming from the README, the commands and outputs below come from a test build on an Ubuntu 24.04 server with kernel 6.8. The project's own README calls it "a developer demo" that "is not production ready", so read this as a guide to an experiment, not a deployment plan.
What is mcpfs?
MCP is the open protocol that lets AI agents talk to external systems through "servers". A server can offer tools (actions the agent can call) and resources (data the agent can read). With the newer MCP Skills extension, it can also offer skills: folders of instructions with a SKILL.md file at the root.
Normally an MCP client like Codex, Claude Code or Cursor connects to the server and passes the tool definitions to the model. mcpfs puts a different layer in between. It connects to the server and projects everything into a directory tree. The README gives this example for a server that advertises a resource foo://a/b/c, a skill called demo and a tool called do_stuff:
search
resources/foo/a/b/c
resources/skill/demo/SKILL.md
skills/demo/SKILL.md
skills/demo/references/guide.txt
tools/do_stuff
The repository builds three binaries from Rust:
-
mcpfs-fusefscreates a FUSE mount of the tree on your machine. FUSE (Filesystem in Userspace) is the Linux feature that lets a normal program act as a filesystem. -
mcpfs-virtiofsserves the same tree to a virtual machine over virtio-fs (a shared-folder protocol for VMs), so an agent inside a sandboxed guest can call tools while the MCP connection runs in a daemon on the host. -
mcpfsis the small helper that the tool scripts call to send each invocation to the daemon.
The repository is Apache 2.0 licensed and had about 1,785 GitHub stars when this was written. The Hacker News thread on December 5 reached 119 points.
Why mount an MCP server as a filesystem?
The idea answers a problem that agent builders have discussed for over a year: tool definitions take up context.
Anthropic's engineering post Code execution with MCP (November 4, 2025) says that most MCP clients load all tool definitions into the context window up front. Its proposed fix was to present tools as code files on a filesystem, so the agent lists a directory and reads only the definitions it needs. In Anthropic's example, that cut token use "from 150,000 tokens to 2,000 tokens". Cloudflare's Code Mode post (September 26, 2025) made a related bet. It turns MCP tools into a TypeScript API and lets the model write code against it. Cloudflare's reason, in its own words: "LLMs are better at writing code to call MCP, than at calling MCP directly."
mcpfs takes the same "progressive disclosure" idea (show the agent details only when it asks for them) and drops the programming language. The interface is the shell. An agent runs ls tools/, reads one tool's --help, then calls it and pipes the output into grep or a Python script.
The HN discussion was split, and both sides are useful to read:
- For it: one commenter argued that the model "doesn't even need to grapple with the idea of combining declared tools, because there's no boundary between the MCP tool and the filesystem tools." Another pointed out that hosts running many short-lived agents could save start-up cost, because the catalog is fetched once by the mount.
- Against it: a reply noted that MCP hosts already manage tool selection and do not put every tool into context. Another asked why anyone would choose FUSE over Code Mode, since the extra layer could add latency.
- Old idea, new layer: several people compared it to Plan 9, the Bell Labs operating system where everything, including network services, was a file in a per-process namespace.
Both views can be right. If your agent host already does good tool search, mcpfs adds little for the agent. It still gives you, the developer, a quick way to explore a server by hand.
How do you build mcpfs?
You need Linux, Rust with Cargo, a C compiler, pkg-config and the OpenSSL development headers (the TLS backend links against OpenSSL). For a mount without root, your user needs access to /dev/fuse and the FUSE 3 helper fusermount3. The tool scripts need Bash, and the bundled test server needs Python 3.
git clone https://github.com/openai/mcpfs.git
cd mcpfs
cargo build --workspace --locked --release
On the 2-vCPU test server, the release build took 3 minutes 48 seconds. It produced target/release/mcpfs-fusefs (about 12 MB), target/release/mcpfs-virtiofs (about 12 MB) and target/release/mcpfs (about 1.4 MB). The Cargo.lock file lists 199 packages. One HN commenter questioned that dependency count and asked how to tell which crates are safe. If that matters to you, a dependency checker such as cargo-deny can lint the tree for known advisories and license problems before you run it.
How do you run the bundled demo?
The repository ships a test MCP server in tests/mcp_server.py and a demo script, examples/fuse-single/run.sh, which mounts it, reads a file, runs a tool and unmounts on exit. The steps below do the same by hand with the release binary, so you can see each part.
Start the mount. It runs in the foreground, so use a second terminal for the rest:
mkdir -p /tmp/mcp
target/release/mcpfs-fusefs mount stdio:// /tmp/mcp -- python3 tests/mcp_server.py
The stdio:// form starts the given program and talks to it over standard input and output, which is how most local MCP servers run. In the second terminal:
$ ls /tmp/mcp
resources search skills tools
$ cat /tmp/mcp/skills/org/demo/SKILL.md
---
name: demo
description: "Fixture skill"
---
# Demo
$ /tmp/mcp/tools/do_stuff --foo 7
{"foo":7}
Each tool file is a real script with the tool's documentation written as comments at the top. --help prints that header:
$ /tmp/mcp/tools/do_stuff --help
NAME
do_stuff
DESCRIPTION
Return the arguments
SYNOPSIS
do_stuff --help
do_stuff [--pretty] TOOL_OPTIONS
do_stuff [--pretty] < input.json
do_stuff [--pretty] 'JSON_OBJECT'
INPUT SCHEMA
--enabled (optional) boolean
--foo (optional) integer
An item count.
-- --pretty (optional) boolean
--value (optional) string
The script checks types before anything goes to the server. Passing text to an integer field fails locally with exit code 1:
$ /tmp/mcp/tools/do_stuff --foo notanumber
mcpfs-fusefs: --foo expects a JSON value of type integer
The mount is read-only. touch /tmp/mcp/newfile fails with "Read-only file system". When you are done, unmount with fusermount3 -u -- /tmp/mcp.
How do you mount a real MCP server with mcpfs?
OpenAI runs a public, documentation-only MCP server, used in the mount command below. Its Docs MCP page describes it as read-only access to OpenAI developer documentation that "does not call the OpenAI API on your behalf." No API key is needed, which makes it a safe first target.
mkdir -p /tmp/openai-docs
target/release/mcpfs-fusefs mount https://developers.openai.com/mcp /tmp/openai-docs
In the test run, the mount was ready about 0.65 seconds after the command started. This server only offers tools, so there is no resources/ or skills/ directory. The README explains that each of those appears only when it has entries.
$ ls /tmp/openai-docs/tools
fetch_openai_doc get_openapi_spec list_api_endpoints list_openai_docs search_openai_docs
Now the shell parts start to pay off. This pipeline searches the docs, pulls the first URL out of the JSON with grep and cut, and fetches that page as Markdown:
docs=/tmp/openai-docs/tools
url=$("$docs/search_openai_docs" --query 'Responses API streaming' --limit=1 \
| grep -o '"url":"[^"]*"' | head -1 | cut -d'"' -f4)
"$docs/fetch_openai_doc" --url "$url" > streaming.md
The search returned the Streaming API responses guide, and the fetch wrote a 7,158-byte Markdown copy of it in 0.27 seconds. None of the intermediate JSON had to pass through a model. An agent working in this directory could do the same and read only the final file.
The same idea works for counting. list_api_endpoints prints the OpenAPI paths as indented JSON text, so grep -c counts them. On December 6 it reported 261 paths. That number will change as OpenAI updates its spec.
One detail from the test run: --pretty made no difference to the docs server's output. The README explains why. When a tool returns a single plain text block, the script prints that text exactly as the server sent it. The docs server returns its results that way, so there is no JSON for --pretty to indent.
How do tool arguments work in mcpfs?
There are three ways to send the same input. These come from the README:
tool=/tmp/openai-docs/tools/search_openai_docs
"$tool" --query 'Responses API streaming' --limit=1
printf '%s\n' '{"query":"Responses API streaming","limit":1}' | "$tool"
"$tool" '{"query":"Responses API streaming","limit":1}'
A few rules are worth remembering:
-
Named options accept both
--name VALUEand--name=VALUE. Numbers, booleans, arrays and objects are passed as JSON values, for example--items '[1,2]'. - JSON input is the fallback for complex schemas. If the help page shows no named option for a field, pass a JSON object as an argument or on stdin.
-
Tools without parameters send
{}when you run them on a terminal or with empty stdin. - Exit codes are scriptable. A tool error, protocol error or invalid input gives a nonzero exit.
The original MCP names and JSON schemas are also stored as extended attributes, such as user.mcp.input_schema, which getfattr can read.
How do you mount several MCP servers at once?
Give each server a name with --server NAME URI. For a stdio:// server, --command takes the program and its arguments up to the next --server:
target/release/mcpfs-fusefs mount /tmp/mcp \
--server docs https://developers.openai.com/mcp \
--server alpha stdio:// --command python3 tests/mcp_server.py --fixture-name alpha \
--server beta stdio:// --command python3 tests/mcp_server.py --fixture-name beta
The mount gets one directory per server (docs/, alpha/, beta/) plus merged tools/, resources/ and skills/ views. Unique names keep their plain paths. When two servers both offer a tool with the same name, the merged view adds the server name as a prefix. In the test run, tools/ listed fetch_openai_doc unchanged next to alpha:do_stuff and beta:do_stuff.
For HTTP servers that need a token, the single-server form reads MCPFS_BEARER_TOKEN from the environment. Named servers use --bearer-token-env VAR instead. The README warns that a plain HTTP URL sends the token in clear text, so use HTTPS whenever a token is involved.
What are the mcpfs limits?
The README is direct about these, and they decide where mcpfs fits:
- Trust: "Only use it with MCP servers you trust." Mounting a server reads its whole catalog right away, before you open anything. One slow or faulty server can delay start-up for every server on the same mount.
- No writes, no refresh: the filesystem is read-only, and names and tool schemas are read once. If a server adds a tool, you must remount to see it.
- Missing MCP features: prompts, sampling, interactive elicitation (the server asking the user a question mid-call) and interactive OAuth logins have "no filesystem mapping". Tokens must come from an outside auth client, and you remount after replacing one.
- Timeouts: mcpfs starts cancelling a resource read or tool call after five seconds without a response. The README adds that "a timed-out tool may already have changed remote state", so do not blindly retry tools that create or delete things.
- Caching: each server keeps up to 256 entries and 16 MiB of resource and skill content in memory for up to 30 seconds. Every tool call clears that server's cache.
- Size budgets: all servers on one mount share a 64 MiB catalog budget and up to 262,144 projected filesystem entries. A catalog over either limit makes the mount fail during discovery.
-
Credentials follow the files: for the virtio-fs setup, the README says "a process that can execute the mounted tools can act with the backend's MCP credentials." The same logic applies to a local mount. In the FUSE test run, tool scripts had mode
r-x------and belonged to the mounting user, so every process running as that user could call them. Mount a server with write-capable tools only where all of those processes should have that power.
mcpfs vs Code Mode vs direct tool calls
- Direct MCP tool calls: the client lists tools and the model calls them through its tool-calling format. It needs no extra layer, and some hosts now search for tools instead of loading every definition up front. Every intermediate result still passes through the model.
- Code Mode and code execution (Cloudflare, Anthropic, Pi): the model writes code, usually TypeScript or JavaScript, that calls tools in a sandbox. Results can be filtered and combined before the model sees them. Armin Ronacher's What is Codemode (October 6, 2026) explains that in his Pi harness the Codemode sandbox runs on the harness side, with "no network, no file system, no timers, limited RAM".
- mcpfs: tools become commands inside the environment where the agent already runs Bash. Any language that can run a program can call them, and results can go to files and pipes. The cost is a Linux-only FUSE or virtio-fs layer, a read-only snapshot of the catalog, and a project labeled as a demo.
The difference that matters most is where the call runs. Codemode, as Ronacher describes it, keeps tool calls on the harness side. mcpfs puts them inside the execution environment, next to the agent's shell. That is convenient, and it also means credentials are reachable from that environment unless you use the virtio-fs split.
When should you try mcpfs?
Reasonable uses today:
-
Exploring an unfamiliar MCP server by hand.
ls,--helpandsearchare faster than writing a test client. -
Shell-heavy agent experiments where you want to compare how a model uses a
bin/-style directory against native tool calls on the same task. - Read-only servers such as documentation or search, where a wrong call does little harm.
Wait or avoid:
- Servers with write tools and real credentials, until the project leaves demo status.
- Workflows that rely on prompts, sampling or OAuth flows, which mcpfs does not map.
FAQ
Is mcpfs an official OpenAI product?
It is an Apache 2.0 repository under the OpenAI GitHub organization. Its README calls it a developer demo that is not production ready.
Does mcpfs let an MCP server access my files?
mcpfs works the other way around. It exposes MCP servers as files on your machine, and the mount is read-only. A local stdio server is still a program on your machine, with whatever permissions you start it with.
Can I write to an MCP server through mcpfs?
Not through file writes. Tools can still change remote state when you run them, the same as any MCP tool call.
Does mcpfs work on macOS?
The repository provides Linux FUSE and Linux virtio-fs adapters only. The build instructions say "on Linux".
How do I refresh the tool list after a server changes?
Unmount and mount again. Discovery runs once per server per mount.
Which MCP server would you mount first, and would you let your agent run its tools from a shell?
Top comments (1)
Jamil, the number that stopped me is the 5-second cancellation — because the post says exit codes are scriptable and a tool error gives a nonzero exit, but it never says what a cancelled call actually looks like from the shell. If a tool takes 6 seconds, does the script get a clean nonzero exit with nothing on stdout, a partial result, or something that could pass as a success? That distinction decides whether the grep-and-pipe workflow you show is safe, because a silent partial result would poison a pipeline in a way a native MCP client would surface as an error.
The concrete test I'd love to see: mount a server with one tool that sleeps 10 seconds, call it from a script, and report the exit code and what lands on stdout. The FAQ already covers the remount case for a changed tool list, so the open question for me is purely the timeout path.
And on the trust side, you already flag cargo-deny for the 199 crates in Cargo.lock against a 12 MB binary — did you run it before mounting, and did anything in the tree surprise you?