npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

morph-mcp

v1.0.1

Published

Unified MCP server with AI-powered file editing (Morph Fast Apply) and intelligent code search (Fast Context Search)

Readme

Morph MCP

Unified Model Context Protocol (MCP) server providing AI-powered file editing and intelligent code search capabilities.

Features

AI-Powered Tools

  • Fast Apply (edit_file) - Morph's lightning-fast code editing at 4500+ tokens/sec with 99.2% accuracy
  • Fast Context Search (fast_context_search) - AI-powered code search that intelligently explores repositories to find relevant code

Filesystem Operations

  • Read/write files with memory-efficient head/tail operations
  • Create/list/delete directories with detailed metadata
  • Move files/directories
  • Search files with exclude patterns
  • Get comprehensive file metadata

Security & Access Control

  • Dynamic directory access control via MCP Roots
  • Workspace-aware path resolution
  • Automatic workspace detection
  • Atomic file operations with temp files for safety

Configuration

Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | MORPH_API_KEY | Your Morph API key (required for AI tools) | - | | ENABLED_TOOLS | Comma-separated list of enabled tools, or all | all | | MORPH_DEBUG | Enable debug logging for grep agent (true/false) | false | | ENABLE_WORKSPACE_MODE | Auto-detect workspace root (true/false) | true | | WORKSPACE_ROOT | Override workspace root directory | $PWD |

Tool Configuration

Control which tools are available using ENABLED_TOOLS:

# Enable all tools (default)
ENABLED_TOOLS=all

# Only AI-powered tools
ENABLED_TOOLS=edit_file,fast_context_search

# Only fast apply
ENABLED_TOOLS=edit_file

# Only context search
ENABLED_TOOLS=fast_context_search

# Custom selection
ENABLED_TOOLS=read_file,write_file,edit_file,fast_context_search

Available Tools

AI-Powered Tools

edit_file

PRIMARY TOOL FOR EDITING FILES - Efficiently edit existing files by smartly showing only changed lines. Uses Morph's fast apply model for intelligent code merging.

Key features:

  • 4500+ tokens/sec with 99.2% accuracy
  • Smart context preservation with // ... existing code ...
  • Batch multiple edits to the same file
  • Git-style diff output

Requires: MORPH_API_KEY

fast_context_search

Intelligently search and gather relevant code context from a repository using an AI-powered search agent. Automatically explores the codebase with grep, file reading, and directory analysis.

Example queries:

  • "Where is JWT token validation implemented?"
  • "How does the authentication middleware work?"
  • "Find the database connection setup"

Requires: MORPH_API_KEY

File Operations

  • read_file - Read complete file contents with optional head/tail
  • read_multiple_files - Read multiple files simultaneously
  • write_file - Create or overwrite files
  • tiny_edit_file - Make small line-based edits with diff output

Directory Operations

  • create_directory - Create directories recursively
  • list_directory - List directory contents
  • list_directory_with_sizes - List with file sizes and sorting
  • directory_tree - Get recursive JSON tree structure
  • move_file - Move/rename files and directories

Search & Info

  • search_files - Recursively search with exclude patterns
  • get_file_info - Get detailed file metadata
  • list_allowed_directories - Show accessible directories

Installation

Quick Start (NPX - Recommended)

For Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "morph-mcp": {
      "command": "npx",
      "args": ["-y", "morph-mcp"],
      "env": {
        "MORPH_API_KEY": "sk-your-morph-api-key-here",
        "ENABLED_TOOLS": "all"
      }
    }
  }
}

For Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "morph-mcp": {
      "command": "npx",
      "args": ["-y", "morph-mcp"],
      "env": {
        "MORPH_API_KEY": "sk-your-morph-api-key-here",
        "ENABLED_TOOLS": "all"
      }
    }
  }
}

One-liner installation:

claude mcp add morph-mcp -e MORPH_API_KEY=sk-your-morph-api-key-here -e ENABLED_TOOLS=all -- npx morph-mcp

Docker

{
  "mcpServers": {
    "morph-mcp": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
        "morph-llm/morph-mcp", "/projects"
      ],
      "env": {
        "MORPH_API_KEY": "sk-your-morph-api-key-here",
        "ENABLED_TOOLS": "all"
      }
    }
  }
}

