A Model Context Protocol (MCP) server that provides file system operations (list, read, write) within a local project directory. Built with FastMCP.
- Python 3.10+
fastmcppackage
- Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies: You can install the core package directly:
pip install fastmcpOr install all project dependencies from the requirements file:
pip install -r requirements.txtThe server operates within the directory containing server.py. To change the base path, modify PROJECT_BASE_PATH in server.py:
PROJECT_BASE_PATH = os.path.dirname(os.path.abspath(__file__))Add this server to your Claude Desktop configuration file (claude_desktop_config.json):
{
"mcpServers": {
"mcp-file-server": {
"command": "/path/to/your/venv/bin/python",
"args": ["/path/to/server.py"]
}
}
}Replace /path/to/your/venv/bin/python with the absolute path to your Python interpreter, and /path/to/server.py with the absolute path to server.py.
Configuration file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
After editing the config file, restart Claude Desktop completely for changes to take effect.
If you're using the Claude Code extension in VS Code, you need to configure the MCP server through the Claude Code CLI first:
Prerequisites:
- Install the Claude Code extension in VS Code
- Install Claude Code CLI (follow the installation guide at code.claude.com)
Configuration Steps:
- Open your terminal and configure the MCP server using the Claude Code CLI:
claude mcp add mcp-file-serverWhen prompted, provide:
- Command:
/path/to/your/venv/bin/python - Arguments:
/path/to/server.py
Alternatively, you can manually edit the Claude Code settings file:
-
Open the Claude Code settings file:
- macOS/Linux:
~/.claude/settings.json - Windows:
%USERPROFILE%\.claude\settings.json
- macOS/Linux:
-
Add your MCP server configuration under the
mcpServerssection:
{
"mcpServers": {
"mcp-file-server": {
"command": "/path/to/your/venv/bin/python",
"args": ["/path/to/server.py"]
}
}
}-
Restart VS Code completely (
Cmd/Ctrl+Shift+P→ "Developer: Reload Window") -
Open the Claude Code extension panel in VS Code and verify the MCP server is connected:
- Type
/mcpin the Claude Code chat to see the server status - The server should show as "connected" with available tools
- Type
Note: The Claude Code extension shares settings with the CLI through ~/.claude/settings.json, so MCP servers configured via CLI will automatically be available in the VS Code extension.
Finding your Python path:
which python # On macOS/Linux
where python # On Windows| Tool | Description |
|---|---|
list_project_files |
List files in the project directory (optional sub_folder parameter) |
read_file_content |
Read contents of a file (filename parameter) |
create_new_file |
Create a new file (filename and content parameters) |
All operations are scoped to the project directory. File operations include standard path validation and error handling.