{"slug": "openai-mcpfs-open-source-filesystem-server-for-the-model-context-protocol", "title": "OpenAI MCPFS: Open-Source Filesystem Server for the Model Context Protocol", "summary": "OpenAI released mcpfs, an open-source reference Model Context Protocol server that exposes the local filesystem to AI agents as structured tools over stdio JSON-RPC 2.0. The server offers read_file, write_file, list_directory and create_directory endpoints, validates paths against an allowed root directory to block traversal attacks, and installs via npm as @modelcontextprotocol/server-filesystem for clients like Claude Desktop and Cursor. It is positioned as a safer alternative to giving agents direct shell access for file operations.", "body_md": "Most AI coding assistants can read your code, but they still can't write a file to your disk without you copy-pasting every block. MCPFS closes that loop by exposing your local filesystem as a standardized Model Context Protocol server.\n\n**TL;DR:** OpenAI's `mcpfs` is a reference MCP server that lets AI agents securely read, write, and manage local files through stdio JSON-RPC. It turns your filesystem into an MCP toolset—no custom wrappers, no shell escapes, just `read_file`, `write_file`, `list_directory`, and `create_directory` endpoints.\n\nToday's agentic coding loops are brittle. You ask Claude or Cursor to refactor a module, it spits out diffs in chat, and you manually apply them file by file. If the agent needs to read three config files, write a test, and update a README, you're still the glue layer copying content between the LLM and your editor.\n\nWorse, giving an LLM direct shell access to `sed`, `awk`, or `rm -rf` is a security non-starter for most teams. You need a middle layer that understands file operations as structured tools, not arbitrary command execution. MCPFS is that layer: it exposes filesystem primitives as MCP capabilities, so the agent requests `read_file` with a path argument instead of spawning `cat`.\n\n`mcpfs` runs as a local process on your machine. Your MCP client (Claude Desktop, Cursor, or a custom client) connects to it over standard input/output using JSON-RPC 2.0. The server validates incoming requests against an allowed root directory, then performs the filesystem operation and returns structured results.\n\n```\n┌─────────────────┐     stdio / JSON-RPC     ┌──────────────────┐\n│  MCP Client     │ <======================> │   mcpfs Server   │\n│ (Claude, Cursor)│                          │  (OpenAI mcpfs)  │\n└─────────────────┘                          └────────┬─────────┘\n                                                      │ local fs\n                                                      │ (root-scoped)\n                                                      v\n                                              ┌───────────────┐\n                                              │   Filesystem  │\n                                              │   (read/write)│\n                                              └───────────────┘\n```\n\nComponents:\n\n`mcpfs` as a subprocess and speaks JSON-RPC over stdin/stdout. No HTTP, no ports, no firewall rules.`initialize`, the server advertises filesystem tools (` read_file`, `write_file`, `list_directory`, `create_directory`).`../../etc/passwd`) before touching disk.` fs`/` fs.promises` operation with structured error responses back to the client.\nInstall via npm (Node 18+):\n\n```\nnpm install -g @modelcontextprotocol/server-filesystem\n# or run directly with npx\nnpx @modelcontextprotocol/server-filesystem /path/to/your/project\n```\n\nTo build from the OpenAI reference repo:\n\n```\ngit clone https://github.com/openai/mcpfs.git\ncd mcpfs\nnpm install\nnpm run build\n```\n\nConfigure your MCP client. Example for Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):\n\n```\n{\n  \"mcpServers\": {\n    \"filesystem\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@modelcontextprotocol/server-filesystem\",\n        \"/Users/you/projects/my-app\"\n      ]\n    }\n  }\n}\n```\n\nRestart Claude Desktop. In chat, you can now reference files:\n\n```\nRead the file src/config.ts and list the contents of src/.\n```\n\nThe client resolves this to `mcpfs` tool calls. You should see tool invocations in the client UI and file contents returned directly into the conversation.\n\n**Three concrete wins:**\n\n**Two honest limitations:**\n\n`$HOME`) effectively gives the agent broad access. Treat the root directory like a least-privilege boundary.\n**Join VibeNode AI on Telegram** — daily open-source AI drops, Claude Code hooks, and ready-to-import n8n JSON workflows. Search `#Drop09` inside the channel: [https://t.me/vibenode_ai](https://t.me/vibenode_ai)\n\nWhat's the biggest friction point you've hit when trying to let AI agents write directly to your local filesystem?\n\n**Need a fast fixed-price build (24–72h)?** I build turnkey landing pages, Telegram bots/Mini Apps, and Python scrapers — [test 8 live interactive demos here](https://vlad61758-eng.github.io/vibenode-demos/) or DM `@vlad256bak` on Telegram.", "url": "https://wpnews.pro/news/openai-mcpfs-open-source-filesystem-server-for-the-model-context-protocol", "canonical_source": "https://dev.to/vlad61758eng/openai-mcpfs-open-source-filesystem-server-for-the-model-context-protocol-4ol4", "published_at": "2026-12-05 09:41:22+00:00", "updated_at": "2026-12-05 09:44:00.223334+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools", "artificial-intelligence"], "entities": ["OpenAI", "Model Context Protocol", "mcpfs", "Claude Desktop", "Cursor", "npm"], "also_reported_by": [], "takeaway": "mcpfs exposes read_file, write_file, list_directory and create_directory as MCP tools over stdio JSON-RPC, scoping every operation to an allowed root directory so agents edit files without shell access.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/openai-mcpfs-open-source-filesystem-server-for-the-model-context-protocol", "markdown": "https://wpnews.pro/news/openai-mcpfs-open-source-filesystem-server-for-the-model-context-protocol.md", "text": "https://wpnews.pro/news/openai-mcpfs-open-source-filesystem-server-for-the-model-context-protocol.txt", "jsonld": "https://wpnews.pro/news/openai-mcpfs-open-source-filesystem-server-for-the-model-context-protocol.jsonld"}}