home / mcp / local file management mcp server
Provides local file system operations (list, read, write) within a project directory using MCP.
Configuration
View docs{
"mcpServers": {
"idoy12-mcp_test": {
"command": "/path/to/your/venv/bin/python",
"args": [
"/path/to/server.py"
]
}
}
}You can run a Local File Management MCP Server to perform file system operations—like listing, reading, and creating files—directly within your project directory. It runs locally and can be connected to MCP clients to manage project files efficiently.
Connect a client to the Local File Management MCP Server to perform common file operations from your development environment. You can list files in the project directory, read the contents of a file, or create new files. All actions are scoped to your project directory, with proper path validation and error handling to keep your filesystem safe.
Prerequisites and installation steps ensure you have a Python environment ready to run the MCP server locally.
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
```bash
pip install fastmcp
```
```bash
# Or install all project dependencies from a requirements file if you have it
pip install -r requirements.txtThe server runs from the directory that contains the server script. To change the base directory the server uses for file operations, modify the base path setting in the server script. For example, you can set PROJECT_BASE_PATH to the directory containing the script to ensure all operations happen within your intended project folder.
Example of a local runtime command to start the MCP server from your virtual environment:
# Start the server using the Python interpreter from your virtual environment
/path/to/your/venv/bin/python /path/to/server.pyUse a client configuration that points to the local server script via Python as shown below. This configuration is suitable for both Claude Desktop and Claude Code extensions when you want to run the MCP server locally.
{
"type": "stdio",
"name": "file_mcp",
"command": "/path/to/your/venv/bin/python",
"args": ["/path/to/server.py"]
}List files in the project directory, with an optional sub_folder parameter to scope the listing
Read the contents of a specified file by filename
Create a new file with a given filename and content