A Model Context Protocol (MCP) server that enables Claude to assist in software development by providing direct file system access within a specified workspace.
Features
- ? Read file contents
- ✍️ Write and modify files
- ? Create directories
- ? List files and directories
- ℹ️ Get file information
- ?️ Implement code artifacts directly from Claude
Installation
- Make sure you have Python 3.10 or higher installed
-
Create a new project directory:
mkdir mcp-claude-dev
cd mcp-claude-dev
-
Set up a virtual environment using UV:
uv venv
-
Install the package in editable mode:
uv pip install -e .
Project Structure
mcp-claude-dev/
├── claude_dev_server/
│ ├── __init__.py
│ ├── __main__.py
│ ├── server.py
│ └── file_manager.py
└── pyproject.toml
Configuration
To use the server with Claude Desktop, add it to your Claude Desktop configuration file:
- Windows:
%APPDATA%Claudeclaude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"claude-dev": {
"command": "uv",
"args": [
"--directory",
"PATH_TO_YOUR_PROJECT",
"run",
"-m",
"claude_dev_server",
"PATH_TO_YOUR_WORKSPACE"
]
}
}
}
Replace:
- PATH_TO_YOUR_PROJECT
with the absolute path to your mcp-claude-dev directory
- PATH_TO_YOUR_WORKSPACE
with the absolute path to the directory where Claude should have file access
Usage
- Start Claude Desktop
- The server will appear in the tools menu (hammer icon)
- You can now ask Claude to:
- Read files: "Can you read the contents of file.txt?"
- Write files: "Create a new file called example.py with a basic Flask app"
- List directories: "What files are in the current directory?"
- Create directories: "Create a new directory called 'src'"
- Get file info: "What's the size and modification date of main.py?"
- Implement code: "Write a Python function to calculate Fibonacci numbers and save it in math_utils.py"
Security Notes
- The server only allows access to files within the specified workspace directory
- All file operations require explicit paths relative to the workspace
- Directory traversal attempts outside the workspace are blocked
- File watching is implemented for change detection
Development
To contribute to the project:
- Clone the repository
- Install development dependencies
- Make your changes
- Test thoroughly before submitting a pull request
Running Tests
python -m pytest tests/
The server exposes these MCP tools:
read_file(path: str) -> str
: Read file contents
write_file(path: str, content: str) -> str
: Write content to file
list_files(path: str = "") -> str
: List directory contents
create_directory(path: str) -> str
: Create new directory
get_file_info(path: str) -> str
: Get file metadata
implement_artifact(path: str, content: str) -> str
: Save code artifacts
Error Handling
The server includes robust error handling for:
- Invalid paths
- Access attempts outside workspace
- File operation failures
- Permission issues
License
MIT License - feel free to use and modify as needed.
Contributing
Contributions are welcome! Please read our contributing guidelines and submit pull requests for any improvements.