使用说明
报表生成器MCP服务器
MCP(模型上下文协议)服务器,用于将AI代理输出格式化为专业报告、电子邮件和文档。为人工智能操作平台而构建。
🎯 目的
此MCP服务器可帮助您:
- ✅ 将代理输出格式化为电子邮件就绪模板
- ✅ 创建具有品牌的专业HTML报告
- ✅ 从长篇内容生成执行摘要
- ✅ 验证输出质量(检测通用AI语言)
- ✅ 将客户特定的品牌应用于输出
🚀 快速开始
选项1:与Replit一起使用(建议用于测试)
-
将此分叉为回复:
- 首选 Replit.com
- 点击“创建报告”→ 从GitHub导入
- 或者创建一个新的Node.js repl并复制这些文件
-
安装依赖项:
npm install -
测试服务器:
npm test -
运行HTTP API(用于平台集成):
npm install express node http-server.js
选项2:部署到铁路/渲染
- 推送到GitHub
- 连接到Railway.app或Render.com
- 设置构建命令:
npm install - 设置启动命令:
node http-server.js - 部署!
选项3:与Claude Desktop一起使用
-
本地安装:
git clone <your-repo> cd report-builder-mcp npm install -
添加到Claude桌面配置:
雨衣:
~/Library/Application Support/Claude/claude_desktop_config.json窗户:
%APPDATA%/Claude/claude_desktop_config.json{ "mcpServers": { "report-builder": { "command": "node", "args": ["/absolute/path/to/report-builder-mcp/server.js"] } } } -
重新启动克劳德桌面
🛠️ 可用工具
1.创建邮件模板
将代理输出转换为电子邮件就绪格式。
输入:
{
"content": "Q4 revenue exceeded expectations by 15%...",
"recipient_name": "John Smith",
"subject": "Q4 Performance Report",
"sender_name": "Audrey - Financial Analyst",
"branding": "TechCorp Analytics",
"include_disclaimer": true
}
2.format_report_html
创建具有部分和样式的专业HTML报告。
输入:
{
"title": "Quarterly Analysis Report",
"content": "Main report content...",
"sections": [
{
"title": "Executive Summary",
"content": "Key findings..."
}
],
"summary": "Brief overview...",
"branding": "Company Name"
}
3.验证输出质量
检查代理输出的通用AI语言和专门化。
输入:
{
"content": "Your agent's output here...",
"expected_role": "legal assistant",
"check_tone": true
}
输出:
{
"quality_score": 85,
"status": "GOOD",
"issues": [],
"suggestions": [],
"content_length": 245
}
4.创建执行摘要
将长篇内容浓缩成要点。
输入:
{
"full_content": "Long detailed content...",
"max_points": 5,
"include_recommendations": true
}
5.添加品牌
将客户特定的品牌应用于内容。
输入:
{
"content": "Your content here...",
"client_id": "client-123",
"brand_elements": {
"primary_color": "#0066cc",
"company_name": "TechCorp",
"tagline": "Excellence in AI"
}
}
🌐 HTTP API使用情况
如果您正在运行HTTP服务器(node http-server.js),您可以通过REST API调用工具:
健康检查
curl http://localhost:3000/health
列出工具
curl http://localhost:3000/tools
格式化电子邮件(便利端点)
curl -X POST http://localhost:3000/format-email \
-H "Content-Type: application/json" \
-d '{
"content": "Q4 revenue exceeded expectations...",
"recipient": "John Smith",
"subject": "Q4 Report",
"sender": "Audrey"
}'
检查质量(便利性端点)
curl -X POST http://localhost:3000/check-quality \
-H "Content-Type: application/json" \
-d '{
"content": "As an AI, I cannot provide legal advice...",
"role": "legal assistant"
}'
执行任何工具
curl -X POST http://localhost:3000/tools/create_executive_summary \
-H "Content-Type: application/json" \
-d '{
"full_content": "Your long content here...",
"max_points": 5
}'
🔗 与您的平台集成
N8N工作流集成
创建N8N工作流:
- Webhook触发器 -从您的AI代理接收数据
- HTTP请求节点 -调用此MCP API
- 方法:POST
- 网址:
https://your-deployed-mcp.com/tools/create_email_template - 正文:代理输出数据
- 过程响应 -格式化结果
- 返回平台 -将格式化的输出发送回
N8N HTTP请求示例:
{
"method": "POST",
"url": "{{ $env.MCP_API_URL }}/format-email",
"body": {
"content": "{{ $json.agent_output }}",
"recipient": "{{ $json.recipient_name }}",
"subject": "{{ $json.subject }}",
"sender": "{{ $json.agent_name }}"
}
}
直接平台集成
如果您的平台支持HTTP调用:
// In your platform's agent workflow
const response = await fetch('https://your-mcp-api.com/format-email', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
content: agentOutput,
recipient: customerName,
subject: reportTitle,
sender: agentName
})
});
const { email } = await response.json();
// Use formatted email
📝 已解决的行动项目
此MCP有助于您的会议行动项目:
✅ 员工响应定制 -使用 validate_output_quality 测试奥黛丽的反应是否专业
✅ 报告生成工作流 -使用 create_email_template 和 format_report_html 为客户格式化输出
✅ MCP集成 -整个服务器演示了您平台的MCP集成
🧪 测试
运行测试套件:
npm test
这将使用示例数据测试所有5个工具。
📦 程序包更新
更新依赖关系:
npm install @modelcontextprotocol/sdk@latest
为HTTP API添加Express:
npm install express
🐛 故障排除
MCP未出现在Claude Desktop中?
- 检查配置中的路径是否为绝对路径
- 完全重新启动克劳德桌面
- 检查server.js是否具有执行权限:
chmod +x server.js
HTTP API不工作?
- 确保已安装Express:
npm install express - 检查端口是否可用(默认值:3000)
- 在控制台中查找错误消息
工具返回错误?
- 检查输入是否与预期架构匹配
- 使用测试脚本验证:
npm test - 检查服务器日志中的特定错误消息
🚀 后续步骤
- 本地测试 -快跑
npm test看到它工作 - 部署到铁路 -获取平台集成的公共URL
- 创建N8N工作流 -连接到您的AI操作平台
- 构建更多工具 -根据您的特定需求添加自定义工具
📖 额外资源
👤 作者
Nathan为人工智能运营平台与Chris、David和Charlie Butler合作打造。
📄 许可证
麻省理工学院