Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-server-diff-python

MCP.Pizza Chef: tatn

mcp-server-diff-python is an MCP server that uses Python's difflib to produce unified diff outputs between two text strings. It enables precise text comparison by generating differences in a standard format widely used in version control and text analysis workflows. This server is ideal for developers and tools needing efficient, programmatic text diffing capabilities.

Use This MCP server To

Generate unified diffs between two text versions for review Integrate text comparison in code review or version control tools Automate detection of changes in documentation or config files Provide diff outputs for AI-assisted code or text editing workflows Compare user input against templates or previous versions Highlight changes in text for collaborative editing platforms

README

mcp-server-diff-python

An MCP server for obtaining text differences between two strings. This server leverages Python's standard library difflib to efficiently generate and provide differences between two texts in Unified diff format, making it ideal for text comparison and version control purposes.

Server Diff Python MCP server

Features

Tools

The server provides a single tool:

  • get-unified-diff: Get differences between two texts in Unified diff format
    • Arguments:
      • string_a: Source text for comparison (required)
      • string_b: Target text to compare against (required)
    • Return value: A string containing the differences in Unified diff format

Usage

Claude Desktop

Using with Claude Desktop To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json

"mcpServers": {
  "mcp-server-diff-python": {
    "command": "uvx",
    "args": [
      "mcp-server-diff-python"
    ]
  }
}

or Add the following configuration:

git clone https://github.com/tatn/mcp-server-diff-python.git
cd mcp-server-diff-python
uv sync
uv build
"mcpServers": {
  "mcp-server-diff-python": {
    "command": "uv",
    "args": [
      "--directory",
      "path\\to\\mcp-server-diff-python",
      "run",
      "mcp-server-diff-python"
    ]
  }
}

Development

Debugging

You can start the MCP Inspector using npxwith the following commands:

npx @modelcontextprotocol/inspector uvx mcp-server-diff-python
npx @modelcontextprotocol/inspector uv --directory path\to\mcp-server-diff-python run mcp-server-diff-python

mcp-server-diff-python FAQ

How do I provide texts for comparison?
You pass two required arguments, string_a and string_b, containing the texts to compare.
What format does the diff output use?
The output is in Unified diff format, a standard for showing line-by-line text differences.
Can this server handle large text inputs?
It leverages Python's difflib, which is efficient for typical text sizes but may have performance limits on very large files.
How do I integrate this server with an MCP host?
Add the server configuration to your MCP host setup, such as Claude Desktop's config file.
Is this server limited to Python environments?
The server itself runs Python internally but exposes a protocol-agnostic interface usable by any MCP client.
Can I use this server for non-code text comparisons?
Yes, it works with any plain text inputs, including documentation, logs, or configuration files.
Does the server support other diff formats?
Currently, it only provides Unified diff format outputs.
How secure is the server when handling sensitive text?
Security depends on your MCP host environment; the server processes text locally without external calls.