Token导航 LogoToken导航TokenDH.com
Deepdiff MCP logo
运维云端stdio官方级别未说明来源级核验

Deepdiff MCP

MCP Server

DeepDiff MCP服务器是一个基于模型上下文协议(MCP)的差异比较服务,支持多种数据格式的比较和转换。

工具数

9

提示词数

0

GitHub Stars

0

资源数

0
数据处理Python本地部署

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

abnerjacobsen

提供方

abnerjacobsen

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install deepdiff-mcp

详细介绍

DeepDiff MCP服务器

MCP(模型上下文协议)服务器 DeepDiff 图书馆。此服务器允许您通过模型上下文协议使用DeepDiff功能,从而允许从任何MCP客户端与DeepDiff进行交互。

安装

使用pip

pip install deepdiff-mcp

使用紫外线(推荐)

uv pip install deepdiff-mcp

用法

运行服务器

您可以通过多种方式运行DeepDiff MCP服务器:

作为命令行工具

# Using stdio transport (default)
deepdiff-mcp

# Using HTTP transport
deepdiff-mcp --transport http --host 127.0.0.1 --port 8000

# Using SSE transport
deepdiff-mcp --transport sse --host 127.0.0.1 --port 8000

作为Python模块

from deepdiff_mcp import create_server

# Create a DeepDiff MCP server
server = create_server("My DeepDiff Server")

# Run the server with stdio transport (default)
server.run()

# Or with HTTP transport
server.run(transport="http", host="127.0.0.1", port=8000, path="/mcp")

# Or with SSE transport
server.run(transport="sse", host="127.0.0.1", port=8000)

连接到服务器

您可以使用任何MCP客户端连接到服务器。以下是使用FastMCP的示例:

import asyncio
from fastmcp import Client

async def main():
    # Connect to a DeepDiff MCP server running as a subprocess
    async with Client("deepdiff-mcp") as client:
        # List available tools
        tools = await client.list_tools()
        print(f"Available tools: {[tool.name for tool in tools]}")
        
        # Compare two dictionaries
        t1 = {"a": 1, "b": 2}
        t2 = {"a": 1, "b": 3, "c": 4}
        
        result = await client.call_tool("compare", {"t1": t1, "t2": t2})
        print(f"Differences: {result.text}")

if __name__ == "__main__":
    asyncio.run(main())

可用工具

  • compare_files -直接比较两个CSV、Excel或JSON文件

DeepDiff MCP服务器提供以下工具:

  • compare -比较两个对象并返回它们的差异
  • get_deep_distance -计算两个物体之间的深度距离
  • search -在对象中搜索项目
  • grep -使用类似grep的行为在对象中搜索项目
  • hash_object -根据对象的内容对其进行哈希处理
  • create_delta -创建一个可以将一个对象转换为另一个对象的增量
  • apply_delta -应用增量来变换对象
  • extract_path -使用路径从对象中提取值

文档

有关DeepDiff的更多信息,请参阅 DeepDiff文档.

有关MCP和FastMCP的更多信息,请参阅 模型上下文协议FastMCP文档.

比较 CSV 和 Excel 文件

DeepDiff MCP 支持直接比较 CSV、Excel 和 JSON 文件:

import asyncio
from fastmcp import Client

async def main():
    async with Client("deepdiff-mcp") as client:
        # Compare dois arquivos CSV
        result = await client.call_tool(
            "compare_files", 
            {
                "file1_path": "caminho/para/arquivo1.csv", 
                "file2_path": "caminho/para/arquivo2.csv",
                "ignore_order": True  # Ignorar a ordem das linhas
            }
        )
        
        print(f"Diferenças: {result.text}")
        
        # Compare arquivos Excel
        excel_result = await client.call_tool(
            "compare_files", 
            {
                "file1_path": "caminho/para/arquivo1.xlsx", 
                "file2_path": "caminho/para/arquivo2.xlsx"
            }
        )
        
        print(f"Diferenças: {excel_result.text}")

if __name__ == "__main__":
    asyncio.run(main())

此功能对于数据分析和管道数据完整性检查尤其有用。

目录标签

目录标签

数据处理Python本地部署数据比较文件差异模型协议

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

9

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP