Skip to main content

MCP server for comparing Excel files with hierarchical module matching (stacked output)

Project description

excel-diff2-mcp

MCP (Model Context Protocol) server for comparing Excel files with hierarchical module matching.

Features

  • Hierarchical Module Matching: Match Excel data by multiple levels of functional modules
  • Stacked Output: Output two tables stacked in a single result
  • Dual Output Formats: Support both CSV and Markdown output
  • Flexible Input: Accept HTTP(S) URLs or Base64-encoded file content
  • Auto Header Detection: Automatically detect header rows
  • Merged Cell Handling: Fill merged cells downward for accurate comparison

Installation

pip install excel-diff2-mcp

Usage

Command Line

excel-diff2-mcp

As MCP Tool

from mcp.client.session import Session

async with Session() as session:
    result = await session.call(
        "compare_excel",
        file1="https://example.com/file1.xlsx",
        file2="https://example.com/file2.xlsx",
        compare_columns=["一级功能模块", "二级功能模块"],
        output_format="markdown",  # optional: "csv" (default) or "markdown"
    )

compare_excel Parameters

Parameter Type Required Description
file1 str Yes First Excel file (URL or Base64 content)
file2 str Yes Second Excel file (URL or Base64 content)
compare_columns list Yes Columns for hierarchical matching
table_name1 str No Display name for table 1
table_name2 str No Display name for table 2
output_format str No Output format: "csv" (default) or "markdown"

compare_columns Formats

Single array (same columns for both tables):

["一级功能模块", "二级功能模块"]

Dual array (different columns per table):

[["一级功能模块", "二级功能模块"], ["一级功能点", "二级功能点"]]

Output

CSV Format

表1名称,,,,
一级功能模块,二级功能模块,描述,比对结果
模块A,子模块1,描述内容,一级、二级功能模块均在【表2】找到
模块B,子模块2,描述内容,一级功能模块在【表2】找到

表2名称,,,,
一级功能模块,二级功能模块,描述,比对结果
模块A,子模块1,描述内容,一级、二级功能模块均在【表1】找到
模块C,子模块3,描述内容,未在【表1】找到

Markdown Format

## 表1名称

| 一级功能模块 | 二级功能模块 | 描述 | 比对结果 |
| --- | --- | --- | --- |
| 模块A | 子模块1 | 描述内容 | 一级、二级功能模块均在【表2】找到 |
| 模块B | 子模块2 | 描述内容 | 一级功能模块在【表2】找到 |

## 表2名称

| 一级功能模块 | 二级功能模块 | 描述 | 比对结果 |
| --- | --- | --- | --- |
| 模块A | 子模块1 | 描述内容 | 一级、二级功能模块均在【表1】找到 |
| 模块C | 子模块3 | 描述内容 | 未在【表1】找到 |

Supported File Formats

  • .xlsx - Excel 2007+ format
  • .xls - Excel 97-2003 format
  • .csv - Comma-separated values
  • .xlsm - Excel macro-enabled format
  • .xlsb - Excel binary format

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

excel_diff2_mcp-1.2.0.tar.gz (52.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

excel_diff2_mcp-1.2.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file excel_diff2_mcp-1.2.0.tar.gz.

File metadata

  • Download URL: excel_diff2_mcp-1.2.0.tar.gz
  • Upload date:
  • Size: 52.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for excel_diff2_mcp-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c43cbf99088532e2dc068666128401d7ea3c2977e44db3a08f87cb08a845f4b0
MD5 bc1301b5f949ebd0819f18b7dcaf3475
BLAKE2b-256 b1b957398325fe760ec1f63fc8df48f090d2599b243f7887686e9e1cc210fcae

See more details on using hashes here.

File details

Details for the file excel_diff2_mcp-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for excel_diff2_mcp-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3f9ec3233e69b695508b6da6f8d88c6c189398552bea2a3424f0000272d708d
MD5 9bd6ff1d456b9cd3a29870e48a608238
BLAKE2b-256 169cc4eb01d8ab19f1eb49358c937f69426eaf7681d3086be606ac1a47c668df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page