Make Claude Code Better and Faster with Morph

Enhance your Claude Code experience with faster, more efficient code editing capabilities using Morph. Optionally, save up to 85% on costs by integrating with Kimi Moonshot’s Kimi K2 API.

Overview

Morph provides enhanced code editing capabilities for Claude, offering faster processing and more efficient workflows. Whether you’re looking for better performance or cost savings, this guide will help you optimize your Claude Code setup.

What You’ll Need

  • Claude Desktop with MCP support
  • A Morph API key (free tier available)
  • Optional: Kimi Moonshot account for cost savings

Step 1: Install Morph MCP for Fast Edits

Add the Morph MCP (Model Context Protocol) to Claude for enhanced file editing capabilities:
claude mcp add filesystem-with-morph -e MORPH_API_KEY=your-api-key-here -e ALL_TOOLS=false -- npx @morph-llm/morph-fast-apply

Get Your Morph API Key

  1. Visit morphllm.com
  2. Sign up for a free account
  3. Generate an API key from your dashboard
  4. Replace your-api-key-here in the command above
Morph offers a free tier that’s perfect for getting started with enhanced code editing capabilities.

Step 2: Configure Claude to Use Morph

Update Claude’s instructions to prioritize the Morph editing tool:
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
This ensures that Claude will use Morph’s optimized editing capabilities instead of the default tools.

Benefits of Using Morph

Performance

  • 4,500+ tokens/second processing speed
  • Fast, efficient code edits and generations
  • Optimized for developer workflows

Quality

  • Enhanced code editing capabilities
  • Better file handling and manipulation
  • Seamless integration with Claude Desktop

Developer Experience

  • Faster iteration cycles
  • More reliable code edits
  • Improved workflow efficiency

Optional: Add Kimi K2 for 85% Cost Savings

If you want to significantly reduce your Claude Code costs, you can optionally integrate with Kimi Moonshot’s Kimi K2 API.
This section is optional. Your Morph setup will work perfectly without Kimi K2.

Configure Environment Variables for Kimi K2

Set up your environment to use Kimi K2’s API instead of Anthropic’s direct API:
export ANTHROPIC_API_KEY=YOUR_KIMI_KEY
export ANTHROPIC_BASE_URL=https://api.moonshot.ai/anthropic
Replace YOUR_KIMI_KEY with your actual Kimi API key from the next step.

Get Your Kimi K2 API Key

  1. Visit Kimi Moonshot Login
  2. Create an account or sign in
  3. Navigate to the API section
  4. Generate a new API key
  5. Copy the key for use in the environment variables above

Additional Benefits with Kimi K2

  • 85% reduction in API costs compared to direct Anthropic API usage
  • Kimi K2 offers competitive pricing for high-quality language model capabilities
  • Maintains compatibility with existing Claude workflows

Troubleshooting

MCP Installation Issues

If the MCP installation fails, try:
  1. Ensuring you have the latest version of Claude Desktop
  2. Checking that Node.js and npm are properly installed
  3. Verifying your Morph API key is valid

Claude Not Using Morph Tool

If Claude isn’t using the Morph editing tool:
  1. Verify the .claude/CLAUDE.md file was created correctly
  2. Restart Claude Desktop
  3. Explicitly request the use of the Morph tool in your prompts

Kimi K2 Environment Variables Not Working (Optional)

If you’re using the optional Kimi K2 integration and environment variables aren’t working:
# Add to ~/.bashrc, ~/.zshrc, or equivalent
export ANTHROPIC_API_KEY=YOUR_KIMI_KEY
export ANTHROPIC_BASE_URL=https://api.moonshot.ai/anthropic

Next Steps

Once configured, you can start using Claude with enhanced Morph editing capabilities. Your development workflow will be faster and more efficient immediately. If you’ve also set up the optional Kimi K2 integration, you’ll enjoy both enhanced performance and significant cost savings.

Ready to enhance your Claude Code experience?

Follow these steps to make Claude Code better and faster. Add Kimi K2 integration for additional cost savings.