JSON to TOON MCP Server
A Model Context Protocol (MCP) server that provides tools for converting JSON data to TOON (Token-Oriented Object Notation) format. TOON is a token-efficient format designed specifically for LLM applications, reducing token usage by 30-60% compared to JSON.
Features
JSON to TOON Conversion: Convert JSON data to TOON format with customizable options
TOON to JSON Conversion: Convert TOON format back to JSON
Token Savings Analysis: Analyze potential token savings before conversion
MCP Protocol Support: Full MCP server implementation for integration with LLM applications
Quick Start
1. Install the Package
2. Configure Claude Desktop
Add this to your claude_desktop_config.json:
3. Restart Claude Desktop
Restart Claude Desktop and the MCP server will be available.
Installation
Usage
Running the Server
The server runs on stdio and can be connected to any MCP client.
Available Tools
1. convert_json_to_toon
Converts JSON data to TOON format.
Parameters:
json_data(string, required): JSON data to convertoptions(object, optional): Conversion optionsdelimiter(string): Delimiter for tabular arrays (default: ",")indentation(string): Indentation string (default: " ")show_length_markers(boolean): Show length markers [N] for arrays (default: true)
Example:
2. convert_toon_to_json
Converts TOON format back to JSON.
Parameters:
toon_data(string, required): TOON data to convert
Example:
3. analyze_token_savings
Analyzes potential token savings when converting JSON to TOON.
Parameters:
json_data(string, required): JSON data to analyze
Example:
Example Conversions
JSON to TOON
JSON Input:
TOON Output:
Token Savings
The TOON format typically reduces token usage by 30-60% compared to JSON, making it ideal for LLM applications where token efficiency is important.
Development
Running Tests
Development Mode
Integration with MCP Clients
This server can be integrated with any MCP-compatible client. The server communicates via stdio, making it suitable for integration with various LLM applications and development tools.
Manual Configuration for Claude Desktop
To add this MCP server to Claude Desktop manually, add the following configuration to your claude_desktop_config.json file.
Config file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
To add this MCP server to Claude Desktop manually, add the following configuration to your claude_desktop_config.json:
Alternative configuration using local installation:
Configuration for development (from source):
Configuration Notes
Replace
/path/to/json-to-toon-mcp-serverwith the actual path to your installationThe
npxmethod requires the package to be installed globally (npm install -g json-to-toon-mcp-server)The server communicates via stdio, so no additional network configuration is needed
After adding the configuration, restart Claude Desktop for changes to take effect
TOON Format Benefits
Token Efficient: 30-60% fewer tokens than JSON
LLM-Friendly: Structured format that's easy for LLMs to parse
Lossless: Full bidirectional conversion between JSON and TOON
Human Readable: Maintains readability while being compact
Schema Aware: Explicit structure declarations help with validation
License
MIT