MCP File Server
@Priyonuj
About MCP File Server
A secure Model Context Protocol (MCP) server for file system operations. Enables AI assistants like Claude and Cursor to access, read, write, and manage files on your system with robust path validation and dynamic storage location management.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"file-server": {
"command": "node",
"args": [
"/path/to/mcp-file-server/mcp_server.js"
],
"disabled": false,
"autoApprove": [
"list_files",
"read_file",
"write_file",
"delete_file",
"set_base_directory",
"get_base_directory",
"git_command"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is MCP File Server?
MCP File Server is a Node.js application that implements a Model Context Protocol server for secure, standardized file system operations. It is designed for integration with AI assistants like Claude and developer tools like Cursor.
How to use MCP File Server?
Install with npm install, then start with npm start. Configure via BASE_DIRECTORY environment variable or set the base directory directly from chat using the set_base_directory tool. Git commands can be executed through the git_command tool. Add the server as an MCP server in Claude Desktop or Cursor using a JSON configuration object.
Key features of MCP File Server
- Secure file operations with robust path validation against directory traversal
- Read, write, list, and delete files via MCP tools
- Execute Git commands directly from chat interface
- Set and get base directory without restarting the server
- Operations logged to a dedicated file for auditability
- Modular architecture for easy extension with new services
Use cases of MCP File Server
- AI assistants managing files on a user’s local machine
- Developer tools like Cursor accessing project files securely
- Automated file operations in chat-based workflows
- Running Git commands (status, log, branch) from an AI chat interface
- Centralized file management across different directories without restart
FAQ from MCP File Server
What are the prerequisites for MCP File Server?
Node.js version 16 or higher, npm or yarn, and Git (for Git functionality).
How do I set the base directory from chat?
Use the set_base_directory tool by asking the AI assistant, for example “Set the base directory to C:/Users/username/Documents”. Provide an absolute path.
What security features does MCP File Server include?
It performs robust path validation to prevent directory traversal attacks, normalizes and resolves file paths carefully, validates commands to prevent injection, and logs all operations to a debug file.
Can MCP File Server be extended with new functionality?
Yes. The modular architecture allows adding new services in the services/ directory, registering new tools in toolService.js, and updating mcp_server.js.
How do I integrate MCP File Server with Claude Desktop or Cursor?
Add a JSON configuration object like the one in the README under “Configuration Object Example”, specifying the command, script path, and auto-approved tools.
Frequently asked questions
What are the prerequisites for MCP File Server?
Node.js version 16 or higher, npm or yarn, and Git (for Git functionality).
How do I set the base directory from chat?
Use the `set_base_directory` tool by asking the AI assistant, for example “Set the base directory to C:/Users/username/Documents”. Provide an absolute path.
What security features does MCP File Server include?
It performs robust path validation to prevent directory traversal attacks, normalizes and resolves file paths carefully, validates commands to prevent injection, and logs all operations to a debug file.
Can MCP File Server be extended with new functionality?
Yes. The modular architecture allows adding new services in the `services/` directory, registering new tools in `toolService.js`, and updating `mcp_server.js`.
How do I integrate MCP File Server with Claude Desktop or Cursor?
Add a JSON configuration object like the one in the README under “Configuration Object Example”, specifying the command, script path, and auto-approved tools.
Basic information
More Files & Storage MCP servers
PDF Reader MCP Server (@sylphlab/pdf-reader-mcp)
sylphlab📄 The PDF intelligence layer for AI agents — Agent Document Twin, evidence-first extraction, visual crops, OCR provenance, trust reports, and benchmark-gated releases. MCP server for Claude, Cursor, VS Code, and any MCP client.
MCP Filesystem Server
mark3labsGo server implementing Model Context Protocol (MCP) for filesystem operations.
WORK IN PROGRESS - USE WITH CAUTION - Windows:
hanwegMCP server for working with PDF files
Google Drive server
isaacphiModel Context Protocol (MCP) Server for reading from Google Drive and editing Google Sheets
S3 MCP Server
samuraikunMCP server to integrate AWS S3 and LLM
Comments