This server tackles token bloat by converting verbose data formats into TOON (Token-Oriented Object Notation) and stripping comments from code files. It exposes two tools: optimize_input_context for converting JSON, XML, YAML, and CSV into compact TOON format, and read_and_optimize_file for removing inline comments and whitespace from local code while preserving docstrings and structure. It also provides a mandatory-efficiency resource that prompts the LLM to prioritize these optimization tools. Reach for this when you're bumping against context limits with large data payloads or verbose codebases, especially in token-constrained environments where every token counts toward API costs or context windows.
mcp-name: io.github.ankitpal181/toon-parse-mcp
A specialized Model Context Protocol (MCP) server that optimizes token usage by converting data to TOON (Token-Oriented Object Notation) and stripping non-essential context from code files.
The toon-parse-mcp MCP server helps AI agents (like Cursor, Claude Desktop, etc.) operate more efficiently by:
optimize_input_context(raw_input: str): Processes raw text data (JSON/XML/CSV/YAML) and returns optimized TOON format.read_and_optimize_file(file_path: str): Reads a local code file and returns a token-optimized version (no inline comments, minimized whitespace).protocol://mandatory-efficiency: Provides a strict system instruction prompt for LLMs to ensure they use the optimization tools correctly.pip install toon-parse-mcp
toon-parse-mcpcommandpython3 -m toon_parse_mcp.server (Ensure your environment is active or use absolute path to python)~/.codeium/windsurf/mcp_config.json directly.mcpServers object:{
"mcpServers": {
"toon-parse-mcp": {
"command": "python3",
"args": ["-m", "toon_parse_mcp.server"]
}
}
}
~/.gemini/antigravity/mcp_config.json directly.mcpServers object:{
"mcpServers": {
"toon-parse-mcp": {
"command": "python3",
"args": ["-m", "toon_parse_mcp.server"]
}
}
}
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"toon-parse-mcp": {
"command": "python3",
"args": ["-m", "toon_parse_mcp.server"]
}
}
}
When the server is active, the AI will have access to the optimize_input_context and read_and_optimize_file tools. You can also refer to the efficiency protocol by asking the AI to "check the mandatory efficiency protocol".
To run the test suite:
pip install -e ".[test]"
pytest tests/
mcp >= 1.25.0toon-parse >= 2.4.3MIT License - see LICENSE for details.
io.github.ericm1018/skillfm-llm-cost-optimizer-openai-anthropic-usage
io.github.mikerawsonnz/llm-orchestration-agent
io.github.mikerawsonnz/authenticated-llm-agent
labforgedev/copilot-memory-mcp
csoai-org/agent-prompt-injection-firewall-mcp
io.github.mikerawsonnz/authenticated-multi-llm-agent