Getting Started with MCP Filesystem Server: Docker Deployment Guide
Step-by-step tutorial for deploying MCP Filesystem Server with Docker, configuring it with Claude Desktop and VS Code, and using it for AI-assisted file management.
Getting Started with MCP Filesystem Server: Step-by-Step Guide
This tutorial will walk you through deploying and using the MCP Filesystem Server with Docker. By the end, you'll have a fully functional filesystem server that your AI agents can use to read, write, and manage files on your local machine.
π Explore MCP Filesystem Server on Run This Ai
Docker Compose configs, system requirements, installation guides, and more β all in one place.
View MCP Filesystem Server Tool Page βPrerequisites
- Docker installed on your system (Docker Engine 20.10+)
- MCP-compatible client such as Claude Desktop, VS Code with GitHub Copilot, or Cursor
- Node.js 18+ (optional, for npm-based installation)
Method 1: Docker (Recommended)
The fastest way to get started is with the official Docker image:
# Pull the latest image
docker pull mcp/filesystem:latest
# Run with access to your current directory
docker run -i --rm \
-v /path/to/allowed/dir:/data \
mcp/filesystem:latest \
/data
The -i flag is essential β MCP servers communicate via stdio, so the container must run interactively. Mount the directories you want the AI agent to access as volumes.
Method 2: Docker Compose
For a more permanent setup, create a docker-compose.yml file:
services:
mcp-filesystem-server:
image: mcp/filesystem:latest
restart: unless-stopped
volumes:
- ./projects:/data
- ./config:/config
stdin_open: true
tty: true
Then start it:
docker compose up -d
Method 3: Direct npm Install
If you prefer running without Docker:
# Install globally
npm install -g @modelcontextprotocol/server-filesystem
# Run with specific directory access
mcp-server-filesystem /path/to/projects /path/to/config
Configuring with AI Clients
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"filesystem": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "/Users/me/projects:/data",
"mcp/filesystem:latest",
"/data"
]
}
}
}
VS Code (GitHub Copilot)
Configure in VS Code settings under github.copilot.mcpServers:
{
"github.copilot.mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/projects"
]
}
}
}
What You Can Do
Once configured, your AI agent can:
- Read files: "Read the contents of package.json"
- Write files: "Create a new React component at src/components/Header.tsx"
- Search: "Find all TODO comments in the project"
- Manage directories: "Create a new folder for API routes"
- Get metadata: "What's the size of the largest file in this directory?"
Security Tips
- Only mount directories that the AI agent needs β never the entire filesystem
- Use read-only mounts when the agent only needs to read files
- On multi-user systems, create separate volumes for each user
- Review access patterns with MCP Roots for dynamic, audit-friendly control
Troubleshooting
- Permission denied: Ensure the Docker container has read/write permissions on mounted volumes
- Agent can't find files: Verify the paths passed to the server match the mounted volume paths
- Connection refused: Make sure stdio is properly piped when using docker run -i
Conclusion
The MCP Filesystem Server is one of the simplest yet most powerful tools in the MCP ecosystem. With just a single Docker command, you can give your AI agents the ability to work directly with your files β saving time, reducing copy-paste errors, and enabling fully autonomous development workflows.
π Explore MCP Filesystem Server on Run This Ai
Docker Compose configs, system requirements, installation guides, and more β all in one place.
View MCP Filesystem Server Tool Page β