Get the FREE Ultimate OpenClaw Setup Guide →

diffchunk

diffchunk - A local MCP server that gives LLMs the ability to work with large diff files. Essential for working with large repos.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio peteretelej-diffchunk uvx --from diffchunk diffchunk-mcp

How to use

diffchunk is an MCP server that enables large git diffs to be navigated efficiently by breaking them into navigable chunks. It exposes four tools: load_diff to parse a diff with customizable settings, list_chunks to provide an overview of the diff structure (files, chunks, total lines), get_chunk to retrieve the content of a specific chunk, and find_chunks_for_files to locate chunks that match given file patterns. When integrated with an MCP client, your AI can request targeted chunks rather than loading entire diffs, enabling scalable analysis of very large changesets. Typical workflows involve generating a diff file, listing its chunks, filtering to relevant files, and then iterating through the necessary chunks for review or analysis.

Usage scenarios include branch comparisons to understand what changed between branches, code reviews to inspect potential issues in a feature or refactor, and change analysis to identify migrations, API changes, or new dependencies. The tools are designed to auto-load relevant data (e.g., list_chunks runs a pre-load; get_chunk pulls only the requested chunk), which helps avoid overloading the model context while preserving file relationships and diffs across multiple files.

How to install

Prerequisites:

  • Python 3.10+ installed on your system
  • uv (the ultra-fast Python package manager) installed and available as uvx from your shell

Install and configure the MCP server:

  1. Install uv (per the project’s guidance):
    • Follow the uv getting started guide and ensure the uvx command is available in your PATH.
  2. Install the diffchunk MCP server via uvx:
    uvx --from diffchunk diffchunk-mcp
    
    This installs the diffchunk MCP server package (from the diffchunk source) so your MCP client can connect using the provided configuration.
  3. Configure your MCP client (example shown in the repository):
    {
      "mcpServers": {
        "diffchunk": {
          "command": "uvx",
          "args": ["--from", "diffchunk", "diffchunk-mcp"]
        }
      }
    }
    
  4. Start or reload your MCP client as needed to pick up the new server configuration.

Notes:

  • The README indicates that uvx is the recommended runner for this server. If you already use uv for other MCP servers, reusing the same approach is expected to work.
  • No additional environment variables are strictly required by the README, but you can add env entries if your environment requires them (e.g., proxy settings or custom diff paths).

Additional notes

Tips and common issues:

  • Ensure Python 3.10+ is installed and accessible as the MCP server relies on the Python environment.
  • The setup relies on uvx (uv package manager); make sure it is installed and available in your PATH.
  • When using the MCP client, the diffchunk server expects a diff file that can be parsed into chunks. Use the provided commands to create and load the diff before querying chunks.
  • The auto-loading behavior means you can avoid loading entire diffs into your model’s context by using list_chunks, get_chunk, and find_chunks_for_files in sequence.
  • If you encounter file pattern matching issues, verify the patterns passed to find_chunks_for_files and ensure the diff contains the referenced files.
  • When cleaning up, remember to remove temporary diff files created during analysis to keep your workspace tidy.

Related MCP Servers

Sponsor this space

Reach thousands of developers