VS Code

For quick installation, click the installation buttons below:

Install with NPX in VS Code

Or manually add to .vscode/mcp.json:

{
  "mcp": {
    "servers": {
      "morph-mcp": {
        "command": "npx",
        "args": ["-y", "morph-mcp", "${workspaceFolder}"],
        "env": {
          "MORPH_API_KEY": "sk-your-morph-api-key-here",
          "ENABLED_TOOLS": "all"
        }
      }
    }
  }
}

Getting Started

1. Get Your Morph API Key

  1. Sign up at Morph
  2. Get your API key from the dashboard
  3. API keys typically start with sk- or morph-

2. Choose Your Configuration

For fast editing only:

{
  "env": {
    "MORPH_API_KEY": "sk-...",
    "ENABLED_TOOLS": "edit_file"
  }
}

For code search only:

{
  "env": {
    "MORPH_API_KEY": "sk-...",
    "ENABLED_TOOLS": "fast_context_search"
  }
}

For everything (recommended):

{
  "env": {
    "MORPH_API_KEY": "sk-...",
    "ENABLED_TOOLS": "all"
  }
}

3. Test Your Setup

In your AI assistant, try:

  • Edit test: "Use the edit_file tool to add a comment to the main function"
  • Search test: "Use fast_context_search to find where database connections are initialized"

Usage Examples

Fast Apply Editing

Ask AI: "Use the edit_file tool to add error handling to this function"

The AI will:
1. Read the current code
2. Generate smart edit instructions with "// ... existing code ..."
3. Apply changes at 4500+ tokens/sec
4. Show you a git-style diff

Fast Context Search

Ask AI: "Use fast_context_search to find where JWT tokens are validated"

The agent will:
1. Explore the repository using grep, read, and analyse tools
2. Find relevant code across multiple files
3. Return precise line ranges with full context
4. Display formatted XML output with line numbers

Migration Guide

From @morph-llm/morph-fast-apply

Old config:

{
  "env": {
    "MORPH_API_KEY": "sk-...",
    "ALL_TOOLS": "false"
  }
}

New config:

{
  "env": {
    "MORPH_API_KEY": "sk-...",
    "ENABLED_TOOLS": "edit_file"
  }
}

From morph-codeseek

Old config:

{
  "env": {
    "GREP_AGENT_API_KEY": "sk-..."
  }
}

New config:

{
  "env": {
    "MORPH_API_KEY": "sk-...",
    "ENABLED_TOOLS": "fast_context_search"
  }
}

Architecture

Modular Design

morph-mcp/
├── index.ts              # Main server & tool registry
├── grep/                 # Fast context search agent
│   ├── agent/           # Multi-round exploration logic
│   ├── tools/           # Grep, read, analyse, finish
│   └── utils/           # Ripgrep, file finder, logger
├── morph-client.ts      # Morph API integration
└── path-*.ts            # Security & validation

Security

  • Path validation for all filesystem operations
  • Atomic file writes with temp files
  • Symlink protection
  • Dynamic directory access via MCP roots
  • API key validation at startup

Troubleshooting

Tools Not Showing Up

  1. Check API key is set: MORPH_API_KEY=sk-...
  2. Verify tools are enabled: ENABLED_TOOLS=all
  3. Restart your AI assistant completely
  4. Check logs: tail -f ~/Library/Logs/Claude/mcp*.log

Fast Context Search Not Finding Code

  1. Ensure you're passing the correct repository path
  2. Try more specific queries
  3. Enable debug logging: MORPH_DEBUG=true
  4. Check debug logs in ${TMPDIR}/morph-codeseek-debug/

Permission Errors

  1. Check allowed directories: Use list_allowed_directories tool
  2. Verify workspace mode is enabled: ENABLE_WORKSPACE_MODE=true
  3. Pass directory explicitly via command-line args

Performance

| Feature | Speed | Accuracy | |---------|-------|----------| | Fast Apply (edit_file) | 4500+ tok/sec | 99.2% | | Context Search | 4 rounds, <30s | High relevance | | File Operations | Native speed | 100% |

Support

License

MIT License - See LICENSE file for details

Credits

Built by Morph - Making AI code editing fast and accurate.