Morph MCP Server

Connect your favorite AI tools to Morph’s blazing-fast file editing via Model Context Protocol.

What You Get

  • Lightning Fast: 4500+ tokens/sec code editing
  • High Accuracy: 98% success rate on code transformations
  • Flexible Tools: Choose between edit-only or full filesystem access
  • Universal: Works with Claude Desktop, Cursor, VS Code, and any MCP-compatible client

Available Tools

Edit-Only Mode

ALL_TOOLS: “false”Fast file editing only:
  • edit_file - Lightning-fast code edits

Full Access Mode

ALL_TOOLS: “true”Full filesystem access:
  • edit_file - Fast code edits
  • read_file, write_file
  • list_directory, create_directory
  • search_files, move_file
  • get_file_info + more

Quick Start

Add to your Claude Desktop config file:macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "filesystem-with-morph": {
      "command": "npx",
      "args": [
        "@morph-llm/morph-fast-apply",
        "/Users/your-username/"
      ],
      "env": {
        "MORPH_API_KEY": "your-api-key-here",
        "ALL_TOOLS": "true"
      }
    }
  }
}
Restart Claude Desktop completely to load the new configuration.

Installation Steps

1. Configure MCP Server

Choose your configuration based on your needs: Edit-Only Mode (ALL_TOOLS: “false”):
{
  "mcpServers": {
    "filesystem-with-morph": {
      "command": "npx",
      "args": [
        "@morph-llm/morph-fast-apply",
        "/Users/your-username/"
      ],
      "env": {
        "MORPH_API_KEY": "your-api-key-here",
        "ALL_TOOLS": "false"
      }
    }
  }
}
Full Access Mode (ALL_TOOLS: “true”):
{
  "mcpServers": {
    "filesystem-with-morph": {
      "command": "npx",
      "args": [
        "@morph-llm/morph-fast-apply",
        "/Users/your-username/"
      ],
      "env": {
        "MORPH_API_KEY": "your-api-key-here",
        "ALL_TOOLS": "true"
      }
    }
  }
}

2. Get API Key

Get your API key from the dashboard and replace your-api-key-here in the config.

3. Restart Your Client

Restart Claude Desktop, Cursor, or VS Code to load the new MCP server configuration.

Test Your Setup

Once configured, test that everything works:
  1. List Tools: Ask your AI assistant: “What MCP tools are available?”
  2. Test Edit: Try: “Edit this file to add a comment at the top”
  3. Check Access: If using ALL_TOOLS: "true", try: “List the files in this directory”

Usage Examples

Basic Code Editing

"Edit the file main.py to add error handling to the divide function"

File Operations (ALL_TOOLS: “true”)

"Create a new file called utils.py with a helper function"

Project Refactoring

"Refactor the UserService class to use dependency injection"

Environment Variables

  • MORPH_API_KEY: Your Morph API key (required)
  • ALL_TOOLS: Set to “true” for full filesystem access, “false” for edit-only mode

CLI Testing

Test the MCP server directly:
# Install the package
npm install -g @morph-llm/morph-fast-apply

# Test edit-only mode
export MORPH_API_KEY="your-api-key-here"
export ALL_TOOLS="false"
npx @morph-llm/morph-fast-apply /path/to/your/project/

# Test full access mode
export ALL_TOOLS="true"
npx @morph-llm/morph-fast-apply /path/to/your/project/

Troubleshooting

Best Practices

Security

  • Use ALL_TOOLS: "false" for untrusted environments
  • Limit the directory scope in your config
  • Regularly rotate your API keys
  • Monitor usage in your dashboard

Performance

  • Use specific file paths for faster operations
  • Break large refactoring into smaller steps
  • Monitor API usage and rate limits
  • Cache frequently used patterns

Advanced Configuration

Custom Directory Scope

Limit the MCP server to specific directories:
{
  "mcpServers": {
    "filesystem-with-morph": {
      "command": "npx",
      "args": [
        "@morph-llm/morph-fast-apply",
        "/Users/your-username/projects/specific-project/"
      ],
      "env": {
        "MORPH_API_KEY": "your-api-key-here",
        "ALL_TOOLS": "false"
      }
    }
  }
}

Multiple Configurations

Run different MCP servers for different projects:
{
  "mcpServers": {
    "morph-project-a": {
      "command": "npx",
      "args": ["@morph-llm/morph-fast-apply", "/path/to/project-a/"],
      "env": {
        "MORPH_API_KEY": "your-api-key-here",
        "ALL_TOOLS": "false"
      }
    },
    "morph-project-b": {
      "command": "npx",
      "args": ["@morph-llm/morph-fast-apply", "/path/to/project-b/"],
      "env": {
        "MORPH_API_KEY": "your-api-key-here",
        "ALL_TOOLS": "true"
      }
    }
  }
}

Verify Your Setup

To confirm everything is working:
  1. Check Package: Run npx @morph-llm/morph-fast-apply --help to verify installation
  2. Test Tools: Ask your AI: “What MCP tools are available?” - should show tools based on your ALL_TOOLS setting
  3. Try Edit: Test file editing with a simple change
  4. Check Access: If using ALL_TOOLS: "true", try listing directory contents
If all tests pass, you’re ready to use fast AI code editing! 🎉

Support

Need help? Contact us at morphllm.com or check our documentation for more details.