Skip to main content

Excel转Markdown

这是一个基于Python的MCP (Model Context Protocol) 服务器,用于将Excel文件转换为Markdown格式。

功能特性

  • 🚀 直接使用Python的markitdown库,支持Excel处理
  • 📊 支持多种Excel格式 (.xlsx, .xls)
  • 🗂️ 支持多工作表转换
  • 🔧 简单的API接口
  • 🛡️ 完整的错误处理

安装和使用

1. 安装依赖

cd /Users/fengjinchao/Desktop/mcp/skills/python/excel-to-markdown
uv sync

2. Claude配置

在Claude的MCP配置中添加:

{
  "excel-to-markdown-python": {
    "name": "Excel转markdown(Python)",
    "type": "stdio",
    "description": "Python版本的Excel转markdown工具,支持多工作表",
    "isActive": true,
    "command": "uv",
    "args": ["--directory", "/Users/fengjinchao/Desktop/mcp/skills/python/excel-to-markdown", "run", "excel-to-markdown-mcp"]
  }
}

3. 使用工具

基本用法

{
  "name": "xlsx-to-markdown",
  "arguments": {
    "filepath": "/path/to/your/spreadsheet.xlsx"
  }
}

指定工作表

{
  "name": "xlsx-to-markdown", 
  "arguments": {
    "filepath": "/path/to/your/spreadsheet.xlsx",
    "sheet_name": "Sheet1"
  }
}

支持的文件格式

  • .xlsx - Excel 2007+ 格式
  • .xls - Excel 97-2003 格式

Python版本的优势

  1. 更强大的Excel支持: Python生态系统有更好的Excel处理库
  2. 更好的性能: 避免了子进程调用的开销
  3. 更简洁的代码: 直接API调用,无需复杂的进程管理
  4. 更好的错误处理: Python异常处理机制更完善
  5. 扩展性更强: 易于添加新功能(如工作表选择、格式选项等)

代码结构

excel-to-markdown/
├── pyproject.toml               # 项目配置
├── README.md                   # 说明文档
└── excel_to_markdown_mcp/      # 主要代码
    ├── __init__.py            # 包初始化
    └── server.py              # MCP服务器实现

vs TypeScript 版本

特性 Python版本 TypeScript版本
代码行数 ~120行 ~150+行
依赖安装 uv sync npm install + uv sync
构建步骤 无需构建 npm run build
Excel支持 原生支持 通过子进程
错误处理 Python异常 复杂的进程错误处理
维护性 更简单 更复杂

Metadata

Release files for excel-to-markdown-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for excel-to-markdown-mcp 0.1.0
File Size Uploaded
excel_to_markdown_mcp-0.1.0.tar.gz 64.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for excel-to-markdown-mcp 0.1.0
File Interpreter ABI Platform
excel_to_markdown_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 69.1 kB

Release files / excel_to_markdown_mcp-0.1.0.tar.gz

Download URL excel_to_markdown_mcp-0.1.0.tar.gz
Size 64.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ac71add5decab697750a008cf5316ffd3620c966a0cb468672bdbadef154d5cc
BLAKE2b-256 checksum
How to use checksums
aa86c59d4da310a52cfa8e9303e49c910dafdb146525d4d1aaf627cdcfa3c017
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / excel_to_markdown_mcp-0.1.0-py3-none-any.whl

Download URL excel_to_markdown_mcp-0.1.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13ca153273979f95d99f6ed63809c7b65ecbc8d7d5660b4468da8eac62ac57d7
BLAKE2b-256 checksum
How to use checksums
b574c14ac3d0d6b5eda09160da1bc034920b056d7a4aa323248a9435992adf03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page