This guide will help you set up the Smart Diff MCP server to work with Claude Desktop.
- Claude Desktop installed
- Rust toolchain installed
- This repository cloned
cd /path/to/codediff
cargo build --release -p smart-diff-mcp-serverThe binary will be at: target/release/smart-diff-mcp
The location depends on your operating system:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
If the file doesn't exist, create it.
Edit the config file and add the smart-diff server:
{
"mcpServers": {
"smart-diff": {
"command": "/absolute/path/to/codediff/target/release/smart-diff-mcp",
"args": [],
"env": {
"RUST_LOG": "info"
}
}
}
}Important: Replace /absolute/path/to/codediff with the actual absolute path to your repository.
{
"mcpServers": {
"smart-diff": {
"command": "/home/username/projects/codediff/target/release/smart-diff-mcp",
"args": [],
"env": {
"RUST_LOG": "info"
}
}
}
}{
"mcpServers": {
"smart-diff": {
"command": "C:\\Users\\username\\projects\\codediff\\target\\release\\smart-diff-mcp.exe",
"args": [],
"env": {
"RUST_LOG": "info"
}
}
}
}Close and reopen Claude Desktop to load the new MCP server.
In Claude Desktop, you can verify the server is loaded by asking:
Can you list the available MCP tools?
You should see the smart-diff tools listed:
compare_locationslist_changed_functionsget_function_diffget_comparison_summary
Try a simple comparison:
Please use the smart-diff MCP server to compare these two directories:
- Source: /path/to/old/version
- Target: /path/to/new/version
Show me what functions changed.
Claude will use the MCP server to perform the comparison and report the results.
- Check the config file path: Make sure you edited the correct file for your OS
- Verify the binary path: Ensure the path in the config is absolute and correct
- Check file permissions: Make sure the binary is executable:
chmod +x target/release/smart-diff-mcp
- View logs: Check Claude's logs for errors:
- macOS:
~/Library/Logs/Claude/mcp*.log - Windows:
%APPDATA%\Claude\Logs\mcp*.log - Linux:
~/.config/Claude/logs/mcp*.log
- macOS:
-
Check RUST_LOG: Set to
debugfor more detailed logs:"env": { "RUST_LOG": "debug" }
-
Test manually: Run the server directly to see errors:
./target/release/smart-diff-mcp
Then type a test message:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocol_version":"2024-11-05","capabilities":{},"client_info":{"name":"test","version":"1.0"}}} -
Rebuild: Try a clean rebuild:
cargo clean cargo build --release -p smart-diff-mcp-server
- Check paths: Ensure the paths you're comparing exist and are readable
- Supported languages: The server supports Rust, Python, JavaScript, Java, C/C++
- File permissions: Make sure the server can read the files
Once set up, you can ask Claude things like:
Compare /old/src with /new/src and tell me what changed
Compare these directories and show me only the functions that changed significantly (more than 50%)
Compare the old and new versions, list the top 5 most changed functions, and explain what changed in each
Analyze the code changes and identify any refactoring patterns like function renames or moves
For production use, you might want less verbose logging:
"env": {
"RUST_LOG": "warn"
}For debugging:
"env": {
"RUST_LOG": "trace"
}You can have multiple MCP servers configured:
{
"mcpServers": {
"smart-diff": {
"command": "/path/to/smart-diff-mcp",
"args": [],
"env": {
"RUST_LOG": "info"
}
},
"other-server": {
"command": "/path/to/other-mcp-server",
"args": []
}
}
}- Read MCP_USAGE.md for detailed tool documentation
- Check README.md for feature overview
- See MCP_IMPLEMENTATION_SUMMARY.md for architecture details
If you encounter issues:
- Check the troubleshooting section above
- Review the logs in Claude's log directory
- Test the server manually with JSON-RPC messages
- Ensure you're using the latest version of Claude Desktop