# Filesystem (MCP Server)

> Secure local file operations with configurable directory access

- Type: MCP server
- Publisher: Model Context Protocol (official)
- Categories: Development, Productivity
- Website: https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem
- Source: https://github.com/modelcontextprotocol/servers
- Transport: stdio
- Launch command: npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/dir
- Sign-in: none
- GitHub stars: 90924
- Listed: 2024-11-25

## About

Reference MCP server for reading, writing, editing, moving and searching files within allowed directories. Access is restricted to directories passed as arguments or provided via MCP Roots.

## Install

1. **Add the server to Codex**

   Codex CLI:

   ```bash
   codex mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/dir
   ```

   config.toml:

   ```toml
   [mcp_servers.filesystem]
   command = "npx"
   args = ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
   ```

   Agents SDK:

   ```python
   from agents import Agent, Runner
   from agents.mcp import MCPServerStdio
   
   async with MCPServerStdio(
       name="Filesystem",
       params={"command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]},
   ) as server:
       agent = Agent(name="Assistant", mcp_servers=[server])
       result = await Runner.run(agent, "List the files in my Desktop folder")
       print(result.final_output)
   ```

## Tools

- `read_text_file`
- `read_media_file`
- `read_multiple_files`
- `write_file`
- `edit_file`
- `create_directory`
- `list_directory`
- `list_directory_with_sizes`
- `move_file`
- `search_files`
- `directory_tree`
- `get_file_info`

## Example prompts

- "List the files in my Desktop folder"
- "Find all markdown files mentioning 'roadmap'"
- "Create a notes.txt file with today's meeting summary"
- "Show me the directory tree of my project"

## Related

- [Chrome DevTools MCP](https://chatgptplugins.directory/mcp/chrome-devtools.md): Let coding agents control and debug a live Chrome browser
- [Playwright MCP](https://chatgptplugins.directory/mcp/playwright.md): Browser automation for agents via Playwright accessibility snapshots
- [GitHub](https://chatgptplugins.directory/mcp/github.md): Manage repos, issues, pull requests and Actions from your AI agent
- [Context7](https://chatgptplugins.directory/mcp/context7.md): Pull up-to-date, version-specific library docs into your coding agent
- [Notion](https://chatgptplugins.directory/mcp/notion.md): Search, read, and write Notion pages, databases, and comments via hosted MCP
- [Excalidraw](https://chatgptplugins.directory/mcp/excalidraw.md): Draw hand-drawn Excalidraw diagrams live inside ChatGPT, Claude and VS Code

---
Source: https://chatgptplugins.directory/mcp/filesystem · Index: https://chatgptplugins.directory/llms.txt · Independent and community-run. Not affiliated with or endorsed by OpenAI. ChatGPT is a trademark of OpenAI.
