MCP Server for SlimContext - AI chat history compression tools
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
A Model Context Protocol (MCP) server that wraps the SlimContext library, providing AI chat history compression tools for MCP-compatible clients.
SlimContext MCP Server exposes two powerful compression strategies as MCP tools:
trim_messages - Token-based compression that removes oldest messages when exceeding token thresholdssummarize_messages - AI-powered compression using OpenAI to create concise summariesAdd to your MCP client configuration:
OPENAI_API_KEY: OpenAI API key for summarization (optional, can be passed as tool parameter)Compresses chat history using token-based trimming strategy.
Parameters:
messages (required): Array of chat messagesmaxModelTokens (optional): Maximum model token context window (default: 8192)thresholdPercent (optional): Percentage threshold to trigger compression 0-1 (default: 0.7)minRecentMessages (optional): Minimum recent messages to preserve (default: 2)Example:
Response:
Compresses chat history using AI-powered summarization strategy.
Parameters:
messages (required): Array of chat messagesmaxModelTokens (optional): Maximum model token context window (default: 8192)thresholdPercent (optional): Percentage threshold to trigger compression 0-1 (default: 0.7)minRecentMessages (optional): Minimum recent messages to preserve (default: 4)openaiApiKey (optional): OpenAI API key (can also use OPENAI_API_KEY env var)openaiModel (optional): OpenAI model for summarization (default: 'gpt-4o-mini')customPrompt (optional): Custom summarization promptExample:
Response:
Both tools expect messages in SlimContext format:
All tools return structured error responses:
Common error scenarios:
SlimContext uses a simple heuristic for token estimation: Math.ceil(content.length / 4) + 2. This provides a reasonable approximation for most use cases. For more accurate token counting, you would need to implement a custom token estimator in your client application.
MIT
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/slimcontext-mcp-server)<a href="https://allmcps.com/mcp/slimcontext-mcp-server"><img src="https://allmcps.com/api/badge/slimcontext-mcp-server?style=directory" alt="Slimcontext Mcp Server on AllMCPs" /></a>