Morph MCP Integration

Overview

Connect AI tools to Morph’s 10,500+ tokens/sec file editing via Model Context Protocol. Works with Claude, Cursor, VS Code, and other MCP clients with automatic workspace detection.

Tool Modes

Edit-Only Mode

ALL_TOOLS: “false”Perfect for fast, focused editing:
  • edit_file - Lightning-fast code edits using Morph Apply

Full Filesystem Mode

ALL_TOOLS: “true”Complete filesystem access:
  • edit_file - Fast code edits via Morph Apply
  • read_file, write_file
  • list_directory, create_directory
  • search_files, move_file
  • get_file_info + more filesystem tools

Installation

1

1. Configure Your MCP Client

One-liner Installation (Recommended):
claude mcp add filesystem-with-morph -e MORPH_API_KEY=your-api-key-here -e ALL_TOOLS=false -- npx @morph-llm/morph-fast-apply
Configure Claude to prefer Morph: Add this to your Claude instructions to ensure Claude uses Morph for all code edits:
echo "IMPORTANT: ALWAYS use mcp_filesystem-with-morph_edit_file tool to make any code edits. Do not use the default edit tool." > .claude/CLAUDE.md
Manual Config File Method:Create or edit .claude.json in your workspace:
{
  "mcpServers": {
    "filesystem-with-morph": {
      "command": "npx",
      "args": [
        "@morph-llm/morph-fast-apply"
      ],
      "env": {
        "MORPH_API_KEY": "your-api-key-here",
        "ALL_TOOLS": "false"
      }
    }
  }
}
2

2. Get API Key

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

3. Test Installation

Claude: Type /mcp and /tools to see Morph’s edit_file tool
Cursor/VS Code: Make any code edit request - should use Morph automatically
Codex: Run codex mcp list to verify server is configured, then make edit requests
Manual: Check server logs show “MCP Server started successfully”

Configuration

VariableDefaultDescription
MORPH_API_KEYRequiredYour API key
ALL_TOOLS"true""false" for edit-only, "true" for full filesystem access
WORKSPACE_MODE"true"Auto workspace detection
DEBUG"false"Debug logging

Available Tools

edit_file - 10,500+ tokens/sec code editing via Morph Apply Additional tools (when ALL_TOOLS: "true"): read_file, write_file, list_directory, create_directory, search_files, move_file, get_file_info

Troubleshooting

Server won’t start: Check API key, Node.js 16+, run npm cache clean --force
Tools missing: Restart client, validate JSON config
Workspace issues: Add .git or package.json, or set WORKSPACE_MODE="false"
Slow performance: Use edit_file over write_file, check network to api.morphllm.com

Performance Optimization

Best Practices

  1. Use edit_file for modifications: Much faster than reading + writing entire files
  2. Minimize edit scope: Include only the sections that need changes
  3. Batch related edits: Make multiple changes in a single edit_file call
  4. Enable edit-only mode: Use ALL_TOOLS: "false" when you only need editing capabilities

Performance Comparison

MethodSpeedUse Case
edit_file (Morph)10,500+ tokens/secCode modifications, updates
Traditional read/write~100-500 tokens/secFull file rewrites
Search & replace~200-1000 tokens/secSimple text substitutions