JSON Compare MCP Server

JSON Compare MCP Server

Enables deep, order-independent comparison of JSON files to detect differences including missing keys, value mismatches, and type differences. Provides detailed reports with path tracking for precise identification of variations between JSON structures.

Category
Visit Server

README

🔍 JSON Compare MCP Server

<div align="center">

Python MCP Docker Smithery

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!

🎯 Hızlı Başlangıç📦 Özellikler🚀 Kullanım🧪 Test

</div>


✨ Özellikler

  • 🔍 Derinlemesine Karşılaştırma - Nested objeler ve array'ler dahil tüm seviyeler
  • 🔀 Sıra-Bağımsız - Property ve obje sıralaması önemli değil
  • 📊 Detaylı Raporlama - Eksik, fazla ve farklı değerlerin detaylı raporu
  • 🎯 Path Tracking - Her farkın tam konumu (örn: root.user.settings.theme)
  • 🏷️ Tip Kontrolü - Değer tiplerini de karşılaştırır
  • Hızlı ve Verimli - Optimize edilmiş recursive algoritma

🎯 Hızlı Başlangıç

1. Kurulum

git clone https://github.com/yourusername/json-compare-mcp.git
cd json-compare-mcp
pip install -r requirements.txt

2. MCP Server'ı Başlat

python server.py

3. Test Et

python test_compare.py

📦 Ne İçeriyor?

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

🚀 Kullanım

MCP Tool: 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!

Çıktı Formatı

{
  "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
  }
}

🔍 Karşılaştırma Mantığı

Seviye 1: Üst Seviye Obje Karşılaştırma

  • ✅ Her iki JSON'daki üst seviye objeleri/anahtarları tespit et
  • SIRALAMA ÖNEMLİ DEĞİL - Objeler farklı sırada olabilir
  • ✅ Eksik/fazla objeleri tespit et ve uyar
  • ✅ Eşleşen objeler için Seviye 2'ye geç

Seviye 2: İç Nesne/Property Karşılaştırma

  • ✅ Tüm property'leri karşılaştır
  • SIRALAMA ÖNEMLİ DEĞİL - Property'ler farklı sırada olabilir
  • ✅ Property varlığı, tip ve içerik kontrolü
  • ✅ Array'ler için sıra-bağımsız karşılaştırma

Fark Tipleri

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ı

🧪 Test

Test Suite'i Çalıştır

python test_compare.py

Test Senaryoları

  1. Sıra-bağımsız test: Aynı içerik, farklı sıralama → identical
  2. Farklılık tespiti: Farklı değerler → detaylı fark raporu
  3. Kendisi ile: Aynı dosya → identical

Test Çıktısı

✅ 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

🛠️ Geliştirme

Yeni Tool Eklemek

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)

🚀 Deployment

Smithery Deployment

  1. Repository'yi GitHub'a push et
  2. Smithery'de repository'yi bağla
  3. Tek tıkla deploy et! 🎉

Docker Deployment

docker build -t json-compare-mcp .
docker run -p 8000:8000 json-compare-mcp

Manuel Deployment

pip install -r requirements.txt
python server.py

📋 Gereksinimler

  • Python 3.11+
  • mcp
  • requests

🤝 Katkıda Bulunma

  1. 🍴 Fork et
  2. 🌱 Feature branch oluştur
  3. 💻 Değişiklikleri yap
  4. 🧪 Test et
  5. 📝 Pull request gönder

📄 Lisans

MIT License - Detaylar için LICENSE dosyasına bakın.


<div align="center">

Made with ❤️ for better JSON comparison

Sıra-bağımsız, derinlemesine, güvenilir 🚀

</div>

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured