- Home
- MCP servers
- SlimContext
SlimContext
- typescript
4
GitHub Stars
typescript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"agentailor-slimcontext-mcp-server": {
"command": "npx",
"args": [
"-y",
"slimcontext-mcp-server"
],
"env": {
"OPENAI_API_KEY": "<OPENAI_API_KEY>"
}
}
}
}SlimContext MCP Server provides two compact, configurable chat history compression tools for MCP-compatible clients. It wraps the SlimContext library to help you trim or summarize conversations, reducing token usage while preserving essential context for ongoing dialogs.
How to use
You run the SlimContext MCP Server locally or in your environment and connect your MCP client to it. You can choose between two compression strategies depending on your needs: trim_messages, which removes the oldest non-system messages when the token limit is reached, and summarize_messages, which uses AI to generate concise summaries that preserve important context.
Configure your MCP client to point at the SlimContext MCP Server using the provided MCP command. This enables you to invoke the two tools from within your chat sessions. When a conversation reaches the configured token threshold, you can trigger the chosen compression method to reduce history while keeping essential context intact.
{
"mcpServers": {
"slimcontext": {
"command": "npx",
"args": ["-y", "slimcontext-mcp-server"]
}
}
}
How to run tools in practice
You can apply trim_messages to remove older messages when the conversation grows too long, while keeping system messages and the most recent exchanges. This helps maintain responsiveness and reduces token consumption without losing core context.
If you need deeper context preservation, use summarize_messages to create a compact summary of the middle portion of the chat, while still preserving the most recent messages and system instructions. This approach relies on OpenAI to generate context-rich summaries.
Available tools
trim_messages
Compresses chat history by removing oldest non-system messages when token thresholds are exceeded, preserving system messages and the most recent exchanges.
summarize_messages
AI-powered compression that generates concise summaries of the middle portion of a conversation, preserving system messages and recent context.