IntelliDiff MCP Server
An intelligent file and folder comparison MCP server with advanced text normalization and duplicate detection capabilities.
Features
- File Comparison: CRC32-based exact comparison and smart text comparison with normalization
- Folder Comparison: Recursive directory comparison with orphan detection
- Duplicate Detection: Find identical files within directories
- Text Normalization: Handle case, whitespace, tabs, line endings, and Unicode differences
- Line-Level Analysis: Detailed diff output with line ranges and targeted file reading
- Clean Output: Markdown-formatted text responses instead of JSON bloat
- Security: Workspace root validation prevents path traversal attacks
- Performance: Streaming for large files, configurable limits, symlink loop prevention
Installation
Project Structure
The server is built with a clean modular architecture:
intellidiff_server.py
(52 lines) - Main server entry point and tool registrationworkspace_security.py
- Path validation and workspace boundary enforcementfile_operations.py
- Core file utilities (CRC32, text detection, normalization)tools.py
- Individual MCP tool implementationsfolder_operations.py
- Folder comparison and duplicate detection logic
MCP Configuration
Local/stdio Configuration
Local/stdio Configuration with Environment Variables
Remote/HTTP Configuration
Place this configuration in:
- VS Code:
.vscode/mcp.json
(project) or user settings - Claude Desktop:
claude_desktop_config.json
- Cursor:
.cursor/mcp.json
(project) or~/.cursor/mcp.json
(user) - LM Studio:
~/.lmstudio/mcp.json
Environment Variables
Variable | Default | Description |
---|---|---|
INTELLIDIFF_MAX_TEXT_SIZE | 10485760 (10MB) | Maximum size for text file comparison |
INTELLIDIFF_MAX_BINARY_SIZE | 1073741824 (1GB) | Maximum size for binary file CRC32 |
INTELLIDIFF_MAX_DEPTH | 10 | Maximum directory recursion depth |
INTELLIDIFF_CHUNK_SIZE | 65536 (64KB) | File reading chunk size |
Tools
validate_workspace_path
Validate that a path is within the workspace root.
Parameters:
path
(string): Path to validate
get_file_hash
Get CRC32 hash and basic information about a file.
Parameters:
file_path
(string): Path to the file
compare_files
Compare two files with various modes and options.
Parameters:
left_path
(string): Path to first fileright_path
(string): Path to second filemode
(string): Comparison mode - "exact", "smart_text", or "binary"ignore_blank_lines
(boolean): Skip empty lines during comparisonignore_newline_differences
(boolean): Normalize line endingsignore_whitespace
(boolean): Ignore leading/trailing whitespaceignore_case
(boolean): Case-insensitive comparisonnormalize_tabs
(boolean): Convert tabs to spacesunicode_normalize
(boolean): Apply Unicode NFKC normalization
compare_folders
Compare two folder structures recursively.
Parameters:
left_path
(string): Path to first folderright_path
(string): Path to second foldermax_depth
(integer): Maximum recursion depth (default: from env var)include_binary
(boolean): Include binary files in comparisoncomparison_mode
(string): "exact" or "smart_text"
find_identical_files
Find files with identical content within a folder.
Parameters:
folder_path
(string): Path to folder to scanmax_depth
(integer): Maximum recursion depth (default: from env var)
read_file_lines
Read specific line ranges from a text file with optional context.
Parameters:
file_path
(string): Path to the text filestart_line
(integer): Starting line number (1-based, default: 1)end_line
(integer): Ending line number (1-based, default: end of file)context_lines
(integer): Additional context lines before/after range (default: 0)
Usage Examples
Compare Two Files
Compare Folders
Find Duplicates
Read Specific Lines
Working with Diff Results
Security
- All file paths are validated against the workspace root
- Path traversal attacks are prevented through path resolution
- Symlink loops are detected and avoided
- File size limits prevent memory exhaustion
- Read-only operations only
Performance
- Streaming I/O for large files
- Early exit on size mismatches
- CRC32 caching for repeated operations
- Configurable chunk sizes and limits
- Progress reporting for large operations
License
MIT License - see LICENSE file for details.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
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.