Morph MCP Server
Connect your favorite AI tools to Morph’s blazing-fast file editing via Model Context Protocol.What You Get
- Lightning Fast: 10,500+ 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 editsread_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: Restart Claude Desktop completely to load the new configuration.
~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Installation Steps
1. Configure MCP Server
Choose your configuration based on your needs: Global Config (Workspace-Aware) - RECOMMENDED for cross-project use:2. Get API Key
Get your API key from the dashboard and replaceyour-api-key-here
in the config.
3. Restart Your Client
Restart Claude Desktop, Cursor, or VS Code to load the new MCP server configuration.Workspace-Aware Global Config
The workspace mode is now enabled by default and solves the global vs project config inheritance issue by automatically detecting the current workspace root.How It Works
By default, the MCP server automatically:-
Automatic Detection: Detects workspace root by looking for common indicators:
.git
directoriespackage.json
,Cargo.toml
,pyproject.toml
.vscode
,.cursor
directories- And other common project files
- Dynamic Permissions: Allowed directories update based on the current workspace context
- Fallback Safety: If no workspace is detected, it falls back to the current directory
Troubleshooting Global Config Issues
If your global MCP config isn’t working: Problem: “MCP server only works when configured per project” Solution: Use the simplified global config (workspace mode is now default):- ❌ Fixed paths:
/Users/username/project
only works for that specific project - ✅ Workspace mode: Automatically adapts to any project you open (now default)
- ✅ Simplified config: No need for
ENABLE_WORKSPACE_MODE=true
anymore - ✅ Proper inheritance: Global config works across all projects by default
Test Your Setup
Once configured, test that everything works:- List Tools: Ask your AI assistant: “What MCP tools are available?”
- Test Edit: Try: “Edit this file to add a comment at the top”
- Check Access: If using
ALL_TOOLS: "true"
, try: “List the files in this directory”
Usage Examples
Basic Code Editing
File Operations (ALL_TOOLS: “true”)
Project Refactoring
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:Troubleshooting
Tools not showing up in client
Tools not showing up in client
- Check that your client supports MCP servers
- Verify your config file syntax is correct (JSON must be valid)
- Restart your client completely (quit and reopen)
- Check client logs for MCP-related errors
- Verify the package can be installed:
npm install -g @morph-llm/morph-fast-apply
- Try asking your AI: “What MCP tools are available?”
API key errors
API key errors
- Verify your API key is correct in the environment variables
- Ensure the key starts with ‘sk-’
- Check that the key has the right permissions
- Get your API key from morphllm.com
- Test the key with a direct API call
File access issues
File access issues
- Check that the path in the config is correct
- Verify you have read/write permissions to the directory
- Try with
ALL_TOOLS: "false"
first to test basic editing - Check if the directory exists and is accessible
Package installation issues
Package installation issues
- Ensure Node.js and npm are installed
- Try installing globally:
npm install -g @morph-llm/morph-fast-apply
- Check npm permissions
- Try running with
npx
instead of global install
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:Multiple Configurations
Run different MCP servers for different projects:Verify Your Setup
To confirm everything is working:- Check Package: Run
npx @morph-llm/morph-fast-apply --help
to verify installation - Test Tools: Ask your AI: “What MCP tools are available?” - should show tools based on your
ALL_TOOLS
setting - Try Edit: Test file editing with a simple change
- Check Access: If using
ALL_TOOLS: "true"
, try listing directory contents
Support
- Documentation: Morph Apply API Docs
- MCP Protocol: Model Context Protocol
- Get API Key: morphllm.com
Need help? Contact us at morphllm.com or check our documentation for more details.