Provides a single `compare_json` tool that performs deep, order-independent comparison of two JSON strings. Pass in your JSON data directly as strings and get back a detailed diff report showing missing keys, extra keys, value mismatches, and type mismatches, all tracked with full path information like `root.user.settings.theme`. The comparison ignores property ordering at all nesting levels and handles arrays intelligently. Useful when you need to validate API response changes, catch config drift, or debug data transformations where key ordering doesn't matter but content accuracy does. Returns structured output with counts by difference type and specific locations for each variance.
Derinlemesine ve sıra-bağımsız JSON karşılaştırma MCP tool'u
İki JSON dosyasını akıllıca karşılaştırın, farklılıkları tespit edin!
root.user.settings.theme)git clone https://github.com/yourusername/json-compare-mcp.git
cd json-compare-mcp
pip install -r requirements.txt
python server.py
python test_compare.py
json-compare-mcp/
├── 🐍 app.py # JSON karşılaştırma implementasyonu
├── 🚀 server.py # MCP server yapılandırması
├── 🧪 test_compare.py # Test suite
├── 📋 requirements.txt # Python bağımlılıkları
├── 🐳 Dockerfile # Container yapılandırması
├── ⚙️ smithery.yaml # Smithery deployment config
└── 📁 test_samples/ # Örnek JSON dosyaları
├── file1.json
├── file2.json
└── file3_different.json
compare_json# İki JSON string'ini karşılaştır
compare_json(
json1='{"name": "Ahmet", "age": 30, "city": "Istanbul"}',
json2='{"age": 30, "city": "Istanbul", "name": "Ahmet"}'
)
Not: Artık dosya yolu değil, direkt JSON string kullanın!
{
"status": "different",
"total_differences": 11,
"differences": [
{
"type": "missing_key",
"path": "root.user.settings.language",
"key": "language",
"file1_value": "tr",
"message": "Key 'language' exists in file1 but missing in file2"
},
{
"type": "value_mismatch",
"path": "root.user.name",
"file1_value": "Ahmet Yılmaz",
"file2_value": "Mehmet Demir",
"message": "Value mismatch at 'root.user.name'"
}
],
"summary": {
"missing_keys": 1,
"extra_keys": 2,
"value_mismatches": 8,
"type_mismatches": 0
}
}
| Tip | Açıklama |
|---|---|
missing_key | Anahtar file1'de var, file2'de yok |
extra_key | Anahtar file2'de var, file1'de yok |
value_mismatch | Değerler farklı |
type_mismatch | Veri tipleri farklı |
python test_compare.py
identicalidentical✅ Test 1 - Sıra-bağımsız: BAŞARILI
✅ Test 2 - Farklılık tespiti: BAŞARILI
✅ Test 3 - Aynı dosya: BAŞARILI
🔍 Test 2 Detayları:
- Eksik anahtarlar: 1
- Fazla anahtarlar: 2
- Değer uyuşmazlıkları: 8
- Tip uyuşmazlıkları: 0
- Toplam fark: 11
app.py dosyasına yeni fonksiyon ekle:
def myNewTool(param: str) -> str:
# Your logic
return result
server.py dosyasına MCP tool olarak kaydet:
@mcp.tool()
async def my_new_tool(param: str) -> str:
"""Tool açıklaması"""
return myNewTool(param)
docker build -t json-compare-mcp .
docker run -p 8000:8000 json-compare-mcp
pip install -r requirements.txt
python server.py
MIT License - Detaylar için LICENSE dosyasına bakın.
Made with ❤️ for better JSON comparison
Sıra-bağımsız, derinlemesine, güvenilir 🚀
com.mcparmory/google-sheets
domdomegg/google-sheets-mcp
henilcalagiya/google-sheets-mcp
cct15/war-dashboard-data
moooonad/mcp-google-sheets-full
io.github.br0ski777/csv-to-json