Mcp Summarizer Server
用于AI摘要的MCP Server,支持多种内容类型: - 纯文本 - 网页 - PDF文档 - EPUB书籍 - HTML内容
概述
MCP Server 是一款强大的 AI 摘要工具,支持多种内容类型处理:
- 纯文本
- 网页
- PDF 文档
- EPUB 书籍
- HTML 内容
基本使用步骤
-
安装
npm install mcp-server # 或 yarn add mcp-server
-
初始化服务
const MCPServer = require('mcp-server'); const server = new MCPServer({ apiKey: 'YOUR_API_KEY' });
-
处理内容
// 示例:处理网页 const summary = await server.summarize({ url: 'https://example.com', type: 'webpage' }); // 示例:处理PDF const pdfSummary = await server.summarize({ file: '/path/to/document.pdf', type: 'pdf' });
-
查看结果
console.log(summary.result);
支持的内容类型
类型 | 参数 | 示例 |
---|---|---|
纯文本 | text | {text: '要摘要的内容', type: 'text'} |
网页 | url | {url: 'https://example.com', type: 'webpage'} |
file | {file: '/path/to/file.pdf', type: 'pdf'} | |
EPUB | file | {file: '/path/to/book.epub', type: 'epub'} |
HTML | html | {html: '<p>HTML内容</p>', type: 'html'} |
高级配置
const server = new MCPServer({
apiKey: 'YOUR_API_KEY',
language: 'zh-CN', // 设置输出语言
maxLength: 500, // 摘要最大长度
detailed: true // 生成详细摘要
});
如需更多帮助,请参阅完整文档或联系技术支持。