Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.morphllm.com/llms.txt

Use this file to discover all available pages before exploring further.

Coding agents waste tokens on full-file rewrites and unfocused searches. Morph MCP gives your agent codebase_search (WarpGrep exploration subagent) and edit_file (10,500 tok/s partial edits) with zero code changes.
ToolDefaultDescription
codebase_searchEnabledWarpGrep exploration subagent for your local workspace. Takes a natural-language query (“How does auth work?”) and runs parallel grep + file reads over multiple turns to find relevant files and line ranges. Use first when exploring unfamiliar code.
github_codebase_searchEnabledWarpGrep exploration for public GitHub repositories — no clone required. Takes owner/repo plus a natural-language query. Use when debugging third-party dependencies or investigating upstream bugs.
edit_fileDisabledMorph Fast Apply: 10,500+ tok/s partial edits using // ... existing code ... placeholders. Off by default so it doesn’t collide with client-native editors — enable by setting DISABLED_TOOLS="" in the MCP env.
One command to install:
npx -y @morphllm/morph-setup --morph-api-key YOUR_API_KEY
Logged in? Your API key auto-fills above. Otherwise, get it from your dashboard.
ToolDefaultDescription
codebase_searchEnabledWarpGrep exploration subagent for your local workspace. Takes a natural-language query (“How does auth work?”) and runs parallel grep + file reads over multiple turns to find relevant files and line ranges. Use first when exploring unfamiliar code.
github_codebase_searchEnabledWarpGrep exploration for public GitHub repositories — no clone required. Takes owner/repo plus a natural-language query. Use when debugging third-party dependencies or investigating upstream bugs.
edit_fileDisabledMorph Fast Apply: 10,500+ tok/s partial edits using // ... existing code ... placeholders. Off by default so it doesn’t collide with client-native editors — enable by setting DISABLED_TOOLS="" in the MCP env.

Installation (All Clients)

1

1. Get Your API Key

Get your API key from the dashboard.
2

2. Configure Your MCP Client

One-liner Installation (Recommended):
claude mcp add filesystem-with-morph --scope user -e MORPH_API_KEY=YOUR_API_KEY -- npx -y @morphllm/morphmcp
Configure Claude to prefer Morph: Add this to your global Claude config:
mkdir -p ~/.claude && echo "Fast Apply: IMPORTANT: Use \`edit_file\` over \`str_replace\` or full file writes. It works with partial code snippets—no need for full file content.
Warp Grep: warp-grep is a subagent that takes in a search string and tries to find relevant context. Best practice is to use it at the beginning of codebase explorations to fast track finding relevant files/lines. Do not use it to pin point keywords, but use it for broader semantic queries. \"Find the XYZ flow\", \"How does XYZ work\", \"Where is XYZ handled?\", \"Where is <error message> coming from?\"" >> ~/.claude/CLAUDE.md
Manual Config File Method:Create or edit .claude.json in your workspace:
{
  "mcpServers": {
    "filesystem-with-morph": {
      "env": {
        "MORPH_API_KEY": "YOUR_API_KEY"
      },
      "command": "npx -y @morphllm/morphmcp",
      "args": []
    }
  }
}
3

3. Test Installation

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

Configuration

VariableDefaultDescription
MORPH_API_KEYRequiredYour API key
WORKSPACE_MODE"true"Auto workspace detection
DEBUG"false"Debug logging

Advanced Configuration

VariableDefaultDescription
MORPH_API_URLhttps://api.morphllm.comOverride the Morph API base URL (for proxies)
MORPH_WARP_GREP_TIMEOUT30000Timeout for Warp Grep model calls in milliseconds
Custom API endpoint — For enterprise deployments or custom authentication flows:
{
  "mcpServers": {
    "morph-mcp": {
      "env": {
        "MORPH_API_KEY": "<user-jwt-token>",
        "MORPH_API_URL": "https://your-proxy.example.com"
      },
      "command": "npx -y @morphllm/morphmcp",
      "args": []
    }
  }
}
Your proxy receives requests to /v1/chat/completions with the token in the Authorization: Bearer header. Forward these to https://api.morphllm.com/v1/chat/completions after handling auth/billing. Warp Grep timeout — Increase for large codebases or slow networks:
{
  "mcpServers": {
    "morph-mcp": {
      "env": {
        "MORPH_API_KEY": "sk-xxx",
        "MORPH_WARP_GREP_TIMEOUT": "60000"
      },
      "command": "npx -y @morphllm/morphmcp",
      "args": []
    }
  }
}

Available Tools

codebase_search and github_codebase_search are enabled out of the box. edit_file ships disabled to avoid conflicting with client-native editors — opt in by setting DISABLED_TOOLS="" (or any value that doesn’t include edit_file) in the MCP server env.
{
  "mcpServers": {
    "morph-mcp": {
      "env": {
        "MORPH_API_KEY": "YOUR_API_KEY",
        "DISABLED_TOOLS": ""
      },
      "command": "npx -y @morphllm/morphmcp",
      "args": []
    }
  }
}

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

Performance Comparison

MethodSpeedUse Case
edit_file (Morph)~11 secondsCode modifications, updates
Search & replace~20 secondsSimple text substitutions
Traditional read/write~60 secondsFull file rewrites