📁 File System MCP Server

Development Environment Access

Secure file system integration for local development environments with enterprise security controls and project workspace management.

File System Capabilities

Controlled access to development workspace and project files

📂 Workspace Management

  • Project workspace discovery and navigation
  • File and directory structure analysis
  • Code repository integration
  • Development environment setup

🔍 File Operations

  • Read-only file content access
  • File search and pattern matching
  • Metadata and permission analysis
  • Version control status checking

🛡️ Security Controls

  • Restricted directory access
  • File type and extension filtering
  • Sensitive data detection
  • Access logging and monitoring

Step-by-Step Setup

Follow these steps to set up secure file system access

Step 1: Install the File System MCP Server

Install the File System MCP server on your development machine:

# Install the File System MCP server
npm install -g @mcp/filesystem-server

# Verify installation
mcp --version

Step 2: Identify Your Development Workspace

Determine which directories you need access to:

  • Primary workspace (e.g., /home/username/projects or ~/Development)
  • Company tools directory (e.g., /opt/company/tools)
  • Configuration directories (e.g., ~/.config for development configs)
  • Any other project-related directories

Note: For security, only specify directories you actually need for development work.

Step 3: Configure Allowed Directories

Set up the file system access with proper security restrictions:

# Set your workspace paths (adjust to your actual paths)
export WORKSPACE_DIR="$HOME/projects"
export TOOLS_DIR="/opt/company/tools"
export CONFIG_DIR="$HOME/.config/development"

# Configure the MCP server with read-only access
mcp config filesystem \
  --workspace $WORKSPACE_DIR \
  --allowed-paths "$WORKSPACE_DIR,$TOOLS_DIR,$CONFIG_DIR" \
  --readonly-mode true \
  --exclude-patterns "*.log,*.tmp,.env,node_modules"

Step 4: Test File System Access

Verify that the file system integration is working correctly:

# Test workspace access
mcp test filesystem --workspace-check

# Verify permissions
mcp auth verify filesystem

# If successful, you should see:
# ✅ File system access configured
# ✅ Workspace directory accessible
# ✅ Security restrictions applied

Step 5: Configure Security Exclusions

Set up patterns to exclude sensitive files and directories:

# Add security exclusions
mcp config filesystem exclude-add \
  --patterns ".env,.env.*,*.key,*.pem,*.p12" \
  --reason "Exclude sensitive credential files"

# Exclude build and temporary directories
mcp config filesystem exclude-add \
  --patterns "node_modules,target,build,dist,.git" \
  --reason "Exclude build artifacts and version control"

# Exclude log and cache files
mcp config filesystem exclude-add \
  --patterns "*.log,*.cache,.DS_Store,Thumbs.db" \
  --reason "Exclude system and log files"

Usage Examples

Access your development files through Copilot and MCP integration

Method 1: Ask GitHub Copilot (Recommended)

In your IDE with GitHub Copilot, you can ask natural language questions:

Example questions you can ask Copilot:

  • "Show me the project structure for my current workspace"
  • "Find all configuration files in this project"
  • "Search for TODO comments in my source files"
  • "What are the main entry points in this codebase?"
  • "Find all files that import the authentication module"
  • "Show me the package.json or requirements files in my projects"

Copilot will automatically search your allowed directories and provide file information!

Method 2: Direct MCP Commands

You can also query your file system directly from your terminal:

Navigate project structure:

mcp query filesystem "show project structure for current workspace"

Find configuration files:

mcp query filesystem "find all configuration files in project"

Search for code patterns:

mcp query filesystem "search for 'TODO' comments in source files"

Find specific file types:

mcp query filesystem "list all Python files in the src directory"