npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iflow-mcp/kweinmeister-toon-mcp

v1.0.0

Published

A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that provides tools for encoding and decoding **TOON (Token-Oriented Object Notation)**.

Readme

TOON MCP Server

A Model Context Protocol (MCP) server that provides tools for encoding and decoding TOON (Token-Oriented Object Notation).

TOON is a compact, human-readable format designed to represent JSON data using significantly fewer tokens, making it ideal for LLM prompts and context optimization.

👉 Learn more about the format at toonformat.dev

Features

This server exposes two core tools to MCP clients (specifically tested with Gemini CLI):

  • encode_toon: Converts JSON strings into TOON format to save tokens.
  • decode_toon: Converts TOON formatted text back into standard JSON.

Usage

Quick Start with Gemini CLI

To use this server with the Gemini CLI, follow these steps:

  1. Install Gemini CLI (if you haven't already):

    npm install -g @google/gemini-cli@latest
  2. Configure the MCP Server: You can register the server by creating or editing your Gemini settings file, typically located at ~/.gemini/settings.json (Global) or .gemini/settings.json (Project-local).

    Add the following configuration:

    {
      "mcpServers": {
        "toon": {
          "command": "npx",
          "args": ["-y", "git+https://github.com/kweinmeister/toon-mcp.git"]
        }
      }
    }
  3. Run Gemini CLI: Start the CLI interface. The tools should now be available to the model.

    gemini

Tools

1. encode_toon

Converts JSON data into the compact TOON format.

Parameters:

| Parameter | Type | Default | Description | | :--- | :--- | :--- | :--- | | json | string | Required | The JSON data (serialized as a string) to encode. | | indent | number | 2 | Number of spaces for indentation. | | delimiter | string | , | Delimiter for arrays/rows. Options: , (comma), \t (tab), \| (pipe). | | keyFolding | string | "off" | Collapse single-key wrapper chains (e.g., a.b.c). Options: "off", "safe". | | flattenDepth | number | Infinity | Maximum depth to apply key folding. | | replacer | (string\|number)[] | undefined | Array of properties to include in the output. |

Example Prompt in Gemini CLI:

"Use the encode_toon tool to convert this JSON into TOON format: {"users": [{"id": 1, "name": "Alice"}, {"id": 2, "name": "Bob"}]}"

Output:

users[2]{id,name}:
  1,Alice
  2,Bob

2. decode_toon

Parses TOON formatted text back into standard JSON.

Parameters:

| Parameter | Type | Default | Description | | :--- | :--- | :--- | :--- | | toon | string | Required | The TOON formatted string to decode. | | strict | boolean | true | Enforce strict validation (e.g., checking declared array lengths). | | expandPaths | string | "off" | Reconstruct dotted keys into nested objects. Options: "off", "safe". | | indent | number | 2 | Number of spaces for indentation. |

Transports

This server supports both HTTP Server-Sent Events (SSE) and Standard IO (stdio).

HTTP / SSE (Default)

Useful for remote deployments (like Cloud Run) or web-based MCP clients.

# Starts on port 8080 by default
npm start

# Custom port
npm start -- --port 3000

Stdio

Used by local clients like Gemini CLI.

npm run start:stdio

Development

Installation

git clone https://github.com/kweinmeister/toon-mcp
cd toon-mcp
npm install

Testing

Run the unit tests to ensure the server tools are functioning correctly:

npm test

Debugging with MCP Inspector

You can use the MCP Inspector to inspect and test the server's tools interactively via a web interface.

npx fastmcp inspect index.ts

Building & Linting

# Linting
npx biome check .

# Type checking
npx tsc --noEmit