TOON MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TOON MCP Server Encode this JSON list of orders into TOON to save tokens"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TOON MCP Server
MCP (Model Context Protocol) server for TOON (Token-Oriented Object Notation) encoding. Reduce LLM token usage by 50-70% when sending structured data.
What is TOON?
TOON is a compact data format optimized for LLM input. Instead of repeating field names for every object, it uses a header-based format:
JSON (1041 tokens):
[
{"id": 1, "name": "Product A", "price": 99.99},
{"id": 2, "name": "Product B", "price": 149.99}
]TOON (389 tokens):
[id,name,price]
1,Product A,99.99
2,Product B,149.99Result: 62% fewer tokens = 62% cost savings
Related MCP server: TOON MCP Server
Installation
Quick Start (npx - no install needed)
Add to your MCP settings:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"toon": {
"command": "npx",
"args": ["-y", "toon-mcp-server"]
}
}
}Claude Code (~/.claude/settings.json):
{
"mcpServers": {
"toon": {
"command": "npx",
"args": ["-y", "toon-mcp-server"]
}
}
}Global Install
npm install -g toon-mcp-serverThen add to your MCP settings:
{
"mcpServers": {
"toon": {
"command": "toon-mcp"
}
}
}As Claude Code Skill
# Download the skill
curl -o ~/.claude/skills/toon.md https://raw.githubusercontent.com/elminson/toon-mcp/main/skills/toon.mdThen use /toon in Claude Code.
Available Tools
toon_encode
Convert data to TOON format.
Supported formats: JSON, CSV, TSV, XML, HTML tables, YAML
Input: [{"name":"Alice","age":30},{"name":"Bob","age":25}]
Output: [name,age]
Alice,30
Bob,25toon_decode
Convert TOON back to JSON.
toon_analyze
Analyze data and show potential token/cost savings.
toon_optimize_prompt
Find data sections in a prompt and convert them to TOON automatically.
Usage Examples
In Claude Desktop/Code (with MCP)
Just ask Claude to use the tools:
"Encode this JSON to TOON: [...]"
"Analyze how much I'd save converting this data to TOON"
"Optimize this prompt for token efficiency"
Programmatic (Node.js)
const { ToonEncoder } = require('toon-mcp-server/src/toon-encoder');
// Encode
const data = [
{ id: 1, name: 'Test', price: 99.99 },
{ id: 2, name: 'Test 2', price: 149.99 },
];
const toon = ToonEncoder.encode(data);
// Get stats
const json = JSON.stringify(data);
const stats = ToonEncoder.getStats(json, toon);
console.log(stats.savings.percent); // "64.5%"
// Decode
const decoded = ToonEncoder.decode(toon);Benchmarks
Tested with OpenAI GPT-4o-mini:
Dataset Size | JSON Tokens | TOON Tokens | Savings |
5 items | 383 | 192 | 49.9% |
20 items | 1,394 | 530 | 62% |
50 items | 3,412 | 1,204 | 64.7% |
100 items | 6,800 | 2,400 | ~65% |
Cost Savings at Scale
Volume | GPT-4o-mini | GPT-4o | Claude Sonnet |
1M requests | $489 saved | $8,158 saved | $9,789 saved |
10M requests | $4,890 saved | $81,580 saved | $97,890 saved |
When to Use TOON
✅ Best for:
Arrays of objects with same structure (tables, lists, records)
API responses, database results
Large datasets sent to LLMs
Cost optimization at scale
⚠️ Less effective for:
Deeply nested, non-uniform data
Small payloads (<5 items)
Data with many unique field structures
Contributing
Pull requests welcome! Please open an issue first to discuss changes.
License
MIT
Available Tools
4 toolstoon_analyzeC
Analyze data and show potential token savings with TOON encoding.
Inputs: data (required), format.
toon_decodeC
Decode TOON format back to JSON object or array.
Inputs: toon (required).
toon_encodeA
Convert data to TOON (Token-Oriented Object Notation) format to reduce token usage by 50-70%.
Supports: JSON, CSV, TSV, XML, HTML tables, YAML, and raw objects.
TOON uses a header-based format where field names are defined once:
JSON: {"id":1,"name":"test"} → [id,name]\n1,test
Reduces repetitive keys in arrays of objects
Use this before sending large datasets to LLMs to save tokens and costs.
Inputs: data (required), format.
toon_optimize_promptA
Optimize a prompt containing data for token efficiency.
Detects data structures within the prompt and converts them to TOON format, adding instructions for the LLM to understand the format.
Returns the optimized prompt with estimated token savings.
Inputs: prompt (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct and non-overlapping purpose: toon_analyze assesses potential savings, toon_encode converts data to TOON format, toon_decode reverts TOON to original formats, and toon_optimize_prompt specifically handles prompt optimization. There is no ambiguity in tool selection.
All tools follow a consistent 'toon_' prefix with a clear verb_noun pattern (e.g., toon_analyze, toon_encode, toon_decode, toon_optimize_prompt). This uniformity makes the tool set predictable and easy to understand.
With 4 tools, the server is well-scoped for its purpose of TOON encoding and optimization. Each tool serves a specific function in the data processing workflow, and there are no extraneous or missing tools for this focused domain.
The tool set covers the core TOON workflow comprehensively: analyze, encode, decode, and optimize prompts. A minor gap might be the lack of a tool for batch processing or handling specific edge cases, but the existing tools allow agents to perform essential operations without dead ends.
Related MCP Connectors
Convert JSON to TOON (about 43% fewer LLM tokens) and TOON back to JSON. Free, no auth.
Validate and convert JSONL fine-tuning data across 11 AI providers. 13 tools.
Reduce your AI bills by up to 99% locally: focused code, warm prompt caches & zero secret leaks.
Free no-LLM token savers: URL→Markdown, outline, JSON trim, log compress, token count; x402 extras
Related MCP Servers
- AlicenseAqualityDmaintenanceConverts JSON data to TOON (Token-Oriented Object Notation) format and back, reducing token usage by 30-60% for more efficient LLM applications.317 npm1MIT
- AlicenseNot gradedqualityDmaintenanceConverts JSON data and system prompts to and from TOON (Token-Oriented Object Notation) format, reducing token usage by 30-60% when interacting with LLMs while preserving data structure.66 PyPIMIT
- FlicenseAqualityDmaintenanceProvides sandboxed code execution and data processing for CSVs and logs to achieve over 95% token savings. It enables secure multi-language execution and progressive tool disclosure to optimize LLM context usage.7-

ASON MCP Serverofficial
AlicenseNot gradedqualityDmaintenanceEnables compression and decompression of JSON data using the token-optimized ASON format, reducing token usage by 20-60% for LLM applications.11 npmMIT