Summarization

by braffolk

36 stars
1.4k downloads
Not rated
GitHub

About

Provides intelligent summarization capabilities through a clean, extensible architecture. Mainly built for solving AI agents issues on big repositories, where large files can eat up the context window.

Details

Author
braffolk
Repository
Braffolk/mcp-summarization-functions
GitHub stars
36
Downloads
1,372
License
MIT License
Categories
Design, Developer Tools, AI, Project Management, Knowledge Base, Frontend, Other, Productivity
Tags
#content-creation, #text-to-speech

- Command Output Summarization
Execute commands and get concise summaries of their output

- File Content Analysis
Summarize single or multiple files while maintaining technical accuracy

- Directory Structure Understanding
Get clear overviews of complex directory structures

- Flexible Model Support
Use models from different providers

- AI Agent Context Optimization
Prevent context window overflow and improve AI agent performance through intelligent summarization

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Summarization
    Command (node, npx, python, etc.) node
    Arguments
    • Argument 1 path/to/summarization-functions/build/index.js
    Environment
    • API_KEY your-api-key
    • MODEL_ID claude-3-5-sonnet-20241022
    • PROVIDER ANTHROPIC
    • MCP_WORKING_DIR default_working_directory

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Add the server to your MCP configuration file:

{
		"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"
						}
				}
		}
}

To install Summarization Functions for Claude Desktop automatically via Smithery:

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

- PROVIDER: AI provider to use. Supported values:
- ANTHROPIC - Claude models from Anthropic
- OPENAI - GPT models from OpenAI
- OPENAI-COMPATIBLE - OpenAI-compatible APIs (e.g. Azure)
- GOOGLE - Gemini models from Google
- API_KEY: API key for the selected provider

- MODEL_ID: Specific model to use (defaults to provider's standard model)
- PROVIDER_BASE_URL: Custom API endpoint for OpenAI-compatible providers
- MAX_TOKENS: Maximum tokens for model responses (default: 1024)
- SUMMARIZATION_CHAR_THRESHOLD: Character count threshold for when to summarize (default: 512)
- SUMMARIZATION_CACHE_MAX_AGE: Cache duration in milliseconds (default: 3600000 - 1 hour)
- MCP_WORKING_DIR - fallback directory for trying to find files with relative paths from


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

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

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

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

The evals package loads an mcp client that then runs the index.ts file, so there is no need to rebuild between tests. You can load environment variables by prefixing the npx command. Full documentation can be found here.

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

summarize_command

Execute and summarize command output. Parameters: command (string), cwd (string), hint (optional string), output_format (optional string)

summarize_files

Summarize file contents. Parameters: paths (array of strings), cwd (string), hint (optional string), output_format (optional string)

summarize_directory

Get directory structure overview. Parameters: path (string), cwd (string), recursive (optional boolean), hint (optional string), output_format (optional string)

summarize_text

Summarize arbitrary text content. Parameters: content (string), type (string), hint (optional string), output_format (optional string)

get_full_content

Retrieve the full content for a given summary ID. Parameters: id (string)

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

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

Linux

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

Macos

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

Windows

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

Summarization Functions

Intelligent text summarization for the Model Context Protocol

Features
AI Agent Integration
Installation
Usage

smithery badge
npm version

</div>

---

Overview

A powerful MCP server that provides intelligent summarization capabilities through a clean, extensible architecture. Built with modern TypeScript and designed for seamless integration with AI workflows.

Installation

Installing via Smithery

To install Summarization Functions for Claude Desktop automatically via Smithery:

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

AI Agent Integration

This MCP server was primarily developed to enhance the performance and reliability of AI agents like Roo Cline and Cline. It addresses a critical challenge in AI agent operations: context window management.

Context Window Optimization

AI agents frequently encounter situations where their context window gets rapidly filled with large outputs from:
- Command execution results
- File content readings
- Directory listings
- API responses
- Error messages and stack traces

This server helps maintain efficient context usage by:
1. Providing concise, relevant summaries instead of full content
2. Storing full content for reference when needed
3. Offering focused analysis based on specific needs (security, API surface, etc.)
4. Supporting multiple output formats for optimal context utilization

Benefits for AI Agents

- Reduced Failure Rates: By preventing context window overflow
- Improved Response Quality: Through focused, relevant summaries
- Enhanced Efficiency: By maintaining important context while reducing noise
- Better Resource Management: Through intelligent content caching and retrieval
- Flexible Integration: Supporting multiple AI providers and configuration options

Recommended AI Agent Prompt

When integrating with AI agents, include the following in your agent's instructions:

```

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.