tty-table logo

tty-table

Community
tecfu

Cross-platform terminal table (Windows, Linux, macOS). Can also run in the browser console and provide. MCP server gives your coding agent with a quick way to add text-wrapped ASCII tables to your README or other files.

Publishertecfu
Repositorytty-table
LanguageTypeScript
Forks
32
Stars
309
Available tools
1
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    tty-table exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 1 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    309 stars and 32 forks from the linked repository.

tty-table

A TypeScript-first terminal table renderer with a compatibility-oriented factory API.

Examples

See here for complete example list

To view all example output:

sh
$ git clone https://github.com/tecfu/tty-table && cd tty-table && npm i
$ npm run view-examples

Terminal (Static)

examples/styles-and-formatting.js

Static

Terminal (Streaming)

$ node examples/data/fake-stream.js | tty-table --format json --header examples/config/header.js

Streaming

  • See the built-in help for the terminal version of tty-table with:
$ tty-table -h

MCP server

Expose tty-table to MCP clients (Claude, IDE agents, Cursor, etc.) over stdio.

Client configuration

json
{
  "mcpServers": {
    "tty-table": {
      "command": "npx",
      "args": ["-y", "--package=tty-table", "tty-table-mcp"]
    }
  }
}

Tools

ToolDescription
render_tableRender data as an ASCII/Unicode terminal table. Accepts header, rows, and any tty-table options; returns the rendered table as text.

Arguments for render_table:

NameTypeRequiredDescription
header(string | {value, align?, width?})[]noColumn definitions
rows(unknown[] | Record<string, unknown>)[]yesRow data (arrays of cells, or objects keyed by column name)
optionsobjectnoAny tty-table option (e.g. width, borderStyle, align, compact)

Example tool call:

json
{
  "header": [{ "value": "name" }, { "value": "score", "align": "right" }],
  "rows": [["Ada", 100], ["Grace", 98]],
  "options": { "width": 40 }
}

Rendered result:

text
  ┌───────┬───────┐
  │ name  │ score │
  ├───────┼───────┤
  │  Ada  │   100 │
  ├───────┼───────┤
  │ Grace │    98 │
  └───────┴───────┘

Additional tools may be added in future releases under the same MCP server.

Browser & Browser Console

Browser Console Example

What's new in 6.0

  • ANSI-safe display-width calculation and Unicode-aware wrapping/truncation.
  • Typed column/table options and formatter context.
  • ESM and CommonJS package exports.
  • Modern Node.js LTS baseline (Node 22+; raised from 20+ when adopting smartwrap v4).
  • A standalone browser bundle is produced for direct use from a browser console or <script> tag.
  • Legacy Table(header, rows, footer, options) and Table(rows, options) construction remains supported.

Compatibility

Node.js

Current releases require Node.js 22 or newer. This is a breaking change from the Node 20 baseline used by early v6 releases (and from the v5 line, which supported older Node.js releases). The floor was raised to match smartwrap@4 / breakword@2.1.0. If your application must remain on Node 20, stay on a prior tty-table release until you can upgrade.

The published package provides both ESM and CommonJS entry points for Node.js. The CLI requires Node.js 22+ as well.

API

ts
import Table from "tty-table"

const table = Table(
  [{ value: "name" }, { value: "score", align: "right" }],
  [
    { name: "Ada", score: 100 },
    { name: "Grace", score: 98 }
  ],
  { borderStyle: "solid" }
)

console.log(table.render())

Formatter context

New code can use the explicit context form:

ts
const formatter = (value: unknown) => String(value).toUpperCase()

The compatibility callback signature is still accepted. New integrations should prefer a formatter that accepts the documented context object and avoid relying on dynamic this mutation.

Width semantics

Widths are measured in terminal display columns, not JavaScript string length. ANSI escape sequences are ignored for measurement; Unicode code points are counted using breakword.width() (Unicode 18.0.0 East Asian Width + UAX #51 Emoji_Presentation). Wrapping and truncation operate on the same display-width semantics.

Compared with older releases that used wcwidth, some symbols that were previously treated as 1 cell are now 2 cells (for example ⚡ U+26A1). Tables containing those characters may reflow slightly; measurement is now aligned with the same library used for wrapping.

Development

sh
npm install
npm run typecheck
npm run build
npm test
npm run test:unit
npm run lint

Installation

TypingMind
{
  "mcpServers": {
    "tty-table": {
      "command": "npx",
      "args": [
        "-y",
        "--package=tty-table",
        "tty-table-mcp"
      ]
    }
  }
}

Available Tools

  • render_table

    Render data as an ASCII/Unicode terminal table (tty-table). Pass header (column names or {value, align, width} objects), rows (array of arrays, or objects whose keys match the header), and optional options (any tty-table table option, e.g. width, borderStyle, align, compact). Returns the rendered table as text.

Use tty-table MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once tty-table is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add tty-table as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the tty-table MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "tty-table": {
      "command": "npx",
      "args": [
        "-y",
        "tty-table"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the tty-table MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the tty-table MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use tty-table to help me with this task?
tty-table
Sure. I read it.
Here is what I found using tty-table.

Frequently asked questions

What is the tty-table MCP server used for?

tty-table is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use tty-table MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use tty-table with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use tty-table MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With tty-table connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect tty-table MCP to TypingMind?

tty-table runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does tty-table MCP provide in TypingMind?

tty-table exposes 1 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use tty-table MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If tty-table requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