mcp-server

Filesystem MCP Server

Read, write, and manage files through the Model Context Protocol. The most commonly used MCP server for AI coding assistants.

Install
npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/dir

Overview

The filesystem MCP server provides AI agents with controlled access to the local filesystem. It supports reading files, writing files, creating directories, searching by pattern, and listing directory contents. Security-conscious deployments should configure allowlists to restrict which directories the agent can access. This server is included in the official MCP reference implementations and is used by Claude Code, Cursor, and other AI coding tools.

Features

  • -Read and write files with encoding support
  • -Directory listing with recursive traversal
  • -File search by glob pattern
  • -Configurable directory allowlist for security
  • -File metadata (size, permissions, modification time)

Security Considerations

Always configure directory allowlists. Never grant access to home directory root or system directories. The filesystem server has been a frequent target for prompt injection attacks that trick agents into reading sensitive files like ~/.ssh/id_rsa or ~/.aws/credentials.

Scan for vulnerabilities: npx hackmyagent secure

Source

Related Tools