CAT
/MCP
SkillsMCPMarketplacesDigestToolsAdvertise

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by Category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP Servers by Category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by Category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control

Cross AI Tools

Discover Claude Code plugins, extensions, and tools. Automatically updated directory of Anthropic Claude AI marketplaces with development tools, productivity plugins, and integrations.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Marketplaces
  • Plugins Reference

Community

  • About
  • Tools
  • Feedback
  • Privacy Policy
  • Advertise

Built for the Claude Code community with Claude Code by @mertduzgun

Independent project, not affiliated with Anthropic

Slimcontext Mcp Server

agentailor/slimcontext-mcp-server
5STDIOregistry active
Summary

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.

CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →

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

Compresses chat history using token-based trimming strategy.

Parameters:

  • messages (required): Array of chat messages
  • maxModelTokens (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:

{
  "messages": [
    { "role": "system", "content": "You are a helpful assistant." },
    { "role": "user", "content": "Hello!" },
    { "role": "assistant", "content": "Hi there! How can I help you today?" },
    { "role": "user", "content": "Tell me about AI." }
  ],
  "maxModelTokens": 4000,
  "thresholdPercent": 0.8,
  "minRecentMessages": 2
}

Response:

{
  "success": true,
  "original_message_count": 4,
  "compressed_message_count": 3,
  "messages_removed": 1,
  "compression_ratio": 0.75,
  "compressed_messages": [
    { "role": "system", "content": "You are a helpful assistant." },
    { "role": "assistant", "content": "Hi there! How can I help you today?" },
    { "role": "user", "content": "Tell me about AI." }
  ]
}

summarize_messages

Compresses chat history using AI-powered summarization strategy.

Parameters:

  • messages (required): Array of chat messages
  • maxModelTokens (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 prompt

Example:

{
  "messages": [
    { "role": "system", "content": "You are a helpful assistant." },
    { "role": "user", "content": "I want to build a web scraper." },
    {
      "role": "assistant",
      "content": "I can help you build a web scraper! What programming language would you prefer?"
    },
    { "role": "user", "content": "Python please." },
    {
      "role": "assistant",
      "content": "Great choice! For Python web scraping, I recommend using requests and BeautifulSoup..."
    },
    { "role": "user", "content": "Can you show me a simple example?" }
  ],
  "maxModelTokens": 4000,
  "thresholdPercent": 0.6,
  "minRecentMessages": 2,
  "openaiModel": "gpt-4o-mini"
}

Response:

{
  "success": true,
  "original_message_count": 6,
  "compressed_message_count": 4,
  "messages_removed": 2,
  "summary_generated": true,
  "compression_ratio": 0.67,
  "compressed_messages": [
    { "role": "system", "content": "You are a helpful assistant." },
    {
      "role": "system",
      "content": "The user expressed interest in building a web scraper and requested help with Python. The assistant recommended using requests and BeautifulSoup libraries for Python web scraping."
    },
    {
      "role": "assistant",
      "content": "Great choice! For Python web scraping, I recommend using requests and BeautifulSoup..."
    },
    { "role": "user", "content": "Can you show me a simple example?" }
  ]
}

Message Format

Both tools expect messages in SlimContext format:

interface SlimContextMessage {
  role: 'system' | 'user' | 'assistant' | 'tool' | 'human';
  content: string;
}

Error Handling

All tools return structured error responses:

{
  "success": false,
  "error": "Error message description",
  "error_type": "SlimContextError" | "OpenAIError" | "UnknownError"
}

Common error scenarios:

  • Missing OpenAI API key for summarization
  • Invalid message format
  • OpenAI API rate limits or errors
  • Invalid parameter values

Token Estimation

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.

Compression Strategies

Trimming Strategy

  • Preserves all system messages
  • Preserves the most recent N messages
  • Removes oldest non-system messages until under token threshold
  • Fast and deterministic
  • No external API dependencies

Summarization Strategy

  • Preserves all system messages
  • Preserves the most recent N messages
  • Summarizes middle portion of conversation using AI
  • Creates contextually rich summaries
  • Requires OpenAI API access

License

MIT

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

Related

  • SlimContext - The underlying compression library
  • Model Context Protocol - The protocol specification
  • MCP SDK - TypeScript SDK for MCP
Featured
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Categories
Communication & Messaging
Registryactive
Packageslimcontext-mcp-server
TransportSTDIO
UpdatedSep 16, 2025
View on GitHub

Related Communication & Messaging MCP Servers

View all →
Microsoft 365 Teams

io.github.mindstone/mcp-server-microsoft-teams

Microsoft 365 Teams via Graph: list chats, read/send messages, list teams/channels, presence.
8
Outlook Email

com.mintmcp/outlook-email

A MCP server for Outlook email that lets you search, read, and draft emails and replies.
8
Resend Email MCP

helbertparanhos/resend-email-mcp

Complete Resend email MCP: full API coverage + debug layer (deliverability, DNS, bounces).
Email Mcp

marlinjai/email-mcp

Unified email MCP server for Gmail, Outlook, iCloud, and IMAP with batch operations
13
Email (IMAP/SMTP)

io.github.mindstone/mcp-server-email-imap

Email IMAP/SMTP MCP server: iCloud, Gmail, Yahoo, Outlook, and custom IMAP providers
8
HTML Email Playbook

io.github.osamahassouna/email-playbook-mcp

Teaches AI to write HTML email that renders in Outlook, Gmail, and Apple Mail. 19 rules, 6 comps.