home / mcp / file operations mcp server

File Operations MCP Server

Provides MCP-based file operations for reading, writing, listing, creating, deleting, copying, moving files and gathering metadata.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "kavishankarks-mcp": {
      "command": "/bin/bash",
      "args": [
        "/path/to/your/mcp/scripts/run_server.sh"
      ]
    }
  }
}

You have access to an MCP server that exposes file operation tools to manage files and directories from clients like Claude Desktop. This server lets you read, write, list, create, delete, copy, and move files, as well as fetch file metadata, all through a simple MCP interface.

How to use

To use these file operations from your MCP client, connect to the MCP server dedicated to file operations and invoke the available actions as commands. The server is designed to integrate with Claude Desktop and LangGraph workflows, so you can trigger actions like reading a file, writing content, listing directory contents, creating directories, deleting files or directories, copying files, moving or renaming files, and getting file metadata. Use natural language prompts or structured tool invocations supported by your MCP client to perform these actions against the file system.

Typical usage patterns include reading a file to inspect its contents, writing new content to a file, listing what exists in a directory before performing operations, and safely deleting unwanted files or folders. You can also copy and move items to organize your workspace or fetch metadata to understand file properties like size, creation date, and permissions.

How to install

Prerequisites: Python 3.8+ and a working Python environment. Ensure you have a shell available to run commands.

Step 1 — Quick installation. Run the installation script.

bash scripts/install.sh

Step 2 — Manual installation. Create and activate a Python virtual environment, then install the package in editable mode. Optionally install development dependencies.

python3 -m venv .venv
source .venv/bin/activate
pip install -e .
pip install -e ".[dev]"

Claude Desktop integration configuration

Integrate the MCP file operations server with Claude Desktop by adding a server configuration to its config file. This enables Claude Desktop to reach the file operations via a local command path.

{
  "mcpServers": {
    "file_operations": {
      "command": "/bin/bash",
      "args": ["/path/to/your/mcp/scripts/run_server.sh"]
    }
  }
}

Usage notes for Claude Desktop and LangGraph

After configuring Claude Desktop, you can issue natural language commands like “Read the file at /path/to/file.txt” or “Write ‘Hello World’ to /path/to/output.txt,” which are executed via the MCP file operations server. If you use LangGraph, you can access all file operation tools as LangGraph components and incorporate them into workflows.

LangGraph integration lets you create tools for each MCP operation, enabling you to build automated data pipelines that manipulate files as part of larger graphs. The available operations include read_file, write_file, list_directory, create_directory, delete_file, delete_directory, copy_file, move_file, and get_file_info.

Security considerations

The file operations server has access to the file system with the permissions of the running process. Use it only in trusted environments and consider restricting paths to prevent unauthorized access or unintended changes.

Testing and quality checks

Run the test suite to ensure the server works as expected. Use the Python test suite that accompanies the project to validate file operations across typical scenarios.

Available tools

read_file

Read the contents of a specified file and return the data.

write_file

Write provided content to a specified file, overwriting existing data.

list_directory

List the items in a given directory path.

create_directory

Create a new directory at the specified path.

delete_file

Remove a file at the given path.

delete_directory

Remove a directory and its contents at the given path.

copy_file

Copy a file from a source path to a destination path.

move_file

Move or rename a file or directory.

get_file_info

Retrieve metadata for a specific file or directory.