Back to MCP directory
publicPublicdnsLocal runtime

mcp-summarizer

基于Google Gemini 1.5 Pro模型的内容智能摘要服务

article

README

🚀 MCP 内容摘要服务器

MCP 内容摘要服务器借助 Google 的 Gemini 1.5 Pro 模型,基于模型上下文协议(MCP),为您提供智能内容摘要服务。它能够生成简洁的摘要,同时精准保留各类格式内容的关键信息。

🚀 快速开始

克隆仓库

首先,您需要将此仓库克隆到本地:

git clone <仓库地址>

安装依赖

使用以下命令安装项目所需的依赖:

pnpm install

构建项目

安装完依赖后,构建项目:

pnpm run build

启动服务器

最后,启动服务器:

pnpm start

✨ 主要特性

  • 通用内容摘要:借助 Google 的 Gemini 1.5 Pro 模型,实现对各种内容的摘要处理。
  • 多类型内容支持:支持纯文本、网页页面、PDF 文档、EPUB 书籍、HTML 内容等多种内容类型。
  • 自定义摘要长度:您可以根据需求自定义摘要的长度。
  • 多语言支持:支持多种语言的摘要生成。
  • 智能上下文保留:在生成摘要时,智能保留内容的上下文信息。
  • 动态问候资源:提供动态问候资源,可用于测试。

📦 安装指南

克隆仓库

git clone <仓库地址>

安装依赖

pnpm install

构建项目

pnpm run build

启动服务器

pnpm start

💻 使用示例

基础用法

摘要一个网页页面

// 摘要一个网页页面
const result = await server.invoke("summarize", {
  content: "https://example.com/article",
  type: "url",
  maxLength: 300,
  style: "bullet-points"
});

摘要一个 PDF 文档

// 摘要一个 PDF 文档
const result = await server.invoke("summarize", {
  content: pdfBase64Content,
  type: "pdf",
  language: "zh",
  style: "detailed"
});

高级用法

与桌面应用程序集成

要将此服务器与桌面应用程序集成,请在应用程序的服务器配置中添加以下内容:

{
  "mcpServers": {
    "content-summarizer": {
      "command": "node",
      "args": [
        "{ABSOLUTE PATH TO FILE HERE}/dist/index.js"
      ]
    }
  }
}

可用工具

summarize

使用以下参数从各种来源摘要内容: | 参数 | 详情 | | ---- | ---- | | content (string | object) | 待摘要的输入内容。可以是文本字符串、网页 URL、Base64 编码的 PDF、EPUB 文件内容 | | type (string) | 内容类型 ("text", "url", "pdf", "epub") | | maxLength (number, optional) | 摘要的最大长度,以字符为单位(默认:200) | | language (string, optional) | 摘要的目标语言(默认:"en") | | focus (string, optional) | 摘要中需聚焦的特定方面 | | style (string, optional) | 摘要风格 ("简洁", "详细", "要点") |

greeting

一个动态资源,演示基本的 MCP 资源功能:

  • URI 格式:greeting://{name}
  • 返回带有所提供名称的问候消息

🔧 技术细节

本服务器基于 Google 的 Gemini 1.5 Pro 模型,通过模型上下文协议(MCP)实现内容摘要功能。它使用 Node.js 和 TypeScript 进行开发,支持多种内容类型的摘要生成,并提供了可自定义的摘要长度、多语言支持和智能上下文保留等特性。

📄 许可证

此项目根据 MIT 许可证发布 - 有关详细信息,请参阅 LICENSE 文件。

🌟 支持信息

摘要服务由 3MinTop 提供支持,这是一个基于人工智能的阅读工具,能帮助您在三分钟内理解一章的内容。3MinTop 可将复杂的内容转化为清晰的摘要,使学习更高效,并有助于培养持久的阅读习惯。

👏 贡献说明

欢迎大家为项目贡献代码!请随时提交拉取请求。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client