office-mcp

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Office MCP Server

Office MCP服务器

Overview

概述

A complete MCP (Model Context Protocol) server providing 39 tools for Office document operations. Implemented in TypeScript/Node.js with real functionality (not placeholders).
一款完整的MCP(Model Context Protocol)服务器,提供39种工具用于Office文档操作。基于TypeScript/Node.js实现,具备实际功能(非占位符)。

Tool Categories

工具分类

PDF Tools (10)

PDF工具(10种)

ToolDescription
extract_text_from_pdf
Extract text content, supports page selection
extract_tables_from_pdf
Extract table data from PDFs
merge_pdfs
Merge multiple PDFs into one
split_pdf
Split PDF by page ranges
compress_pdf
Reduce PDF file size
add_watermark_to_pdf
Add text/image watermarks
fill_pdf_form
Fill PDF form fields
get_pdf_metadata
Get PDF properties and metadata
ocr_pdf
OCR on scanned PDFs (multi-language)
ocr_image
OCR on image files (PNG, JPG, TIFF, etc.)
工具描述
extract_text_from_pdf
提取文本内容,支持页面选择
extract_tables_from_pdf
从PDF中提取表格数据
merge_pdfs
将多个PDF合并为一个文件
split_pdf
按页面范围拆分PDF
compress_pdf
减小PDF文件体积
add_watermark_to_pdf
添加文字/图片水印
fill_pdf_form
填充PDF表单字段
get_pdf_metadata
获取PDF属性及元数据
ocr_pdf
对扫描版PDF进行OCR识别(多语言支持)
ocr_image
对图片文件进行OCR识别(支持PNG、JPG、TIFF等格式)

Spreadsheet Tools (7)

电子表格工具(7种)

ToolDescription
read_xlsx
Read Excel files with sheet/range selection
create_xlsx
Create multi-sheet Excel files
analyze_spreadsheet
Statistical analysis (min/max/mean/median)
apply_formula
Apply Excel formulas to cells
create_chart
Generate chart configurations
pivot_table
Create pivot tables with aggregation
xlsx_to_json
Convert Excel to JSON
工具描述
read_xlsx
读取Excel文件,支持工作表/范围选择
create_xlsx
创建多工作表Excel文件
analyze_spreadsheet
统计分析(最小值/最大值/平均值/中位数)
apply_formula
对单元格应用Excel公式
create_chart
生成图表配置
pivot_table
创建带聚合功能的数据透视表
xlsx_to_json
将Excel转换为JSON格式

Document Tools (6)

文档工具(6种)

ToolDescription
extract_text_from_docx
Extract text from Word documents
create_docx
Create DOCX with headings, lists, tables
fill_docx_template
Fill templates with {{placeholders}}
analyze_document_structure
Analyze headings, tables, word count
insert_table_to_docx
Insert tables into documents
merge_docx_files
Merge multiple Word documents
工具描述
extract_text_from_docx
从Word文档中提取文本
create_docx
创建包含标题、列表、表格的DOCX文档
fill_docx_template
使用{{占位符}}填充模板
analyze_document_structure
分析标题、表格、字数等文档结构信息
insert_table_to_docx
向文档中插入表格
merge_docx_files
合并多个Word文档

Conversion Tools (9)

格式转换工具(9种)

ToolDescription
xlsx_to_csv
Convert Excel to CSV
csv_to_xlsx
Convert CSV to Excel
json_to_xlsx
Convert JSON arrays to Excel
docx_to_md
Convert Word to Markdown
md_to_docx
Convert Markdown to Word
pdf_to_docx
Convert PDF to Word (text extraction)
docx_to_pdf
Convert Word to PDF (external tool required)
html_to_pdf
Convert HTML to PDF (external tool required)
batch_convert
Batch convert multiple files
工具描述
xlsx_to_csv
将Excel转换为CSV格式
csv_to_xlsx
将CSV转换为Excel格式
json_to_xlsx
将JSON数组转换为Excel格式
docx_to_md
将Word转换为Markdown格式
md_to_docx
将Markdown转换为Word格式
pdf_to_docx
将PDF转换为Word(基于文本提取)
docx_to_pdf
将Word转换为PDF(需依赖外部工具)
html_to_pdf
将HTML转换为PDF(需依赖外部工具)
batch_convert
批量转换多个文件

