word-generator-mcp
v1.0.0
Published
MCP server:根据 report_data 生成 Word 报告/简报,保存到当前工作目录(项目根)
Maintainers
Readme
word-generator-mcp
Word文档生成 MCP Server,实现以下目标:
- 读取并理解skills的规范
- 根据规范生成对应的Node.js脚本(不保存到本地)
- 执行Node.js脚本,生成对应的Word文档
功能
工具列表
| 工具名称 | 功能描述 |
|---------|---------|
| list_skills | 列出所有可用的skills(读取.kilocode/skills目录) |
| read_skill | 读取指定skill的SKILL.md文件内容 |
| generate_word_script | 根据skill规范生成Node.js Word生成脚本(返回脚本内容,不保存) |
| generate_word_document | 根据skill规范和报告数据直接生成Word文档 |
Word格式规范
根据 .kilocode/skills/word-format-common/SKILL.md 规范:
- 标题颜色:全部黑色(RGB 0,0,0)
- 标题字体:全部黑体(Heiti/SimHei)
- 主标题:居中,黑体,22pt
- 一级标题:黑体,18pt
- 二/三级标题:黑体,16pt
- 正文字体:仿宋
- 首行缩进:2字符
- 观点标红:框架建议与观点性内容使用红色加粗
安装
cd scripts/word-generator-mcp
npm install在MCP客户端中配置
方式一:npx(推荐)
{
"word-generator": {
"command": "npx",
"args": ["-y", "file:./scripts/word-generator-mcp"],
"alwaysAllow": ["*"]
}
}方式二:本地安装后直接运行
{
"word-generator": {
"command": "node",
"args": ["scripts/word-generator-mcp/server.js"],
"alwaysAllow": ["*"]
}
}使用示例
1. 列出所有skills
{
"name": "list_skills",
"arguments": {}
}2. 读取指定skill
{
"name": "read_skill",
"arguments": {
"skill_name": "word-format-common"
}
}3. 生成Word文档
{
"name": "generate_word_document",
"arguments": {
"skill_name": "sentiment-writer",
"report_data": {
"title": "舆情分析报告",
"opening": "本报告旨在分析...",
"sections": [
{
"heading": "一、事件概述",
"subsections": [
{
"heading": "(一)背景",
"paragraphs": [
{ "text": "这是正文内容..." },
{ "text": "这是观点性内容(红色加粗)", "isViewPoint": true }
]
}
]
}
],
"references": [
"【1】来源链接..."
]
}
}
}报告数据结构
interface ReportData {
title: string; // 报告标题
opening?: string; // 开篇段落
sections: Section[]; // 各节内容
references?: string[]; // 参考文献
}
interface Section {
heading: string; // 一级标题(如:一、事件概述)
subsections?: Subsection[]; // 二级内容
paragraphs?: Paragraph[]; // 直接段落
}
interface Subsection {
heading: string; // 二级标题(如:(一)背景)
paragraphs: Paragraph[]; // 段落列表
}
interface Paragraph {
text: string; // 段落文本
isViewPoint?: boolean; // 是否为观点性内容(红色加粗)
}输出
- 生成的Word文档保存在
word/目录 - 文件名格式:
{标题}_{时间戳}.docx
要求
- Node.js >= 18
License
MIT
