Claude Dev Server

Claude Dev Server

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

  1. Make sure you have Python 3.10 or higher installed
  2. Create a new project directory:
mkdir mcp-claude-dev cd mcp-claude-dev
  1. Set up a virtual environment using UV:
uv venv
  1. 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%\Claude\claude_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

  1. Start Claude Desktop
  2. The server will appear in the tools menu (hammer icon)
  3. 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:

  1. Clone the repository
  2. Install development dependencies
  3. Make your changes
  4. Test thoroughly before submitting a pull request

Running Tests

python -m pytest tests/

Available Tools

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.

-
security - not tested
A
license - permissive license
-
quality - not tested

The Claude Dev Server enables direct interaction with the file system within a specified workspace, allowing users to perform file and directory operations and implement code artifacts in software development using natural language commands.

  1. Features
    1. Installation
      1. Project Structure
        1. Configuration
          1. Usage
            1. Security Notes
              1. Development
                1. Running Tests
                2. Available Tools
                  1. Error Handling
                    1. License
                      1. Contributing