Get the FREE Ultimate OpenClaw Setup Guide →

toon-java

☕ Community-driven Java implementation of TOON

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio toon-format-toon-java docker run -i toon-format/toon-java:latest

How to use

The toon-java MCP server exposes tooling around the TOON format for Java via the JToon library. This server lets you encode and decode Java objects into the compact TOON representation, leveraging Java 17+ features and Jackson annotations. You can use the server to serialize Java records and POJOs into TOON, inspect the tabular and compact structure, and benefit from the library’s type normalizations (for numbers, dates, optional values, and various Java temporal types) that produce LLM-friendly output. Typical use cases include preparing data contexts for LLM prompts, sharing concise data payloads, or converting between Java objects and their TOON-encoded strings for storage or transmission. The server supports invoking encoding methods with options to influence formatting, such as indentation, delimiters, and flattening behavior, enabling token-efficient representations for different contexts.

How to install

Prerequisites:

  • Docker installed and running
  • Optional: access to Java development environment if you want to run tests locally
  1. Pull and run the Docker image
  • Ensure you have the latest toon-java image from Docker Hub
# Run the container in interactive mode
docker run -it --rm toon-format/toon-java:latest
  1. If you prefer to run locally (without Docker):
  • Ensure you have Java 17+ installed
  • Build from source (if you have the repo):
# Example using Maven (from project root):
mvn -B -DskipTests package
  • Run a sample using the built artifact (adjust the classpath as needed)
# Example assuming a runnable jar built as target/jtoon-example.jar
java -jar target/jtoon-example.jar
  1. Verify installation
  • Check the container logs or run a quick encode/decode sample using the provided JToon API within your Java project to confirm the library is functioning.

Additional notes

Tips and considerations:

  • The JToon library requires Java 17+; ensure your environment uses a compatible JDK.
  • When running in containerized mode, you may want to mount your project data into the container for convenient testing.
  • Encoding options (e.g., Delimiter, indent, lengthMarker, flatten) can significantly affect token usage; experiment with Delimiter.TAB or lengthPrefix to optimize for LLM prompts.
  • If you encounter issues with Maven Central access or dependencies, ensure your network allows fetching from central repositories.
  • The npm_package field is null because this MCP server is not distributed as an npm package.

Related MCP Servers

Sponsor this space

Reach thousands of developers