mcp-filesystem
A secure Model Context Protocol (MCP) server providing filesystem access within predefined directories
claude mcp add --transport stdio gabrielmaialva33-mcp-filesystem npx -y @gabrielmaialva33/mcp-filesystem /path/to/allowed/directory
How to use
The MCP Filesystem Server provides controlled access to your local filesystem for AI models via the Model Context Protocol. It is built with TypeScript and Node.js and exposes a set of file-system related tools, such as reading and writing files, listing directories, creating directories, and querying metadata—all within predefined, safe directories. You can run it locally or via an npm/npx invocation, making it easy to integrate into your existing MCP workflows. To use, point the server at directories you want to allow access to and then interact with the exposed tools (read_file, write_file, list_directory, directory_tree, etc.) through the MCP SDK, a Claude-like UI, or any MCP-compatible client.
How to install
Prerequisites:
- Node.js >= 18.0.0
- Git
- pnpm >= 8.0.0
- Docker (optional)
- Docker Compose (optional)
- Clone the repository:
git clone https://github.com/gabrielmaialva33/mcp-filesystem.git
cd mcp-filesystem
- Install dependencies:
pnpm install
- Build the application (typical for TypeScript projects):
pnpm build
- Run the server locally (specify a directory you want to allow access to):
pnpm start /path/to/allowed/directory
- Alternatively, install and run via the npm package (global):
npm install -g @gabrielmaialva33/mcp-filesystem
mcp-filesystem /path/to/allowed/directory
- Docker usage (optional):
# Build the image
docker build -t gabrielmaialva33/mcp-filesystem .
# Run with a mounted data directory
docker run -i --rm -v /path/to/data:/data:ro gabrielmaialva33/mcp-filesystem /data
- Docker Compose (optional):
mkdir -p data
docker-compose up -d
Additional notes
Tips and common considerations:
- When using Docker, you can mount multiple directories into targets under /projects as described in the README to control access scopes.
- You can create a config.json to store access paths and server options, then start the server with --config=config.json as shown in the Docker example.
- The server exposes a rich set of tools for filesystem operations (read_file, write_file, list_directory, etc.) and system capabilities like get_metrics and execute_command. New curl_request tool will be available in a future release (v1.2.0).
- If using NPX, ensure you pass the exact allowed directories as arguments after the package name to restrict access appropriately.
- For Claude Desktop or other MCP clients, you can embed the mcpServers configuration in your client config to point to this server.
Related MCP Servers
context7
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
obsidian -tools
Add Obsidian integrations like semantic search and custom Templater prompts to Claude or any MCP client.
MiniMax -JS
Official MiniMax Model Context Protocol (MCP) JavaScript implementation that provides seamless integration with MiniMax's powerful AI capabilities including image generation, video generation, text-to-speech, and voice cloning APIs.
filesystem
A Model Context Protocol (MCP) server for platform-agnostic file capabilities, including advanced search/replace and directory tree traversal
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!
akyn-sdk
Turn any data source into an MCP server in 5 minutes. Build AI-agents-ready knowledge bases.