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 🙏

© 2025 – Pkg Stats / Ryan Hefner

codiff-mcp

v0.2.7

Published

A Model Context Protocol (MCP) server for code diffing with intelligent token optimization

Readme

Codiff MCP Server

A Model Context Protocol (MCP) server for intelligent text diffing with token optimization.

Features

  • Smart Change Detection: Shows only insertions/deletions by default to minimize tokens
  • Identical Text Optimization: Returns "identical" immediately for identical texts
  • Token-Saving Mode: Delegates small/similar diffs to LLM when more efficient
  • Accuracy Mode: Optional full context including unchanged text (with cost warnings)
  • Cost Transparency: Warns when diff tool costs more than original texts

Quick Setup

Standard Mode (Recommended)

Shows only changes, minimizes token usage:

{
  "mcpServers": {
    "codiff-mcp": {
      "command": "npx",
      "args": ["-y", "codiff-mcp@latest"]
    }
  }
}

Token-Saving Mode

Smart delegation to LLM for efficiency:

{
  "mcpServers": {
    "codiff-mcp": {
      "command": "npx",
      "args": ["-y", "codiff-mcp@latest", "--save-tokens"]
    }
  }
}

Accuracy Mode

⚠️ Includes unchanged text (may increase costs):

{
  "mcpServers": {
    "codiff-mcp": {
      "command": "npx",
      "args": ["-y", "codiff-mcp@latest", "--accuracy"]
    }
  }
}

Usage

The codiff tool compares two text inputs:

  • original: Baseline text
  • modified: Updated text

Modes

| Mode | Flags | Behavior | |------|-------|----------| | Standard | (default) | Shows only changes, warns about costs | | Token-Saving | --save-tokens, -s | Delegates small/similar diffs to LLM | | Accuracy | --accuracy, -a | Includes unchanged text ⚠️ | | Combined | -s -a | Smart delegation + full context |

Examples

Identical Texts

{
  "result": "identical",
  "message": "The provided texts are identical - no differences found.",
  "savings": { "estimatedSavings": 5 }
}

Standard Mode (Changes Only)

{
  "diff": [
    {"type": "delete", "text": "Hello world\n"},
    {"type": "insert", "text": "Hello beautiful world\n"}
  ],
  "mode": "standard",
  "savings": { "estimatedSavings": 5 }
}

Cost Warning

{
  "warnings": [
    "INCREASED COST: This diff costs 5 more tokens than sending the original texts."
  ]
}

Token-Saving Delegation

{
  "result": "delegate_to_llm",
  "message": "For optimal token efficiency, please analyze these texts directly...",
  "recommendation": "Compare manually by scanning for differences..."
}

Auto-Usage Rule

Add to .cursorrules for automatic diffing:

{
  "rules": {
    "general_rules": [
      {
        "description": "When the user requests comparisons, diffs, or change analysis, ALWAYS use the codiff MCP tool first. Use for file comparisons, version analysis, and any request involving 'compare', 'diff', 'changes', or 'differences'.",
        "type": "tool_prioritization_codiff"
      }
    ]
  }
}

Development

npm run start              # Standard mode
npm run start:save-tokens  # Token-saving mode  
npm run start:accuracy    # Accuracy mode
npm run start:full        # Combined mode