{"id":27114978,"url":"https://github.com/sylphlab/filesystem-mcp","last_synced_at":"2025-04-11T00:59:20.848Z","repository":{"id":286043736,"uuid":"960178243","full_name":"sylphlab/filesystem-mcp","owner":"sylphlab","description":"Node.js Model Context Protocol (MCP) server providing secure, relative filesystem access for AI agents like Cline/Claude.","archived":false,"fork":false,"pushed_at":"2025-04-07T20:39:22.000Z","size":820,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T00:59:17.107Z","etag":null,"topics":["ai-agent","claude-ai","cline","filesystem","mcp","model-context-protocol","nodejs","npm","roo-code","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@shtse8/filesystem-mcp","language":"TypeScript","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/sylphlab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"shtse8","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null,"buy_me_a_coffee":"shtse8"}},"created_at":"2025-04-04T01:43:55.000Z","updated_at":"2025-04-07T20:39:26.000Z","dependencies_parsed_at":"2025-04-09T22:33:14.476Z","dependency_job_id":null,"html_url":"https://github.com/sylphlab/filesystem-mcp","commit_stats":null,"previous_names":["shtse8/filesystem-mcp","sylphlab/filesystem-mcp"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylphlab%2Ffilesystem-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylphlab%2Ffilesystem-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylphlab%2Ffilesystem-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylphlab%2Ffilesystem-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sylphlab","download_url":"https://codeload.github.com/sylphlab/filesystem-mcp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322611,"owners_count":21084336,"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":["ai-agent","claude-ai","cline","filesystem","mcp","model-context-protocol","nodejs","npm","roo-code","typescript"],"created_at":"2025-04-07T04:39:35.278Z","updated_at":"2025-04-11T00:59:20.824Z","avatar_url":"https://github.com/sylphlab.png","language":"TypeScript","funding_links":["https://github.com/sponsors/shtse8","https://buymeacoffee.com/shtse8"],"categories":["File Management MCP Servers","📁 Filesystems","📁 File Management"],"sub_categories":[],"readme":"# Filesystem MCP Server (@sylphlab/filesystem-mcp)\n\n[![npm version](https://badge.fury.io/js/%40sylphlab%2Ffilesystem-mcp.svg)](https://badge.fury.io/js/%40sylphlab%2Ffilesystem-mcp)\n[![Docker Pulls](https://img.shields.io/docker/pulls/sylphlab/filesystem-mcp.svg)](https://hub.docker.com/r/sylphlab/filesystem-mcp)\n\n\u003c!-- Add other badges like License, Build Status if applicable --\u003e\n\u003ca href=\"https://glama.ai/mcp/servers/@sylphlab/filesystem-mcp\"\u003e\n  \u003cimg width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/@sylphlab/filesystem-mcp/badge\" /\u003e\n\u003c/a\u003e\n\n**Empower your AI agents (like Cline/Claude) with secure, efficient, and token-saving access to your project files.** This Node.js server implements the [Model Context Protocol (MCP)](https://docs.modelcontextprotocol.com/) to provide a robust set of filesystem tools, operating safely within a defined project root directory.\n\n## Installation\n\nThere are several ways to use the Filesystem MCP Server:\n\n**1. Recommended: `npx` (or `bunx`) via MCP Host Configuration**\n\nThe simplest way is via `npx` or `bunx`, configured directly in your MCP host environment (e.g., Roo/Cline's `mcp_settings.json`). This ensures you always use the latest version from npm without needing local installation or Docker.\n\n_Example (`npx`):_\n\n```json\n{\n  \"mcpServers\": {\n    \"filesystem-mcp\": {\n      \"command\": \"npx\",\n      \"args\": [\"@sylphlab/filesystem-mcp\"],\n      \"name\": \"Filesystem (npx)\"\n    }\n  }\n}\n```\n\n_Example (`bunx`):_\n\n```json\n{\n  \"mcpServers\": {\n    \"filesystem-mcp\": {\n      \"command\": \"bunx\",\n      \"args\": [\"@sylphlab/filesystem-mcp\"],\n      \"name\": \"Filesystem (bunx)\"\n    }\n  }\n}\n```\n\n**Important:** The server uses its own Current Working Directory (`cwd`) as the project root. Ensure your MCP Host (e.g., Cline/VSCode) is configured to launch the command with the `cwd` set to your active project's root directory.\n\n**2. Docker**\n\nUse the official Docker image for containerized environments.\n\n_Example MCP Host Configuration:_\n\n```json\n{\n  \"mcpServers\": {\n    \"filesystem-mcp\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"-i\",\n        \"--rm\",\n        \"-v\",\n        \"/path/to/your/project:/app\", // Mount your project to /app\n        \"sylphlab/filesystem-mcp:latest\"\n      ],\n      \"name\": \"Filesystem (Docker)\"\n    }\n  }\n}\n```\n\n**Remember to replace `/path/to/your/project` with the correct absolute path.**\n\n**3. Local Build (For Development)**\n\n1.  Clone: `git clone https://github.com/sylphlab/filesystem-mcp.git`\n2.  Install: `cd filesystem-mcp \u0026\u0026 pnpm install` (Using pnpm now)\n3.  Build: `pnpm run build`\n4.  Configure MCP Host:\n    ```json\n    {\n      \"mcpServers\": {\n        \"filesystem-mcp\": {\n          \"command\": \"node\",\n          \"args\": [\"/path/to/cloned/repo/filesystem-mcp/dist/index.js\"], // Updated build dir\n          \"name\": \"Filesystem (Local Build)\"\n        }\n      }\n    }\n    ```\n    **Note:** Launch the `node` command from the directory you intend as the project root.\n\n## Quick Start\n\nOnce the server is configured in your MCP host (see Installation), your AI agent can immediately start using the filesystem tools.\n\n_Example Agent Interaction (Conceptual):_\n\n```\nAgent: \u003cuse_mcp_tool\u003e\n         \u003cserver_name\u003efilesystem-mcp\u003c/server_name\u003e\n         \u003ctool_name\u003eread_content\u003c/tool_name\u003e\n         \u003carguments\u003e{\"paths\": [\"src/index.ts\"]}\u003c/arguments\u003e\n       \u003c/use_mcp_tool\u003e\n\nServer Response: (Content of src/index.ts)\n```\n\n## Why Choose This Project?\n\n- **🛡️ Secure \u0026 Convenient Project Root Focus:** Operations confined to the project root (`cwd` at launch).\n- **⚡ Optimized \u0026 Consolidated Tools:** Batch operations reduce AI-server round trips, saving tokens and latency. Reliable results for each item in a batch.\n- **🚀 Easy Integration:** Quick setup via `npx`/`bunx`.\n- **🐳 Containerized Option:** Available as a Docker image.\n- **🔧 Comprehensive Functionality:** Covers a wide range of filesystem tasks.\n- **✅ Robust Validation:** Uses Zod schemas for argument validation.\n\n## Performance Advantages\n\n_(Placeholder: Add benchmark results and comparisons here, demonstrating advantages over alternative methods like individual shell commands.)_\n\n- **Batch Operations:** Significantly reduces overhead compared to single operations.\n- **Direct API Usage:** More efficient than spawning shell processes for each command.\n- _(Add specific benchmark data when available)_\n\n## Features\n\nThis server equips your AI agent with a powerful and efficient filesystem toolkit:\n\n- 📁 **Explore \u0026 Inspect (`list_files`, `stat_items`):** List files/directories (recursive, stats), get detailed status for multiple items.\n- 📄 **Read \u0026 Write Content (`read_content`, `write_content`):** Read/write/append multiple files, creates parent directories.\n- ✏️ **Precision Editing \u0026 Searching (`edit_file`, `search_files`, `replace_content`):** Surgical edits (insert, replace, delete) across multiple files with indentation preservation and diff output; regex search with context; multi-file search/replace.\n- 🏗️ **Manage Directories (`create_directories`):** Create multiple directories including intermediate parents.\n- 🗑️ **Delete Safely (`delete_items`):** Remove multiple files/directories recursively.\n- ↔️ **Move \u0026 Copy (`move_items`, `copy_items`):** Move/rename/copy multiple files/directories.\n- 🔒 **Control Permissions (`chmod_items`, `chown_items`):** Change POSIX permissions and ownership for multiple items.\n\n**Key Benefit:** All tools accepting multiple paths/operations process each item individually and return a detailed status report.\n\n## Design Philosophy\n\n_(Placeholder: Explain the core design principles.)_\n\n- **Security First:** Prioritize preventing access outside the project root.\n- **Efficiency:** Minimize communication overhead and token usage for AI interactions.\n- **Robustness:** Provide detailed results and error reporting for batch operations.\n- **Simplicity:** Offer a clear and consistent API via MCP.\n- **Standard Compliance:** Adhere strictly to the Model Context Protocol.\n\n## Comparison with Other Solutions\n\n_(Placeholder: Objectively compare with alternatives.)_\n\n| Feature/Aspect          | Filesystem MCP Server | Individual Shell Commands (via Agent) | Other Custom Scripts |\n| :---------------------- | :-------------------- | :------------------------------------ | :------------------- |\n| **Security**            | High (Root Confined)  | Low (Agent needs shell access)        | Variable             |\n| **Efficiency (Tokens)** | High (Batching)       | Low (One command per op)              | Variable             |\n| **Latency**             | Low (Direct API)      | High (Shell spawn overhead)           | Variable             |\n| **Batch Operations**    | Yes (Most tools)      | No                                    | Maybe                |\n| **Error Reporting**     | Detailed (Per item)   | Basic (stdout/stderr parsing)         | Variable             |\n| **Setup**               | Easy (npx/Docker)     | Requires secure shell setup           | Custom               |\n\n## Future Plans\n\n_(Placeholder: List upcoming features or improvements.)_\n\n- Explore file watching capabilities.\n- Investigate streaming support for very large files.\n- Enhance performance for specific operations.\n- Add more advanced filtering options for `list_files`.\n\n## Documentation\n\n_(Placeholder: Add link to the full documentation website once available.)_\n\nFull documentation, including detailed API references and examples, will be available at: [Link to Docs Site]\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on the [GitHub repository](https://github.com/sylphlab/filesystem-mcp).\n\n## License\n\nThis project is released under the [MIT License](LICENSE).\n\n---\n\n## Development\n\n1. Clone: `git clone https://github.com/sylphlab/filesystem-mcp.git`\n2. Install: `cd filesystem-mcp \u0026\u0026 pnpm install`\n3. Build: `pnpm run build` (compiles TypeScript to `dist/`)\n4. Watch: `pnpm run dev` (optional, recompiles on save)\n\n## Publishing (via GitHub Actions)\n\nThis repository uses GitHub Actions (`.github/workflows/publish.yml`) to automatically publish the package to [npm](https://www.npmjs.com/package/@sylphlab/filesystem-mcp) and build/push a Docker image to [Docker Hub](https://hub.docker.com/r/sylphlab/filesystem-mcp) on pushes of version tags (`v*.*.*`) to the `main` branch. Requires `NPM_TOKEN`, `DOCKERHUB_USERNAME`, and `DOCKERHUB_TOKEN` secrets configured in the GitHub repository settings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylphlab%2Ffilesystem-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsylphlab%2Ffilesystem-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylphlab%2Ffilesystem-mcp/lists"}