关于 pdf-report-generator
pdf-report-generator 是一个 MCP 服务,可将结构化规范或原始文本转换为企业风格的 PDF 报告,适用于整理研究、分析或会议记录,并支持报告章节、表格、图表和主题。
主要功能
- 01根据结构化规范生成 PDF
- 02从文本识别标题并转换
- 03添加封面和目录
- 04插入表格与图表
- 05选择五种配色主题
适用场景
- 01将研究整理为企业报告
- 02把会议记录转换为 PDF
- 03制作含指标图表的报告
- 04查看可用报告主题
MCP 相关
该 MCP 服务提供工具,可从结构化规范或文本生成报告,并列出可用主题。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
3收录的工具列表 · 更新于 2 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| spec | object | 是 | |
| spec.theme | object | 否 | |
| spec.theme.accent_color | array | 否 | |
| spec.theme.primary_color | array | 否 | |
| spec.theme.highlight_color | array | 否 | |
| spec.charts | array | 否 | |
| spec.images | array | 否 | |
| spec.tables | array | 否 | |
| spec.metadata | object | 是 | |
| spec.metadata.date | string | 否 | |
| spec.metadata.title | string | 是 | |
| spec.metadata.author | string | 否 | |
| spec.metadata.company | string | 否 | |
| spec.metadata.subtitle | string | 否 | |
| spec.metadata.logo_path | string | 否 | |
| spec.metadata.page_size | enum | 否 | letter | a4 |
| spec.metadata.department | string | 否 | |
| spec.metadata.document_id | string | 否 | |
| spec.metadata.orientation | enum | 否 | portrait | landscape |
| spec.metadata.classification | string | 否 | |
| spec.sections | array | 是 | |
| spec.executive_summary | string | 否 |
详细介绍
pdf-report-generator
一个 MCP 服务,可根据结构化 JSON 规范或 LLM 原始文本输出生成专业的企业 PDF 报告。将它添加到 Claude Desktop(或任何 MCP 客户端),然后让 Claude 将分析、研究或会议记录整理成精美的多页报告,包含封面、目录、执行摘要、章节标题、表格和图表。
示例输出见 examples/sample_report.pdf。
前置条件
- Node.js 18+
- Python 3.8+
安装 Python 依赖:
pip install reportlab matplotlib
Claude Desktop 配置
添加到 claude_desktop_config.json:
{
"mcpServers": {
"pdf-report": {
"command": "npx",
"args": ["-y", "pdf-report-generator"]
}
}
}
可用工具
generate_report
根据完整的结构化规范生成 PDF。
最简示例输入:
{
"spec": {
"metadata": {
"title": "Q3 Performance Review",
"author": "Engineering Team",
"company": "Acme Corp",
"classification": "INTERNAL"
},
"executive_summary": "Overall performance improved this quarter...",
"sections": [
{
"heading": "Infrastructure",
"body": "Uptime reached 99.94%...",
"subsections": []
}
],
"tables": [],
"charts": []
}
}
generate_report_from_text
将原始文本转换为结构化 PDF 报告。系统会根据标题自动检测章节。
{
"text": "# Overview\nThis quarter...\n\n# Key Findings\n...",
"title": "Q3 Summary",
"author": "Data Team",
"company": "Acme Corp",
"classification": "INTERNAL",
"theme_name": "navy"
}
list_themes
返回可用的配色主题:default、navy、charcoal、forest、burgundy。
JSON 规范参考
metadata
title* string
subtitle string
author string
date string (YYYY-MM-DD; defaults to today)
company string
department string
document_id string (e.g. RPT-2026-001)
classification string (PUBLIC | INTERNAL | CONFIDENTIAL)
logo_path string (absolute path to PNG/JPG)
page_size "letter" | "a4"
executive_summary string
sections[]
heading* string
body* string (\n\n = paragraph break)
subsections[]
heading* string
body* string
tables[]
title string
headers* string[]
rows* string[][]
after_section int (0-based section index; -1 = after exec summary)
charts[]
title string
type "bar" | "line" | "pie" | "horizontal_bar"
labels* string[]
datasets* [{label, values[]}]
after_section int
images[]
path* string (absolute path)
caption string
width_inches number
after_section int
theme
primary_color [R, G, B]
accent_color [R, G, B]
highlight_color [R, G, B]
示例提示词
- “将这份分析整理成一份专业的内部 PDF 报告,标题为‘Q3 Infrastructure Review’”
- “根据这项研究生成一份企业报告,并为月度指标添加柱状图”
- “根据这段文本创建一份名为‘Security Audit Findings’的机密报告”
- “列出可用的报告主题”
故障排除
未找到 Python — 确保 python 或 python3 位于 PATH 中,且版本为 3.8+。
未安装 reportlab — 运行 pip install reportlab matplotlib。
缺少图表 — 图表需要 matplotlib。使用 pip install matplotlib 安装。
PDF 文件较大 — 包含许多图表的复杂规范可能需要 5–15 秒。这是正常现象。
许可证
MIT
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。