Presentation Tools (7)

演示文稿工具(7种)

ToolDescription
create_pptx
Create PowerPoint with themes
extract_from_pptx
Extract text and images from PPTX
md_to_pptx
Convert Markdown to slides
add_slide
Add slides to existing presentations
update_slide
Update slide content
pptx_to_html
Convert to reveal.js HTML
get_pptx_outline
Get presentation structure
工具描述
create_pptx
创建带主题的PowerPoint演示文稿
extract_from_pptx
从PPTX中提取文本和图片
md_to_pptx
将Markdown转换为幻灯片
add_slide
向现有演示文稿中添加幻灯片
update_slide
更新幻灯片内容
pptx_to_html
转换为reveal.js格式的HTML
get_pptx_outline
获取演示文稿结构大纲

Installation

安装步骤

1. Clone and Build

1. 克隆并构建

bash
cd mcp-servers/office-mcp
npm install
npm run build
bash
cd mcp-servers/office-mcp
npm install
npm run build

2. Configure Claude Desktop

2. 配置Claude桌面端

Add to
~/Library/Application Support/Claude/claude_desktop_config.json
:
json
{
  "mcpServers": {
    "office-mcp": {
      "command": "/usr/local/bin/node",
      "args": ["/path/to/claude-office-skills/mcp-servers/office-mcp/dist/index.js"]
    }
  }
}
将以下内容添加到
~/Library/Application Support/Claude/claude_desktop_config.json
json
{
  "mcpServers": {
    "office-mcp": {
      "command": "/usr/local/bin/node",
      "args": ["/path/to/claude-office-skills/mcp-servers/office-mcp/dist/index.js"]
    }
  }
}

3. Restart Claude Desktop

3. 重启Claude桌面端

Example Prompts

示例提示词

  • "Read the Excel file at ~/Documents/sales.xlsx"
  • "Create a PowerPoint with 5 slides about AI trends"
  • "Extract text from this PDF and convert to Markdown"
  • "Merge these 3 Word documents into one"
  • "Analyze the data in this spreadsheet"
  • "读取~/Documents/sales.xlsx路径下的Excel文件"
  • "创建一份包含5页幻灯片的AI趋势主题PowerPoint"
  • "提取这份PDF的文本内容并转换为Markdown格式"
  • "将这3份Word文档合并为一个文件"
  • "分析这份电子表格中的数据"

Dependencies

依赖项

pdf-parse, pdf-lib       - PDF operations
tesseract.js             - OCR (pure JavaScript, no native binary needed)
xlsx                     - Excel operations
mammoth, docx            - Word operations
docxtemplater, pizzip    - Template filling
pptxgenjs, jszip         - PowerPoint operations
turndown, marked         - Markdown conversion
pdf-parse, pdf-lib       - PDF操作
tesseract.js             - OCR(纯JavaScript实现,无需本地二进制文件)
xlsx                     - Excel操作
mammoth, docx            - Word操作
docxtemplater, pizzip    - 模板填充
pptxgenjs, jszip         - PowerPoint操作
turndown, marked         - Markdown转换

Supported OCR Languages

支持的OCR语言

  • eng
    - English
  • chi_sim
    - Simplified Chinese
  • chi_tra
    - Traditional Chinese
  • jpn
    - Japanese
  • kor
    - Korean
  • fra
    - French
  • deu
    - German
  • spa
    - Spanish
  • eng
    - 英文
  • chi_sim
    - 简体中文
  • chi_tra
    - 繁体中文
  • jpn
    - 日语
  • kor
    - 韩语
  • fra
    - 法语
  • deu
    - 德语
  • spa
    - 西班牙语

Resources

资源链接