Skip to main content
Glama

Toonify MCP

English | 繁體中文 | 日本語 | Español | Français | Deutsch | 한국어 | Русский | Português | Tiếng Việt | Bahasa Indonesia

Toonify MCP — context compression for Claude Code

Context compression plugin for Claude Code. Automatically trims large tool output—JSON, YAML, stack traces, and logs—before it enters the context window.

Works as a Claude Code plugin (automatic, zero-config) or as an MCP server (on-demand).

Features

  • Compresses large JSON, YAML, and API responses

  • Reduces long test failures and stack traces

  • Runs automatically in the background—no change to your Claude Code workflow required

Related MCP server: token-saver-mcp

Limitations

Skipped for short text, very small files, and content where exact original formatting must be preserved.

Installation

git clone https://github.com/PCIRCLE-AI/toonify-mcp.git
cd toonify-mcp
npm install
npm run build
npm install -g .
toonify-mcp setup
toonify-mcp doctor

toonify-mcp setup adds the local marketplace and installs, updates, or re-enables the plugin automatically.

Check status

toonify-mcp status

MCP mode (optional)

toonify-mcp setup mcp
claude mcp list

claude mcp list should show toonify: toonify-mcp - ✓ Connected.

Pipe filter (any agent CLI)

toonify-mcp compress reads stdin, compresses what's safe to compress (JSON/YAML → TOON, repetitive logs collapsed; source code, prose, and precision-sensitive numbers pass through untouched), and writes to stdout. It never breaks a pipe — when compression doesn't apply, the input comes out byte-for-byte.

curl -s https://api.example.com/users | toonify-mcp compress

This works with any agent CLI, because output is compressed before it enters the model's context. To have an agent adopt it, add a rule to your project's agent instructions (e.g. AGENTS.md):

When a command is likely to print large JSON/YAML or long logs,
pipe it through `toonify-mcp compress` (e.g. `curl ... | toonify-mcp compress`).
It only rewrites output it can compress losslessly; everything else passes through.

OpenAI Codex CLI (on-demand)

toonify-mcp setup codex

Registers toonify as an MCP server in ~/.codex/config.toml (a timestamped backup of the file is made first). Codex can then call the optimize_content tool on demand.

Note: on Codex this is on-demand, not automatic — Codex's hooks cannot yet replace tool output the way Claude Code's updatedToolOutput does, and appending a compressed copy would grow context instead of shrinking it. For automatic compression on Codex, use the pipe filter above.

Docs

Available Tools

5 tools
cleanup_expired_cacheB

Clean up expired cache entries and return the number of entries removed

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states that the tool removes expired entries and returns a count, but does not disclose whether the operation is destructive, reversible, or requires specific permissions. It also does not mention potential side effects like locking or performance impact. Compared to the update_drive example, this is a significant gap for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the action and the return value. There is no redundant or filler text. Every word contributes to the understanding of what the tool does, making it appropriately concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no parameters and no output schema, the description does convey the primary purpose and the return value. However, given the absence of annotations, it does not fully address behavioral aspects such as side effects, when it is safe to call, or how it relates to sibling tools. An agent might need additional context to use it correctly, especially to distinguish it from 'clear_cache'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the schema coverage is trivially 100%. The description does not need to add parameter details since there are none. Per the calibration rules, a tool with 0 parameters receives a baseline score of 4, and the description does not introduce any contradictory or confusing information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('clean up'), the target ('expired cache entries'), and the outcome ('return the number of entries removed'). It is specific and easy to understand. However, it does not explicitly differentiate itself from the sibling tool 'clear_cache', which could also remove cache entries, though 'expired' suggests a narrower scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'clear_cache' or 'get_cache_stats'. It does not mention any conditions, prerequisites, or scenarios where this tool is preferred. The agent must infer usage from the name and description alone, which may lead to ambiguous selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

clear_cacheB

Clear the optimization result cache

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It states 'clear' which implies a destructive, likely irreversible action, but does not mention side effects, performance impact, or whether other cached data is affected. The complete lack of detail on consequences is a significant gap for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It front-loads the core action and resource. However, it is so brief that it omits important context, though for a zero-parameter tool this brevity is acceptable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite the tool's simplicity (no parameters, no output schema), it lacks essential context: no indication of when to use it, what happens to the cache, or how it differs from related tools like cleanup_expired_cache. An agent cannot reliably determine if this is the right action without additional information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, so the description does not need to explain parameter meaning. Since schema coverage is trivially 100% and there are no parameters to document, the baseline of 4 applies, and the description is adequate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('clear') and the target ('optimization result cache'), making the core purpose unambiguous. However, it does not distinguish this tool from the sibling cleanup_expired_cache, which also relates to cache clearing, so it's not fully differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives like cleanup_expired_cache or get_cache_stats. No context is given about scenarios where clearing the entire cache is appropriate, nor any exclusions or recommendations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_cache_statsA

