home / mcp / summarization mcp server

Summarization MCP Server

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

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "braffolk-mcp-summarization-functions": {
      "command": "node",
      "args": [
        "path/to/summarization-functions/build/index.js"
      ],
      "env": {
        "API_KEY": "YOUR_API_KEY",
        "MODEL_ID": "claude-3-5-sonnet-20241022",
        "PROVIDER": "ANTHROPIC",
        "MAX_TOKENS": "1024",
        "MCP_WORKING_DIR": "default_working_directory",
        "PROVIDER_BASE_URL": "https://api.openai.azure.com",
        "SUMMARIZATION_CACHE_MAX_AGE": "3600000",
        "SUMMARIZATION_CHAR_THRESHOLD": "512"
      }
    }
  }
}

You can run a dedicated MCP server that provides intelligent summarization for large outputs and content, helping AI agents manage context efficiently. This server exposes a set of summarization tools that you can invoke from your MCP client to reduce noise, cache full content for reference, and tailor results to focused analyses.

How to use

You integrate the summarization MCP server into your MCP workflow to process large outputs from files, commands, directories, APIs, and text. You configure a local (stdio) server that runs the summarization package and expose its capabilities to your MCP client. Use the server to automatically summarize content before it is fed into AI agents, and keep full content accessible for reference when needed.

How to install

Prerequisites: you need Node.js and npm installed on your system.

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

```
npm i mcp-summarization-functions

Configuration and usage notes

Add the server to your MCP configuration as a stdio MCP server. Specify the runtime command to start the package and pass the required environment variables to select your AI provider and model.

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

Available functions

The server provides the following summarization tools that you can call from your MCP client.

summarize_command — Execute a shell command and return a concise summary of its output.

summarize_files — Summarize the contents of one or more files.

summarize_directory — Produce a high-level overview of a directory structure.

summarize_text — Summarize arbitrary text content.

get_full_content — Retrieve the full content for a previously stored summary by its ID.

Internal prompts and prompts for integration

When integrating with AI agents, you can craft prompts that require mandatory summarization for large outputs, ensuring context stays within bounds. You can specify hints for focused analysis and choose output formats that suit the downstream consumer.

Available tools

summarize_command

Execute a shell command and produce a concise summary of the output.

summarize_files

Summarize the contents of one or more files with technical accuracy.

summarize_directory

Provide a high-level overview of a directory structure.

summarize_text

Summarize arbitrary text content with an optional focus hint.

get_full_content

Retrieve full content for a previously stored summary by ID.