Token导航 LogoToken导航TokenDH.com
MCP Summarization Functions logo
开发工具stdio官方级别未说明来源级核验

MCP Summarization Functions

MCP Server

@smithery/cli

Provides summarised output from various actions that could otherwise eat up tokens and cause crashes for AI agents

工具数

0

提示词数

0

GitHub Stars

37

资源数

0
TypeScriptCline开发工具ClineClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Braffolk

提供方

Braffolk

最后核验

2026/5/18 02:16

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -y @smithery/cli install mcp-summarization-functions --client claude

详细介绍

摘要功能

模型上下文协议的智能文本摘要

特性AI代理集成安装用法

](https://smithery.ai/server/mcp-summarization-functions) ](https://www.npmjs.com/package/mcp-summarization-functions)

______________________________________________________________________

概述

一个强大的MCP服务器,通过干净、可扩展的架构提供智能摘要功能。采用现代TypeScript构建,旨在与AI工作流程无缝集成。

安装

通过Smithery安装

通过以下方式自动安装Claude Desktop的摘要功能 史密瑟里:

npx -y @smithery/cli install mcp-summarization-functions --client claude
npm i mcp-summarization-functions

AI代理集成

这个MCP服务器主要是为了提高Roo-Cline和Cline等AI代理的性能和可靠性而开发的。它解决了人工智能代理操作中的一个关键挑战:上下文窗口管理。

上下文窗口优化

AI代理经常遇到这样的情况,即他们的上下文窗口很快就会被来自以下方面的大量输出填满:

  • 命令执行结果
  • 文件内容读数
  • 目录列表
  • API响应
  • 错误消息和堆栈跟踪

此服务器通过以下方式帮助保持高效的上下文使用:

  1. 提供简洁、相关的摘要,而不是完整的内容
  2. 存储完整内容以供需要时参考
  3. 根据具体需求(安全、API表面等)提供重点分析
  4. 支持多种输出格式,以实现最佳的上下文利用率

AI代理的好处

  • 降低故障率:通过防止上下文窗口溢出
  • 提高响应质量:通过重点突出、相关的总结
  • 提高效率:在减少噪音的同时保持重要的上下文
  • 更好的资源管理:通过智能内容缓存和检索
  • 柔性集成:支持多个AI提供商和配置选项

推荐AI代理提示

在与AI代理集成时,请在代理的说明中包含以下内容:

# CONTEXT MANAGEMENT

You have access to summarization functions through the MCP server. These functions are NOT optional - you MUST use them for ALL potentially large outputs to prevent context overflow:

MANDATORY SUMMARIZATION:
- You MUST ALWAYS use summarization functions for:
    - ANY first time file reading operations (unless you are CERTAIN its small and you are going to edit it)
    - ALL command execution outputs
    - EVERY directory analysis
    - ANY API responses or error logs
    - ANY output that could be large

NEVER attempt to process raw output directly - ALWAYS use the appropriate summarization function:
• For commands: summarize_command
• For files: summarize_files
• For directories: summarize_directory
• For other text: summarize_text

ALWAYS utilize available features:
• Specify hints for focused analysis
• Choose appropriate output formats
• Use content IDs to access full details only when absolutely necessary

There is NO NEED to process perfect or complete output. Summarized content is ALWAYS preferred over raw data. When in doubt, use summarization.

Ollama存储库上的行动摘要(Gemini 2.0 Flash摘要,Claude 3.5代理)

alt text

特性

  • 命令输出摘要\

执行命令并获得其输出的简明摘要

  • 文件内容分析\

在保持技术准确性的同时汇总单个或多个文件

  • 目录结构理解\

清晰地了解复杂的目录结构

  • 灵活的模型支持

使用来自不同提供商的模型

  • AI代理上下文优化

通过智能摘要防止上下文窗口溢出,提高AI代理性能

配置

服务器通过环境变量支持多个AI提供者:

所需的环境变量

  • PROVIDER:要使用的AI提供商。支持的值:

\- ANTHROPIC -来自Anthropic的克劳德模型 \- OPENAI -OpenAI的GPT模型 \- OPENAI-COMPATIBLE -OpenAI兼容的API(例如Azure) \- GOOGLE -谷歌的Gemini模型

  • API_KEY:所选提供程序的API密钥

可选环境变量

  • MODEL_ID:要使用的特定模型(默认为提供商的标准模型)
  • PROVIDER_BASE_URL:OpenAI兼容提供程序的自定义API终结点
  • MAX_TOKENS:模型响应的最大令牌数(默认值:1024)
  • SUMMARIZATION_CHAR_THRESHOLD:汇总时的字符数阈值(默认值:512)
  • SUMMARIZATION_CACHE_MAX_AGE:缓存持续时间(毫秒)(默认值:3600000-1小时)
  • MCP_WORKING_DIR -用于尝试查找具有相对路径的文件的回退目录

示例配置

# Anthropic Configuration
PROVIDER=ANTHROPIC
API_KEY=your-anthropic-key
MODEL_ID=claude-3-5-sonnet-20241022

# OpenAI Configuration
PROVIDER=OPENAI
API_KEY=your-openai-key
MODEL_ID=gpt-4-turbo-preview

# Azure OpenAI Configuration
PROVIDER=OPENAI-COMPATIBLE
API_KEY=your-azure-key
PROVIDER_BASE_URL=https://your-resource.openai.azure.com
MODEL_ID=your-deployment-name

# Google Configuration
PROVIDER=GOOGLE
API_KEY=your-google-key
MODEL_ID=gemini-2.0-flash-exp

用法

将服务器添加到MCP配置文件中:

{
		"mcpServers": {
				"MUST_USE_summarization": {
						"command": "node",
						"args": ["path/to/summarization-functions/build/index.js"],
						"env": {
								"PROVIDER": "ANTHROPIC",
								"API_KEY": "your-api-key",
								"MODEL_ID": "claude-3-5-sonnet-20241022",
                "MCP_WORKING_DIR": "default_working_directory"
						}
				}
		}
}

可用功能

服务器提供以下摘要工具:

summarize_command

执行并总结命令输出。

{
  // Required
  command: string,    // Command to execute
  cwd: string,       // Working directory for command execution
  
  // Optional
  hint?: string,      // Focus area: "security_analysis" | "api_surface" | "error_handling" | "dependencies" | "type_definitions"
  output_format?: string  // Format: "text" | "json" | "markdown" | "outline" (default: "text")
}

summarize_files

总结文件内容。

{
  // Required
  paths: string[],    // Array of file paths to summarize (relative to cwd)
  cwd: string,       // Working directory for resolving file paths
  
  // Optional
  hint?: string,      // Focus area: "security_analysis" | "api_surface" | "error_handling" | "dependencies" | "type_definitions"
  output_format?: string  // Format: "text" | "json" | "markdown" | "outline" (default: "text")
}

summarize_directory

获取目录结构概述。

{
  // Required
  path: string,       // Directory path to summarize (relative to cwd)
  cwd: string,       // Working directory for resolving directory path
  
  // Optional
  recursive?: boolean,  // Whether to include subdirectories. Safe for deep directories
  hint?: string,       // Focus area: "security_analysis" | "api_surface" | "error_handling" | "dependencies" | "type_definitions"
  output_format?: string   // Format: "text" | "json" | "markdown" | "outline" (default: "text")
}

summarize_text

总结任意文本内容。

{
  // Required
  content: string,    // Text content to summarize
  type: string,       // Type of content (e.g., "log output", "API response")
  
  // Optional
  hint?: string,      // Focus area: "security_analysis" | "api_surface" | "error_handling" | "dependencies" | "type_definitions"
  output_format?: string  // Format: "text" | "json" | "markdown" | "outline" (default: "text")
}

get_full_content

检索给定摘要ID的完整内容。

{
  // Required
  id: string         // ID of the stored content
}

运行评估

evals包加载一个mcp客户端,然后运行index.ts文件,因此不需要在测试之间重建。您可以通过在npx命令前加前缀来加载环境变量。可以找到完整的文档 这里.

OPENAI_API_KEY=your-key  npx mcp-eval src/evals/evals.ts src/server/mcp-server.ts

许可证

麻省理工学院

目录标签

目录标签

TypeScriptCline开发工具developer-toolsmcpmodel-context-protocolmcp-server文本摘要本地部署AI代理集成上下文优化命令输出处理文件内容分析

支持客户端

ClineClaude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

remote-capable

来源包(packageName,安装包名)

@smithery/cli

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP