json对比(MCP&Agent挑战赛)

yohanLiu/jsonDiff_mcp
Hosted
5 Stars 196 次浏览 yohan 更新于 2026-08-23

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "mcp_jsondiff": {
      "args": [
        "mcp-jsondiff-kel@latest"
      ],
      "command": "uvx"
    }
  }
}

可用工具 (1 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

jsonDiff 2 个参数 需填 2 项

执行json对比

必填参数:expectKey、actualKey

服务介绍

JSON对比

📋 项目简介

在AI辅助开发过程中,JSON对比常常遇到以下问题:

  1. 准确性不足: 传统AI对比方法可能存在误判
  2. 理解偏差: AI可能误解需求,生成对比代码而非直接对比结果
  3. 输出冗长: 对比结果过于详细,难以快速获取关键信息

本项目通过MCP协议提供标准化的JSON对比服务,确保AI能够准确、快速地完成JSON对比任务。

🛠️ 部署指南

使用 uvx(推荐)

bash
uvx mcp-jsondiff-kel@latest

使用 pip

bash
pip install mcp-jsondiff-kel

从源码安装

bash
git clone https://github.com/your-username/mcp-jsondiff.git
cd mcp-jsondiff
pip install -e .

应用配置

Claude Desktop 配置

在应用配置文件中添加以下配置:

json
{
"mcpServers": {
"mcp_jsondiff": {
"command": "uvx",
"args": [
"mcp-jsondiff-kel@latest"
]
}
}
}

Cherry Studio 配置

json
{
"mcpServers": {
"mcp_jsondiff": {
"command": "uvx",
"args": [
"mcp-jsondiff-kel@latest"
]
}
}
}

📖 使用示例

演示示例用 Cherry Studio进行演示

首先在对话框中选择此 mcp 工具image-20250828221215427
然后输入形如如下的文案即可进行对比 json对比,预期值:{"a":1,"b":2}, 实际值:{"a":1,"b":2}

字符串对比

image-20250828221334908

json 对比

image-20250828221439044

转义后的 json 对比

image-20250828221359169

嵌套 json 对比

image-20250828221531975

演示视频

https://www.bilibili.com/video/BV1yYh2zNEcY/?spm_id_from=333.1387.homepage.video_card.click&vd_source=1a77b8b856c66190a0ab82a7acb92136

相关 MCP 服务