Excel to PDF MCP Server

Excel to PDF MCP Server

site icon
2025.04.08 0
TypeScript文件格式转换电子表格处理内容生成
Excel to PDF MCP Server 是一个基于 Model Context Protocol (MCP) 的服务,专门用于将 Excel (.xls/.xlsx) 和 Apple Numbers (.numbers) 文件转换为 PDF 格式。该服务可以与 AI 助手(如 Claude)集成,通过对话直接进行文件转换。
View on GitHub

Overview

基本能力

产品定位

Excel to PDF MCP Server 是一个文件格式转换工具,专注于将电子表格文件转换为 PDF 格式。

核心功能

  • 将 Excel 文件 (.xls, .xlsx) 转换为 PDF
  • 将 Apple Numbers 文件 (.numbers) 转换为 PDF
  • 通过 Model Context Protocol 与 AI 助手集成
  • 安全的文件处理,尊重项目边界
  • 通过 npm 轻松安装

适用场景

  • 需要将电子表格文件转换为 PDF 以便共享的场景
  • 与 AI 助手集成,通过对话直接完成文件转换
  • 自动化工作流程中的文件格式转换

工具列表

  1. convert_excel_to_pdf
  2. 功能:将 Excel 文件 (.xls/.xlsx) 转换为 PDF 格式
  3. 参数:

    • input_path: Excel 文件的相对路径(必需)
    • output_format: 输出格式,目前仅支持 PDF(默认:"pdf")
  4. convert_numbers_to_pdf

  5. 功能:将 Apple Numbers 文件 (.numbers) 转换为 PDF 格式
  6. 参数:
    • input_path: Numbers 文件的相对路径(必需)
    • output_format: 输出格式,目前仅支持 PDF(默认:"pdf")

常见问题解答

  • 需要安装 LibreOffice 作为转换引擎
  • 文件必须位于项目目录内才能被处理

使用教程

使用依赖

安装 LibreOffice

LibreOffice 是转换过程所必需的。根据您的操作系统安装:

macOS:

brew install libreoffice

Ubuntu/Debian:

apt-get install libreoffice

Windows:LibreOffice 官方网站下载并安装。

安装教程

安装 MCP 服务器:

npm install -g excel-to-pdf-mcp

与 Claude Desktop 一起使用

  1. 在 Claude desktop 的 mcp_settings.json 中添加此服务器配置:
{
  "mcpServers": {
    "excel-to-pdf-mcp": {
      "command": "npx",
      "args": ["excel-to-pdf-mcp"],
      "name": "Excel to PDF Converter"
    }
  }
}
  1. 确保您的 Excel 或 Numbers 文件位于项目目录内。

  2. 配置完成后,Claude 将能够使用此工具将您的电子表格文件转换为 PDF。

调试方式

从源代码运行或贡献: 1. 克隆仓库 2. 安装依赖:npm install 3. 构建项目:npm run build 4. 运行服务器:npm start

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。