Content
# @erliban/office-mcp-server
<div align="center">
**🔥 AI-Powered Professional Document Generation MCP Server**
[](https://www.npmjs.com/package/@erliban/office-mcp-server)
[](https://opensource.org/licenses/MIT)
[](https://nodejs.org/)
*8 Document Themes | 6 Mermaid Chart Styles | China National Standards Compliant*
[English](#english) | [中文](#中文)
</div>
---
<a name="english"></a>
## English
### ✨ Core Features
| Feature | Description |
|---------|-------------|
| **🎯 Professional Documents** | Compliant with GB/T 9704-2012 (Government), GB/T 8567-2006 (Software) standards |
| **🎨 Multiple Themes** | 8 document themes + 6 Mermaid chart color schemes |
| **📊 Mermaid Diagrams** | Auto-convert flowcharts, sequence diagrams to PNG images |
| **🤖 AI Native** | Designed for Claude, ChatGPT via MCP protocol |
| **⚡ Ready to Use** | One command to start |
### 📦 Quick Start
#### Installation
```bash
npm install -g @erliban/office-mcp-server
```
#### Claude Desktop Configuration
Add to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"office": {
"command": "npx",
"args": ["@erliban/office-mcp-server"]
}
}
}
```
**Config file location**:
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
### 🎨 Document Themes
#### Standard Themes
| Theme | Name | Use Case | Standard |
|-------|------|----------|----------|
| `government` | Government | Official documents | GB/T 9704-2012 |
| `academic` | Academic | Thesis, research | Academic standards |
| `software` | Software | Requirements, design docs | GB/T 8567-2006 |
| `business` | Business | Reports, proposals | Enterprise standards |
#### Brand Themes
| Theme | Name | Color | Industry |
|-------|------|-------|----------|
| `alibaba` | Alibaba | Orange | E-commerce |
| `tencent` | Tencent | Green | Social, Finance |
| `bytedance` | ByteDance | Black | Tech, Media |
| `minimal` | Minimal | B&W | Universal |
### 📊 Mermaid Chart Themes
| Theme | Name | Color | Best For |
|-------|------|-------|----------|
| `professional` | Professional | Blue #4a90d9 | Technical docs |
| `fresh` | Fresh | Green #52c41a | Flowcharts |
| `business` | Business | Gray #595959 | Formal reports |
| `tech` | Tech | Purple #722ed1 | Product docs |
| `warm` | Warm | Orange #fa8c16 | Proposals |
| `default` | Default | Mermaid default | General |
### 🛠️ Available Tools
#### Word Tools
| Tool | Description |
|------|-------------|
| `word_create` | Create Word document |
| `word_add_heading` | Add heading |
| `word_add_paragraph` | Add paragraph |
| `word_add_table` | Add table |
| `word_add_list` | Add list |
| `word_add_code` | Add code block |
| `word_add_diagram` | Add Mermaid diagram |
| `word_save` | Save document |
#### Excel Tools
| Tool | Description |
|------|-------------|
| `excel_create` | Create workbook |
| `excel_add_sheet` | Add worksheet |
| `excel_write_data` | Write data |
| `excel_add_chart` | Write chart data |
| `excel_save` | Save workbook |
---
<a name="中文"></a>
## 中文
### ✨ 核心优势
| 特性 | 描述 |
|------|------|
| **🎯 专业级文档** | 严格遵循 GB/T 9704-2012(公文)、GB/T 8567-2006(软件文档)等国家标准 |
| **🎨 多主题支持** | 8 种预设文档风格 + 6 种 Mermaid 图表配色,覆盖政府、学术、企业全场景 |
| **📊 Mermaid 图表** | AI 自动识别并将流程图、时序图等转换为专业 PNG 图片嵌入文档 |
| **🤖 AI 原生** | 专为 Claude、ChatGPT 等 AI 设计,通过 MCP 协议无缝集成 |
| **⚡ 开箱即用** | 无需复杂配置,一行命令即可启动服务 |
### 📦 快速开始
#### 安装
```bash
npm install -g @erliban/office-mcp-server
```
#### Claude Desktop 配置
将以下配置添加到 `claude_desktop_config.json`:
```json
{
"mcpServers": {
"office": {
"command": "npx",
"args": ["@erliban/office-mcp-server"]
}
}
}
```
**配置文件位置**:
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
### 🎯 推荐 Prompt
将以下内容添加到 Claude 的系统提示或项目 CLAUDE.md 中:
```markdown
## Office 文档生成规范
使用 @erliban/office-mcp-server 生成专业文档时遵循以下规则:
### 文档主题选择
- **党政公文** → theme: "government" (GB/T 9704-2012 标准)
- **学术论文/研究报告** → theme: "academic"
- **软件需求/设计文档** → theme: "software" (GB/T 8567-2006 标准)
- **商业计划书/工作汇报** → theme: "business"
- **电商/零售行业** → theme: "alibaba"
- **社交/金融行业** → theme: "tencent"
- **科技/媒体行业** → theme: "bytedance"
- **通用正式文档** → theme: "minimal"
### Mermaid 图表转换
当文档中包含架构图、流程图时:
1. 使用 word_add_diagram 工具将 Mermaid 语法转为图片
2. 根据文档类型选择合适的图表主题:
- 技术文档 → diagramTheme: "professional"
- 流程图 → diagramTheme: "fresh"
- 正式报告 → diagramTheme: "business"
- 产品文档 → diagramTheme: "tech"
- 产品方案 → diagramTheme: "warm"
### 生成流程
1. word_create → 创建文档(指定主题)
2. word_add_heading → 添加标题层级
3. word_add_paragraph → 添加正文内容
4. word_add_table → 添加数据表格
5. word_add_diagram → 添加 Mermaid 图表
6. word_add_list → 添加列表
7. word_save → 保存文档
```
### 🎨 文档主题一览
#### 标准规范主题
| 主题 | 名称 | 适用场景 | 参考标准 |
|------|------|---------|---------|
| `government` | 党政公文 | 政府机关、国企公文 | GB/T 9704-2012 |
| `academic` | 学术论文 | 毕业论文、研究报告 | 学术论文规范 |
| `software` | 软件文档 | 需求规格、设计文档 | GB/T 8567-2006 |
| `business` | 商务报告 | 商业计划书、工作汇报 | 企业文档规范 |
#### 企业品牌主题
| 主题 | 名称 | 主色调 | 适用行业 |
|------|------|--------|---------|
| `alibaba` | 阿里风格 | 橙色系 | 电商、零售 |
| `tencent` | 腾讯风格 | 绿色系 | 社交、金融 |
| `bytedance` | 字节风格 | 黑色系 | 科技、媒体 |
| `minimal` | 简约黑白 | 黑白 | 通用正式场合 |
### 📊 Mermaid 图表主题
AI 可自动识别文档中的 Mermaid 语法并转换为专业图片:
| 主题 | 名称 | 主色调 | 推荐场景 |
|------|------|--------|---------|
| `professional` | 专业蓝 | 蓝色 #4a90d9 | 技术文档、API 文档 |
| `fresh` | 清新绿 | 绿色 #52c41a | 流程图、状态图 |
| `business` | 商务灰 | 灰色 #595959 | 正式报告、提案 |
| `tech` | 科技紫 | 紫色 #722ed1 | 产品文档、架构图 |
| `warm` | 暖橙色 | 橙色 #fa8c16 | 产品方案、营销文档 |
| `default` | 默认 | Mermaid 默认 | 通用场景 |
**支持的 Mermaid 图表类型**:
- `flowchart` - 流程图
- `sequenceDiagram` - 时序图
- `stateDiagram` - 状态图
- `classDiagram` - 类图
- `erDiagram` - ER 图
- `gantt` - 甘特图
- `pie` - 饼图
### 🛠️ 可用工具
#### Word 文档工具
| 工具名 | 描述 | 关键参数 |
|--------|------|---------|
| `word_create` | 创建 Word 文档 | `theme`: 主题名称 |
| `word_add_heading` | 添加标题 | `level`: 1-3, `text`: 标题文本 |
| `word_add_paragraph` | 添加段落 | `text`: 段落内容 |
| `word_add_table` | 添加表格 | `headers`, `rows`: 表格数据 |
| `word_add_list` | 添加列表 | `items`, `ordered`: 有序/无序 |
| `word_add_code` | 添加代码块 | `code`, `language`: 语言类型 |
| `word_add_diagram` | 添加 Mermaid 图表 | `mermaid`, `theme`, `width` |
| `word_save` | 保存文档 | `path`: 保存路径 |
#### Excel 表格工具
| 工具名 | 描述 | 关键参数 |
|--------|------|---------|
| `excel_create` | 创建工作簿 | `theme`: 主题名称 |
| `excel_add_sheet` | 添加工作表 | `name`: 表名 |
| `excel_write_data` | 写入数据 | `data`: 二维数组 |
| `excel_add_chart` | 写入图表数据 | `chartType`, `categories`, `series` |
| `excel_add_formula` | 添加公式 | `cell`, `formula` |
| `excel_save` | 保存工作簿 | `path`: 保存路径 |
### 💡 使用示例
#### 示例 1:生成软件需求文档
```
帮我生成一份用户管理模块的需求规格说明书,使用软件文档主题。包含:
1. 功能概述
2. 用户角色和权限表格
3. 用例流程图(使用 Mermaid)
4. 接口定义
```
#### 示例 2:生成产品分析报告
```
帮我写一份 AI 智能音箱的产品方案分析,使用字节风格。需要包含:
- 产品架构图
- 技术选型对比表
- 成本估算
```
---
## 🔧 Development | 开发
```bash
# Clone | 克隆
git clone https://github.com/jiahuidegit/office-mcp-server.git
cd office-mcp-server
# Install | 安装依赖
npm install
# Dev mode | 开发模式
npm run dev
# Build | 构建
npm run build
# Test | 测试
npm test
```
---
## 📄 License
MIT © [Erliban](https://github.com/erliban)
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
Python tool for converting files and office documents to Markdown.
awesome-claude-skills
A curated list of awesome Claude Skills, resources, and tools for...
antigravity-awesome-skills
The Ultimate Collection of 130+ Agentic Skills for Claude...
openfang
Open-source Agent Operating System
memU
MemU is a memory framework for LLM and AI agents, organizing multimodal...