Mcp Summarizer Server

Mcp Summarizer Server

用于AI摘要的MCP Server,支持多种内容类型: - 纯文本 - 网页 - PDF文档 - EPUB书籍 - HTML内容

概述

MCP Server 是一款强大的 AI 摘要工具,支持多种内容类型处理:

  • 纯文本
  • 网页
  • PDF 文档
  • EPUB 书籍
  • HTML 内容

基本使用步骤

  1. 安装

    npm install mcp-server
    # 或
    yarn add mcp-server
    
  2. 初始化服务

    const MCPServer = require('mcp-server');
    const server = new MCPServer({
      apiKey: 'YOUR_API_KEY'
    });
    
  3. 处理内容

    // 示例:处理网页
    const summary = await server.summarize({
      url: 'https://example.com',
      type: 'webpage'
    });
    
    // 示例:处理PDF
    const pdfSummary = await server.summarize({
      file: '/path/to/document.pdf',
      type: 'pdf'
    });
    
  4. 查看结果

    console.log(summary.result);
    

支持的内容类型

类型参数示例
纯文本text{text: '要摘要的内容', type: 'text'}
网页url{url: 'https://example.com', type: 'webpage'}
PDFfile{file: '/path/to/file.pdf', type: 'pdf'}
EPUBfile{file: '/path/to/book.epub', type: 'epub'}
HTMLhtml{html: '<p>HTML内容</p>', type: 'html'}

高级配置

const server = new MCPServer({
  apiKey: 'YOUR_API_KEY',
  language: 'zh-CN',  // 设置输出语言
  maxLength: 500,     // 摘要最大长度
  detailed: true      // 生成详细摘要
});

如需更多帮助,请参阅完整文档或联系技术支持。