Labsco
MCP SERVER

Summarization Functions

by Braffolk

Summarize command output, files and directories on the fly so an agent's context window does not overflow.

Codebase Context Packing & Compression
Summary
Built for the agent's context budget, not the human reader — it summarizes to keep a run alive.

The problem it targets is context overflow: a directory listing or a stack trace can fill the window and derail an agent. Here the agent gets a focused summary and a content ID, and only fetches the full text if it must. The hint parameter is the sharp tool — ask specifically for the security or API surface rather than a generic gist.

What it is

A server that summarizes large content — command results, files, directory listings, API responses — returning a concise version while storing the full text for reference.

What you get
  • summarize_command executes a command and summarizes its output
  • summarize_files condenses one or many files while keeping technical accuracy
  • summarize_directory turns a complex directory structure into a clear overview
  • summarize_text handles any other block of text
  • A hint parameter focuses the summary — for example on the security surface or the API surface
  • Content IDs let the agent pull the full detail only when it actually needs it
Requirements

A provider and its key — PROVIDER (ANTHROPIC, OPENAI, OPENAI-COMPATIBLE or GOOGLE) and API_KEY. Optional MODEL_ID, MAX_TOKENS (default 1024), SUMMARIZATION_CHAR_THRESHOLD (default 512) and PROVIDER_BASE_URL for OpenAI-compatible endpoints. Install with npm; the client launches build/index.js. Set MCP_WORKING_DIR so relative file paths resolve.

Setup effort

One command plus a key — npm i mcp-summarization-functions, then supply credentials