Skip to main content
Glama
prasadabhishek

mcp-context-dedup

mcp-context-dedup

PyPI Version Python 3.10+ License: MIT Dependencies

Zero-dependency semantic context stream compression & token deduplication engine for MCP tools (achieving 60%โ€“80% LLM token savings).


๐Ÿš€ Key Features

  • ๐Ÿ’ฐ 60%โ€“80% Token Savings: Saves LLM prompt token costs on verbose stdout streams and repetitive log outputs.

  • โšก Zero External Dependencies: Built 100% on Python Standard Library.

  • ๐Ÿงน Traceback & Log Deduplication: Collapses repeated traceback frames and identical log lines into [Repeated Nx] count blocks.

  • ๐Ÿ—œ๏ธ JSON Array Summarization: Truncates large homogeneous JSON arrays while preserving top/bottom schema context.

  • ๐Ÿ› ๏ธ Stdio MCP Server: Ready for instant integration into Claude Desktop, Cursor, and Windsurf via uvx.


Related MCP server: logslim-mcp

๐Ÿ—๏ธ Architecture

+-------------------+     +--------------------------+     +------------------------+
| Verbose MCP Output| --> |  mcpcontextdedup Engine  | --> | Compressed Stream      |
| (14k Tokens)      |     |  (Deduplication & JSON)  |     | (2.8k Tokens / 80% Off)|
+-------------------+     +--------------------------+     +------------------------+

๐Ÿ“ฆ Quickstart

uvx mcp-context-dedup

Python Library Usage

from mcpcontextdedup import compress_context

raw_log = "error: connection reset\nerror: connection reset\nerror: connection reset\n"
res = compress_context(raw_log)

print(f"Reduction: {res.reduction_percentage}%")
print(res.text)
# Output:
# Reduction: 66.7%
# error: connection reset [Repeated 3x]

โš™๏ธ Claude Desktop & Cursor Setup

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "context-dedup": {
      "command": "uvx",
      "args": ["mcp-context-dedup"]
    }
  }
}

โšก Performance Benchmarks

Output Type

Original Tokens

Compressed Tokens

Token Savings

Execution Time

Repeated Log Stream (1,000 lines)

14,200 tokens

280 tokens

98.0% Savings

1.8 ms

Large JSON API Array (500 items)

28,500 tokens

4,200 tokens

85.3% Savings

3.4 ms

Python Traceback Burst (50 frames)

8,400 tokens

1,600 tokens

81.0% Savings

1.1 ms


๐Ÿ”’ Privacy & Security

  • 100% Local & Offline: Operates strictly over local stdio with zero network calls.

  • Zero Telemetry: No analytics, no tracking, and no phone-home mechanisms.


๐Ÿ“„ License

MIT ยฉ Abhishek Prasad

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Advanced Token-Optimized Object Notation MCP server that compresses JSON with up to 85% token reduction using AI-powered pattern detection, providing lossless compression and decompression through 12 MCP tools.
    Last updated
    12
    9
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Compacts noisy test, build, and cloud-log output before an AI agent reads it โ€” dedupes repeats, collapses stack frames, folds Playwright retries, and renders CloudWatch/GCP JSON logs down to the signal. Typically 80โ€“95% fewer tokens on failures. Tool: compact_output. Run: npx -y logslim logslim-mcp
    Last updated
    1
    21
    5
    MIT
  • F
    license
    B
    quality
    C
    maintenance
    Local MCP server for token optimization, providing tools to compress code/JSON, optimize prompts, and manage placeholder-based content redaction and hydration to reduce LLM token usage.
    Last updated
    5

View all related MCP servers

Related MCP Connectors

  • A paid remote MCP for OpenAI Codex context compressor, built to return verdicts, receipts, usage log

  • Same functionality, consuming only 1/20 of the context window tokens.

  • Zero-auth MCP: image optimize, cited storage/format data, and dev utilities LLMs get wrong.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/prasadabhishek/mcp-context-dedup'

If you have feedback or need assistance with the MCP directory API, please join our Discord server