MCP File Operations Server

MCP File Operations Server

A Model Context Protocol server that enables Claude Desktop to perform file operations like reading, writing, listing directories, and managing files through natural language commands.

Category
Visit Server

README

MCP File Operations Server

A Model Context Protocol (MCP) server that provides file operation tools for Claude Desktop.

Features

  • read_file: Read file contents
  • write_file: Write content to files
  • list_directory: List directory contents
  • create_directory: Create directories
  • delete_file: Delete files
  • delete_directory: Delete directories
  • copy_file: Copy files
  • move_file: Move/rename files
  • get_file_info: Get file metadata

Installation

Quick Installation

Run the installation script:

bash scripts/install.sh

Manual Installation

  1. Create virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate
    
  2. Install the package:

    pip install -e .
    
  3. Install development dependencies (optional):

    pip install -e ".[dev]"
    

Testing

Run the test suite:

python -m pytest tests/

Or run tests directly:

python tests/test_file_operations.py

Claude Desktop Integration

  1. Find your Claude Desktop config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the server configuration:

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

    Note: Update the path in args to match your actual installation directory.

  3. Restart Claude Desktop to load the new server.

Usage

Once integrated, you can use commands like:

  • "Read the file at /path/to/file.txt"
  • "Write 'Hello World' to /path/to/output.txt"
  • "List the contents of /path/to/directory"
  • "Create a directory at /path/to/new/dir"
  • "Delete the file /path/to/unwanted.txt"
  • "Copy file from /source to /destination"

Security Notes

  • The server has full file system access
  • Only use with trusted content
  • Consider restricting paths in production environments

Testing

Run the test suite:

python test_server.py

LangGraph Integration

This package includes a complete LangGraph integration that allows you to use MCP file operations as tools within LangGraph workflows.

Installation with LangGraph

# Install with LangGraph support
pip install -e ".[langgraph]"

Quick Start

import asyncio
from mcp_file_operations.integrations.langgraph_client import create_mcp_file_tools

async def example():
    # Create MCP file operation tools for LangGraph
    file_tools = create_mcp_file_tools()
    
    # Use tools in your LangGraph workflow
    write_tool = next(tool for tool in file_tools if tool.name == "write_file")
    result = await write_tool._arun(path="/tmp/test.txt", content="Hello LangGraph!")
    print(result)

asyncio.run(example())

Examples

  • Simple Integration: examples/simple_langgraph_example.py
  • Full Workflow: examples/langgraph_file_workflow.py
  • Documentation: docs/LANGGRAPH_INTEGRATION.md

Available LangGraph Tools

All MCP file operations are available as LangGraph tools:

  • read_file, write_file, list_directory, create_directory
  • delete_file, delete_directory, copy_file, move_file, get_file_info

License

MIT License

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured