zhangsichu/beyond-compare-mcp
If you are the rightful owner of beyond-compare-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Beyond Compare MCP Server provides a natural language interface for performing file and folder comparisons using Beyond Compare through the Model Context Protocol.
Beyond Compare MCP Server
A Model Context Protocol (MCP) server that provides natural language interface to Beyond Compare operations. This server allows Large Language Models (LLMs) to perform file and folder comparisons, synchronization, and other Beyond Compare operations through simple natural language commands.
Features
🔍 File Comparison
- Compare two files with detailed difference analysis
- Support for text and HTML output formats
- Automatic detection of identical vs different files
📁 Folder Comparison
- Compare entire directory structures
- Optional recursive subdirectory comparison
- Comprehensive difference reporting
📊 Report Generation
- Generate detailed comparison reports in HTML, XML, or text formats
- Customizable report paths and formats
- Professional-quality comparison documentation
🔄 Folder Synchronization
- Mirror synchronization (make target identical to source)
- Update synchronization (copy only newer files)
- Safe directory creation and validation
🔀 File Merging
- 2-way file merging
- 3-way merging with base file support
- Automatic merge conflict resolution
Prerequisites
-
Beyond Compare: This server requires Beyond Compare to be installed on your system
- macOS: Download Beyond Compare for Mac
- Windows: Download Beyond Compare for Windows
- Linux: Download Beyond Compare for Linux
-
Python 3.13+: Required for the MCP server
Installation
-
Clone and set up the project:
git clone git@github.com:zhangsichu/beyond-compare-mcp.git cd beyond-compare-mcp -
Install dependencies using uv:
uv sync -
Verify Beyond Compare installation:
# Test that Beyond Compare is accessible bcomp --help
Usage with Cursor IDE
This MCP server integrates seamlessly with Cursor IDE, enabling you to use Beyond Compare's powerful comparison tools through natural language commands.
Quick Setup
- Open Cursor Settings (
Cmd + ,orCtrl + ,) - Search for "MCP" or "Model Context Protocol"
- Add a new MCP server:
- Name:
beyond-compare - Command:
uv - Args:
--directory /{your-source-folder} run beyond-compare-mcp
- Name:
- Restart Cursor IDE
- Start comparing files with natural language prompts!
{
"mcpServers": {
"beyond-compare": {
"command": "uv",
"args": [
"--directory",
"/{your-source-folder}",
"run",
"beyond-compare-mcp"
],
"description": "Beyond Compare file and folder comparison tools"
}
}
}
Available Tools
1. compare_files
Compare two files and identify differences.
Parameters:
left_file(str): Path to the first fileright_file(str): Path to the second fileoutput_format(str, optional): "text" or "html" (default: "text")
Example:
Compare /path/to/file1.txt with /path/to/file2.txt in HTML format
2. compare_folders
Compare two directories and their contents.
Parameters:
left_folder(str): Path to the first folderright_folder(str): Path to the second folderinclude_subdirs(bool, optional): Include subdirectories (default: true)
Example:
Compare the folders /project/v1 and /project/v2 including all subdirectories
3. generate_comparison_report
Generate a detailed comparison report in various formats.
Parameters:
left_path(str): Path to first file/folderright_path(str): Path to second file/folderreport_path(str): Where to save the reportreport_format(str, optional): "html", "xml", or "text" (default: "html")
Example:
Generate an HTML comparison report for /src/old and /src/new, save it to /reports/comparison.html
4. sync_folders
Synchronize two folders using different strategies.
Parameters:
source_folder(str): Source directory pathtarget_folder(str): Target directory pathsync_mode(str, optional): "mirror" or "update" (default: "mirror")
Example:
Mirror sync /backup/source to /backup/target
5. merge_files
Merge two or three files with conflict resolution.
Parameters:
left_file(str): Path to left fileright_file(str): Path to right fileoutput_file(str): Path for merged outputbase_file(str, optional): Base file for 3-way merge
Example:
Merge /branch1/config.json and /branch2/config.json, save result to /merged/config.json
Example Conversations in Cursor IDE
Here are some example prompts you can use:
-
"Compare these two configuration files and show me the differences in HTML format"
- Uses
compare_fileswith HTML output
- Uses
-
"Check if these two project directories are in sync"
- Uses
compare_foldersto analyze directory differences
- Uses
-
"Generate a detailed comparison report between the old and new versions of my code"
- Uses
generate_comparison_reportto create comprehensive documentation
- Uses
-
"Sync my backup folder with the latest changes, but only copy newer files"
- Uses
sync_folderswith "update" mode
- Uses
-
"Merge these conflicting configuration files from two git branches"
- Uses
merge_filesto resolve conflicts
- Uses
Development
Running the server standalone
# Run with uv
uv run beyond-compare-mcp
# Or activate the virtual environment and run directly
source .venv/bin/activate # Linux/macOS
.venv\Scripts\activate # Windows
python -m beyond_compare_mcp.server
Testing
You can test individual tools by running the server and sending MCP requests, or use the MCP Inspector for debugging:
npx @modelcontextprotocol/inspector uv run beyond-compare-mcp
uv run python src/tests/test_basic.py
Troubleshooting
Common Issues
-
"Beyond Compare executable not found"
- Ensure Beyond Compare is installed and accessible in your PATH
- On macOS, the installer usually places it at
/Applications/Beyond Compare.app/Contents/MacOS/bcomp
-
"Permission denied" errors
- Check file/folder permissions for the paths you're comparing
- Ensure the target directories for reports/sync operations are writable
-
Server not appearing in Cursor IDE
- Verify the MCP configuration in Cursor settings
- Check that the absolute path to the project is correct
- Restart Cursor IDE after configuration changes
-
MCP connection issues
- Check Cursor's MCP logs (location varies by platform)
- Ensure all dependencies are installed with
uv sync - Try running the setup helper:
uv run python setup_cursor.py
Debug Logging
The server logs to stderr. Check Cursor's logs or run the server manually to see debug output:
uv run beyond-compare-mcp
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.