{"id":21999924,"url":"https://github.com/mark3labs/mcp-filesystem-server","last_synced_at":"2025-12-29T22:42:33.408Z","repository":{"id":265239049,"uuid":"895547074","full_name":"mark3labs/mcp-filesystem-server","owner":"mark3labs","description":"Go server implementing Model Context Protocol (MCP) for filesystem operations.","archived":false,"fork":false,"pushed_at":"2024-11-28T12:37:52.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-28T13:29:38.258Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mark3labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-28T12:15:08.000Z","updated_at":"2024-11-28T12:37:56.000Z","dependencies_parsed_at":"2024-11-28T16:15:41.742Z","dependency_job_id":null,"html_url":"https://github.com/mark3labs/mcp-filesystem-server","commit_stats":null,"previous_names":["mark3labs/mcp-filesystem-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark3labs%2Fmcp-filesystem-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark3labs%2Fmcp-filesystem-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark3labs%2Fmcp-filesystem-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark3labs%2Fmcp-filesystem-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mark3labs","download_url":"https://codeload.github.com/mark3labs/mcp-filesystem-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227230629,"owners_count":17751472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T23:08:59.643Z","updated_at":"2025-12-29T22:42:33.364Z","avatar_url":"https://github.com/mark3labs.png","language":"Go","funding_links":[],"categories":["File Systems \u0026 Storage","File Management MCP Servers","Dateien und Dokumentenverarbeitung","サーバー実装","📂 \u003ca name=\"file-systems\"\u003e\u003c/a\u003eFile Systems","File Systems","📚 Projects (1974 total)","Community Servers","Legend","📁 File Management","Servers","Go","MCP 服务器精选列表","File Management","Core Servers","MCP Servers","MCP Servers \u0026 Protocol","Filesystem (1 servers)","Server Implementations","Contributing","Table of Contents","Agent Communication Protocols"],"sub_categories":["Version Control","Claude API","Dieselbe Konfiguration, CLI und IDE","📂 \u003ca name=\"file-systems\"\u003e\u003c/a\u003eファイルシステム","MCP Servers","📂 \u003ca name=\"file-systems\"\u003e\u003c/a\u003eFile Systems","Go","📁 文件系统与存储","File Systems 📂","Other MCP Servers","📂 File Systems","File Systems","Model Context Protocol (MCP)"],"readme":"# MCP Filesystem Server\n\nThis MCP server provides secure access to the local filesystem via the Model Context Protocol (MCP).\n\n## Components\n\n### Resources\n\n- **file://**\n  - Name: File System\n  - Description: Access to files and directories on the local file system\n\n### Tools\n\n#### File Operations\n\n- **read_file**\n  - Read the complete contents of a file from the file system\n  - Parameters: `path` (required): Path to the file to read\n\n- **read_multiple_files**\n  - Read the contents of multiple files in a single operation\n  - Parameters: `paths` (required): List of file paths to read\n\n- **write_file**\n  - Create a new file or overwrite an existing file with new content\n  - Parameters: `path` (required): Path where to write the file, `content` (required): Content to write to the file\n\n- **copy_file**\n  - Copy files and directories\n  - Parameters: `source` (required): Source path of the file or directory, `destination` (required): Destination path\n\n- **move_file**\n  - Move or rename files and directories\n  - Parameters: `source` (required): Source path of the file or directory, `destination` (required): Destination path\n\n- **delete_file**\n  - Delete a file or directory from the file system\n  - Parameters: `path` (required): Path to the file or directory to delete, `recursive` (optional): Whether to recursively delete directories (default: false)\n\n- **modify_file**\n  - Update file by finding and replacing text using string matching or regex\n  - Parameters: `path` (required): Path to the file to modify, `find` (required): Text to search for, `replace` (required): Text to replace with, `all_occurrences` (optional): Replace all occurrences (default: true), `regex` (optional): Treat find pattern as regex (default: false)\n\n#### Directory Operations\n\n- **list_directory**\n  - Get a detailed listing of all files and directories in a specified path\n  - Parameters: `path` (required): Path of the directory to list\n\n- **create_directory**\n  - Create a new directory or ensure a directory exists\n  - Parameters: `path` (required): Path of the directory to create\n\n- **tree**\n  - Returns a hierarchical JSON representation of a directory structure\n  - Parameters: `path` (required): Path of the directory to traverse, `depth` (optional): Maximum depth to traverse (default: 3), `follow_symlinks` (optional): Whether to follow symbolic links (default: false)\n\n#### Search and Information\n\n- **search_files**\n  - Recursively search for files and directories matching a pattern\n  - Parameters: `path` (required): Starting path for the search, `pattern` (required): Search pattern to match against file names\n\n- **search_within_files**\n  - Search for text within file contents across directory trees\n  - Parameters: `path` (required): Starting directory for the search, `substring` (required): Text to search for within file contents, `depth` (optional): Maximum directory depth to search, `max_results` (optional): Maximum number of results to return (default: 1000)\n\n- **get_file_info**\n  - Retrieve detailed metadata about a file or directory\n  - Parameters: `path` (required): Path to the file or directory\n\n- **list_allowed_directories**\n  - Returns the list of directories that this server is allowed to access\n  - Parameters: None\n\n## Features\n\n- Secure access to specified directories\n- Path validation to prevent directory traversal attacks\n- Symlink resolution with security checks\n- MIME type detection\n- Support for text, binary, and image files\n- Size limits for inline content and base64 encoding\n\n## Getting Started\n\n### Installation\n\n#### Using Go Install\n\n```bash\ngo install github.com/mark3labs/mcp-filesystem-server@latest\n```\n\n### Usage\n\n#### As a standalone server\n\nStart the MCP server with allowed directories:\n\n```bash\nmcp-filesystem-server /path/to/allowed/directory [/another/allowed/directory ...]\n```\n\n#### As a library in your Go project\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/mark3labs/mcp-filesystem-server/filesystemserver\"\n)\n\nfunc main() {\n\t// Create a new filesystem server with allowed directories\n\tallowedDirs := []string{\"/path/to/allowed/directory\", \"/another/allowed/directory\"}\n\tfs, err := filesystemserver.NewFilesystemServer(allowedDirs)\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to create server: %v\", err)\n\t}\n\n\t// Serve requests\n\tif err := fs.Serve(); err != nil {\n\t\tlog.Fatalf(\"Server error: %v\", err)\n\t}\n}\n```\n\n### Usage with Model Context Protocol\n\nTo integrate this server with apps that support MCP:\n\n```json\n{\n  \"mcpServers\": {\n    \"filesystem\": {\n      \"command\": \"mcp-filesystem-server\",\n      \"args\": [\"/path/to/allowed/directory\", \"/another/allowed/directory\"]\n    }\n  }\n}\n```\n\n### Docker\n\n#### Running with Docker\n\nYou can run the Filesystem MCP server using Docker:\n\n```bash\ndocker run -i --rm ghcr.io/mark3labs/mcp-filesystem-server:latest /path/to/allowed/directory\n```\n\n#### Docker Configuration with MCP\n\nTo integrate the Docker image with apps that support MCP:\n\n```json\n{\n  \"mcpServers\": {\n    \"filesystem\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"-i\",\n        \"--rm\",\n        \"ghcr.io/mark3labs/mcp-filesystem-server:latest\",\n        \"/path/to/allowed/directory\"\n      ]\n    }\n  }\n}\n```\n\nIf you need changes made inside the container to reflect on the host filesystem, you can mount a volume. This allows the container to access and modify files on the host system. Here's an example:\n\n```json\n{\n  \"mcpServers\": {\n    \"filesystem\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"-i\",\n        \"--rm\",\n        \"--volume=/allowed/directory/in/host:/allowed/directory/in/container\",\n        \"ghcr.io/mark3labs/mcp-filesystem-server:latest\",\n        \"/allowed/directory/in/container\"\n      ]\n    }\n  }\n}\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark3labs%2Fmcp-filesystem-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmark3labs%2Fmcp-filesystem-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark3labs%2Fmcp-filesystem-server/lists"}