agentailor avatar

Slimcontext Mcp Server

agentailor/slimcontext-mcp-server

Wraps the SlimContext library to compress chat histories when they approach token limits. You get two tools: trim_messages removes the oldest messages while preserving system prompts and recent context, while summarize_messages uses OpenAI's API to condense the middle of conversations into concise summaries. Both let you configure token thresholds, how many recent messages to preserve, and when compression kicks in. The trimming strategy is fast and deterministic, good for quick cleanup. The summarization route costs API calls but maintains semantic context better for long conversations. Useful when you're building chatbots or agents that need to stay under model context windows without losing conversational thread.

GitHub stars
5
tools
2
transport
STDIO
last updated
Sep 16, 2025

Tools

2 tools

Public tool metadata for what this MCP can expose to an agent.

trim_messagesCompresses chat history using token-based trimming strategy.

Compresses chat history using token-based trimming strategy.

No parameter schema in public metadata yet.

summarize_messagesCompresses chat history using AI-powered summarization strategy.

Compresses chat history using AI-powered summarization strategy.

No parameter schema in public metadata yet.

Sponsors

Readme

SlimContext MCP Server

A Model Context Protocol (MCP) server that wraps the SlimContext library, providing AI chat history compression tools for MCP-compatible clients.

Overview

SlimContext MCP Server exposes two powerful compression strategies as MCP tools:

  1. trim_messages - Token-based compression that removes oldest messages when exceeding token thresholds
  2. summarize_messages - AI-powered compression using OpenAI to create concise summaries

Installation

npm install -g slimcontext-mcp-server
# or
pnpm add -g slimcontext-mcp-server

Development

# Clone and setup
git clone <repository>
cd slimcontext-mcp-server
pnpm install

# Build
pnpm build

# Run in development
pnpm dev

# Type checking
pnpm typecheck

Configuration

MCP Client Setup

Add to your MCP client configuration:

{
  "mcpServers": {
    "slimcontext": {
      "command": "npx",
      "args": ["-y", "slimcontext-mcp-server"]
    }
  }
}

Environment Variables

  • OPENAI_API_KEY: OpenAI API key for summarization (optional, can be passed as tool parameter)

Tools

trim_messages


View the full README on GitHub

Details

Repository
github.com/agentailor/slimcontext-mcp-server
Category
Communication & Messaging
Package
slimcontext-mcp-server
Transport
STDIO
Registry
MCP registry, active

Related Communication & Messaging MCP servers

View all
1lassare-hq avatarLassarelassare-hq/agent-configsHuman-in-the-loop for AI coding agents — ask questions, get approvals via Slack.0stars
2nhype avatarOWA Exchange MCP Servernhype/owa-exchange-mcpMCP server for Microsoft Exchange / OWA — email, calendar, directory, availability5stars
3piiiico avatarAgentLairpiiiico/agentlairGive AI agents a real email address, vault, calendar, and task delegation via MCP.5stars
4malamutemayhem avatarFantasy Premier League MCP by UnClickmalamutemayhem/unclickFantasy Premier League teams, fixtures, players, standings, and league data. By UnClick.4stars
5malamutemayhem avatarUnClickmalamutemayhem/unclick-agent-native-endpointsAI agent tool marketplace. 60+ tools for social, e-commerce, accounting, and messaging.0stars
6agent-blueprint avatarAgent Blueprintagent-blueprint/mcp-serverClient teams' blueprints for coding agents (token from an engagement). Free: agentblueprint.ai/mcp0stars