Skip to main content
Glama
keyhoffman

Diff MCP Server

by keyhoffman

Diff MCP Server

A Model Context Protocol (MCP) server that provides Claude with powerful text comparison and diffing capabilities. This server allows Claude to definitively answer whether two pieces of text are identical and show detailed differences between them.

Features

  • Text Comparison: Compare two text strings and determine if they're identical

  • Detailed Diffing: Show detailed differences between texts with line-by-line analysis

  • Flexible Options: Ignore whitespace, case, or line ending differences

  • Edge Case Handling: Properly handles spaces, line endings, and formatting differences

Related MCP server: IntelliDiff MCP Server

Installation

  1. Clone this repository

  2. Install dependencies:

    npm install

Development

Build the TypeScript code:

npm run build

Run in development mode:

npm run dev

Usage

Building and Running

  1. Build the project:

    npm run build
  2. Run the server:

    npm start

MCP Configuration

Add this to your MCP configuration file (e.g., ~/.config/mcp/servers/diff-mcp.json):

{
  "mcpServers": {
    "diff-mcp": {
      "command": "node",
      "args": ["/path/to/your/diff-mcp-server/dist/index.js"],
      "env": {}
    }
  }
}

Available Tools

1. compare_texts

Compares two text strings and returns whether they are identical.

Parameters:

  • text1 (string): First text to compare

  • text2 (string): Second text to compare

  • ignoreWhitespace (boolean, optional): Ignore whitespace differences

  • ignoreCase (boolean, optional): Ignore case differences

  • ignoreLineEndings (boolean, optional): Ignore line ending differences

Returns:

{
  "identical": true/false,
  "summary": "Texts are identical" or "Texts differ: X additions, Y removals"
}

2. get_detailed_diff

Provides detailed differences between two text strings with line-by-line analysis.

Parameters:

  • text1 (string): First text to compare

  • text2 (string): Second text to compare

  • contextLines (number, optional): Number of context lines to show around changes

  • ignoreWhitespace (boolean, optional): Ignore whitespace differences

  • ignoreCase (boolean, optional): Ignore case differences

  • ignoreLineEndings (boolean, optional): Ignore line ending differences

Returns:

{
  "identical": true/false,
  "differences": [
    {
      "type": "add|remove|equal",
      "value": "text content",
      "lineNumber": 1
    }
  ],
  "summary": "Texts differ: X lines added, Y lines removed"
}

Example Usage

When Claude has access to this MCP server, it can now:

  1. Definitively answer identity questions: "Are these two files exactly the same?"

  2. Show precise differences: "What are the exact differences between these texts?"

  3. Handle edge cases: Properly detect differences in whitespace, line endings, and formatting

Success Criteria

With this MCP server, Claude can now:

  • ✅ Answer "yes, these are 100% identical" or "no, here are the exact differences"

  • ✅ Handle edge cases like spaces, line endings, and formatting

  • ✅ Provide detailed diff information when texts differ

  • ✅ Offer flexible comparison options (ignore whitespace, case, etc.)

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    C
    quality
    F
    maintenance
    compare 2 text or data (supports text diffs, json, json5, yaml, toml, xml and html). powered by jsondiffpatch
    1
    36
    5,339
    MIT
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables intelligent file and folder comparison with advanced text normalization, duplicate detection, and line-level diff analysis. Provides secure workspace-constrained file operations with CRC32-based exact matching and smart text comparison capabilities.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables deep, order-independent comparison of JSON files to detect differences including missing keys, value mismatches, and type differences. Provides detailed reports with path tracking for precise identification of variations between JSON structures.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI agents to compare documents, analyze changes, and retrieve document info using GroupDocs.Comparison. Supports various formats and includes licensing for production use.
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/keyhoffman/diff-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server