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版本的优势
- 更强大的Excel支持: Python生态系统有更好的Excel处理库
- 更好的性能: 避免了子进程调用的开销
- 更简洁的代码: 直接API调用,无需复杂的进程管理
- 更好的错误处理: Python异常处理机制更完善
- 扩展性更强: 易于添加新功能(如工作表选择、格式选项等)
代码结构
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| excel_to_markdown_mcp-0.1.0.tar.gz | 64.7 kB | Without provenance | Details for excel_to_markdown_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| excel_to_markdown_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for excel_to_markdown_mcp-0.1.0-py3-none-any.whl |
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
|
Security for excel-to-markdown-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.