# Text Diff Engine MCP for AI Agents AI Agent Connect

> Text Diff Engine provides character-by-character string comparisons. It moves past vague AI summaries to give you exact, deterministic diffs for code blocks, legal contracts, and configuration files. You get the precise line-by-line changes every single time.

## Overview
- **Category:** productivity
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_DMCIFplCMI3ua9QqBPl0eJqMbavy6e2NunWJFUXf/ai-agent-connect
- **Tags:** diffing, text-comparison, patch-generation, code-review, version-control, deterministic-analysis

## Description

When you ask an AI to compare two versions of a document, it usually tries to be helpful by summarizing what changed. That's fine for a quick overview, but it's a disaster when you need to know exactly which character moved or which specific clause was swapped in a legal agreement. This Connector stops the guessing game. It uses a deterministic engine to generate precise patches, showing you exactly what was added, removed, or left alone.

Instead of reading a paragraph of "the AI thinks these are different," you get a clear map of the modifications. It's built for high-stakes environments where "mostly the same" isn't good enough. Whether you're auditing a complex configuration file or reviewing a series of code commits, you get the raw truth. You can find this in the Vinkius catalog alongside thousands of other tools that give your agent actual capabilities. It turns your AI client into a precise auditing tool rather than just a summary bot.

## Tools

### compare_texts
Provide two strings to get a structured diff showing additions, deletions, and unchanged lines. This is perfect for finding exact changes in code or legal text.

## Prompt Examples

**Prompt:** 
```
Generate a unified diff between v1-config.json and v2-config.json.
```

**Response:** 
```
✅ **Diff Generated:**
```diff
-  "timeout": 30
+  "timeout": 60
```
```

**Prompt:** 
```
Show me the word-level differences between these two legal contract paragraphs.
```

**Response:** 
```
✅ **Word Diff:** Detected 4 removed words and 2 added clauses accurately.
```

**Prompt:** 
```
Compare the original HTML file with the minified version to ensure no attribute loss.
```

**Response:** 
```
✅ **Comparison Complete:** The files are structurally identical, differing only in 1,204 whitespace removals.
```

## Capabilities

### Generate line-by-line patches
Get a structured list of exactly what changed between two versions of any text.

### Identify character-level deletions
See exactly which characters were removed from a string.

### Highlight specific additions
Pinpoint new text inserted into a document or code block.

### Compare configuration files
Track changes in JSON, YAML, or other structured data formats.

### Audit legal contracts
Detect tiny wording swaps in legal agreements that summaries might miss.

## Use Cases

### Comparing complex configuration files
A dev wants to see what changed in a 200-line config file. The agent uses compare_texts to show only the modified lines.

### Auditing legal contract variations
A lawyer needs to see every word change in a new contract. The agent identifies word-level differences between two paragraphs.

### Verifying minified code integrity
Checking if minification broke a website. The agent compares original and minified HTML to find whitespace removals.

### Rapid code review for pull requests
A team lead asks the agent to find specific logic changes in a large diff. The agent provides a structured patch.

## Benefits

- Stop AI hallucinations by using deterministic diffing instead of summaries.
- Review code changes faster using the compare_texts tool for line-by-line accuracy.
- Audit legal contracts with precision to catch tiny wording swaps in agreements.
- Compare large JSON or YAML files without losing track of specific key changes.
- Verify minified HTML or CSS files to ensure no critical attributes were dropped.

## How It Works

The bottom line is you get exact text differences without any AI hallucination or summary fluff.

1. Provide the original and modified text versions to your agent.
2. The agent calls the compare_texts tool to process the strings.
3. You get a structured list of additions, deletions, and unchanged lines.

## Frequently Asked Questions

**Can the Text Diff Engine handle large files?**
Yes, it compares the strings you provide to find exact differences. It's great for long contracts or large config files where you need to see every line.

**Does the Text Diff Engine hallucinate changes?**
No. Because it uses a deterministic diffing library, it doesn't guess what changed. It reports the actual character-by-character differences.

**Can I use Text Diff Engine for code reviews?**
It's perfect for that. You can have your agent compare two versions of a script to see exactly which lines were added or removed.

**Does the Text Diff Engine work for legal documents?**
Yes, it's one of its primary uses. It can identify word-level differences in paragraphs to help you catch tiny wording changes in contracts.

**How do I get a diff between two JSON files using Text Diff Engine?**
Just provide the original and modified JSON strings. Your agent will use the compare_texts tool to show you the additions and deletions.

**Is Text Diff Engine better than just asking the AI to summarize?**
If you need accuracy, yes. Summaries are for overviews; Text Diff Engine is for when you need to know exactly what changed.

**Can it diff code?**
Yes, it is excellent for comparing code files.

**Does it output in standard patch format?**
Yes, it outputs unified diff formatting.

**Can it diff large documents?**
Absolutely, it runs instantly on large text payloads.