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.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Slimcontext MCP Server.
messagesCallable MCP tool function
maxModelTokensCallable MCP tool function
thresholdPercentCallable MCP tool function
minRecentMessagesCallable MCP tool function
openaiApiKeyCallable MCP tool function
openaiModelCallable MCP tool function
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
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
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>