Get detailed cache statistics (LRU cache + Prompt cache)

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the behavioral burden. It states it is a read operation ('Get'), implying non-destructive behavior, but it does not disclose any other behavioral traits such as potential performance costs, whether the stats are cumulative or per-request, or if any side effects exist. For a simple read tool this may be adequate, but it adds no nuance beyond the obvious.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that states the action and resource without any fluff. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description must explain what the agent will receive. It mentions 'detailed cache statistics' and names two cache types, but does not enumerate any actual metrics or return format. An agent cannot predict what fields will be present. For a tool with no parameters and no annotations, this is a significant gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters and the schema is 100% covered (vacuously). Per the baseline rule for 0-parameter tools, the description does not need to explain parameters. The description does not attempt to add parameter information, which is correct.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Get') and resource ('cache statistics') and explicitly names two cache types (LRU + Prompt). It clearly distinguishes itself from siblings like clear_cache and cleanup_expired_cache which are mutations, and from optimize_content which is a different operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use this tool versus get_stats or other siblings. The description does not state any exclusions, prerequisites, or alternative selection criteria, leaving the agent to infer when this is the appropriate choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_statsB

Get token optimization statistics

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The verb 'Get' implies a read-only operation, which is transparent enough for a basic getter. However, there are no annotations to confirm safety or side effects, and the description does not explicitly state that it has no side effects or that it is safe to call. The description carries the burden but does not fully disclose behavior beyond the implicit read nature.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise phrase with no unnecessary words or repetition. It is front-loaded with the action verb and clearly names the subject. No fluff or redundancy is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (no parameters, no output schema), the description is almost complete. It tells the agent what the tool does. However, it could be slightly more specific about the nature of the statistics (e.g., counts, sizes, savings) to fully remove ambiguity. Still, for a parameterless getter, this is reasonably complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema shows an empty properties object. Since there are no parameters to describe, the description adds no parameter semantics, but the baseline for 0 parameters is 4. The description does not need to add anything beyond what the schema already conveys.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('Get') and the resource ('token optimization statistics'), but the noun phrase is somewhat vague and does not specify what statistics are included or how they relate to the sibling tools. It is clear enough to understand the general purpose, but not as precise as a description like 'List ALL calls in date range'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus the sibling tools. In particular, 'get_cache_stats' might overlap, but the description does not clarify the distinction or suggest conditions for choosing one over the other. The agent is left without any usage orientation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

optimize_contentB

Optimize structured data content for token efficiency using TOON format

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYesThe content to optimize (JSON or YAML)
toolNameNoName of the tool that generated this content

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full responsibility for behavioral disclosure. It states 'optimize' but does not specify whether the input is modified in place, whether the operation is reversible, what the output format is, or any side effects. The TOON format is mentioned but never explained, leaving the agent to guess about the transformation's nature.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no fluff. It is appropriately front-loaded with the core action and format. However, it is so brief that it sacrifices necessary detail, though that is more a completeness issue than a conciseness issue.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has only two parameters and no output schema, so the description should compensate by explaining what the output looks like, what TOON format entails, and any prerequisites. None of this is provided. An agent cannot predict the result of calling this tool beyond a vague notion of optimization, making the description incomplete for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so both parameters are already documented. The description adds no additional meaning about 'content' or 'toolName'—for instance, why toolName might be needed or how it influences optimization. Since the schema already covers the basics, a baseline of 3 is appropriate, but there is room for added context that the description does not provide.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Optimize') and resource ('structured data content') and introduces the TOON format, which clearly distinguishes it from sibling tools focused on caching and stats. The purpose is unambiguous and does not rely on the tool name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives, nor any mention of conditions or exclusions. The description merely states what it does without helping the agent decide when to invoke it, even though the sibling tools are clearly different in function.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.8.2
    • First observedcleanup_expired_cache
    • First observedclear_cache
    • First observedget_cache_stats
    • First observedget_stats
    • First observedoptimize_content

TDQS

A3.6/5.0

Scored across 5 tools

Disambiguation4/5

Each tool has a distinct role—optimize, stats, and cache maintenance—but get_stats vs get_cache_stats and clear_cache vs cleanup_expired_cache could be confused without careful reading. The descriptions generally clarify the boundaries.

Naming Consistency5/5

All tool names follow a consistent verb_noun snake_case pattern: optimize_content, get_stats, clear_cache, get_cache_stats, cleanup_expired_cache. The naming is predictable and readable.

Tool Count5/5

Five tools is a well-scoped set for a token optimization utility: one core operation, one statistics endpoint, and three cache-management tools. Each tool has a clear place and none feel like filler.

Completeness5/5

The tool surface covers the main optimize operation, general statistics, and comprehensive cache lifecycle management (view, clear, cleanup expired). This is a complete and practical set for the server's stated purpose.

Maintenance

ActivityMaintained
ResponsivenessSlow

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    2-5x longer Claude Code sessions before compaction. Saves 30-40% on input token costs. Remembers your rules and corrections so Claude stops repeating mistakes after compaction. Auto-runs in the background, just install once and forget about it.
    379
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Automatically reduces token usage in Claude Code sessions using algorithmic optimizations like code compression, smart file reading, output summarization, and prompt rewriting, with no extra API calls or cost.
    13 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Reduces context window usage by 60-90% through intelligent caching, compression, and smart tool replacements for Claude Code and Claude Desktop.
    688 npm
    524
    MIT