# Tty Table

> 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.

- **Type:** MCP server
- **Install:** `agentstack add mcp-tecfu-tty-table`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [tecfu](https://agentstack.voostack.com/s/tecfu)
- **Installs:** 0
- **Category:** [Web & Browser](https://agentstack.voostack.com/c/web-and-browser)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [tecfu](https://github.com/tecfu)
- **Source:** https://github.com/tecfu/tty-table
- **Website:** https://www.npmjs.com/package/tty-table

## Install

```sh
agentstack add mcp-tecfu-tty-table
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# tty-table

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

## [Examples](examples/)

[See here for complete example list](examples/)

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](examples/styles-and-formatting.js)

 

### Terminal (Streaming)

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

 

- 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

| Tool | Description |
|------|-------------|
| `render_table` | Render 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`:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `header` | `(string \| {value, align?, width?})[]` | no | Column definitions |
| `rows` | `(unknown[] \| Record)[]` | yes | Row data (arrays of cells, or objects keyed by column name) |
| `options` | `object` | no | Any 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 

- View in Chrome or Chromium at [http://localhost:8070/examples/browser-example.html](http://localhost:8070/examples/browser-example.html) using a dockerized apache instance:

    ```sh
    git clone https://github.com/tecfu/tty-table
    cd tty-table
    docker run -dit --name tty-table-in-browser -p 8070:80 -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4
    ```

- [live demo (chrome only): jsfiddle](https://jsfiddle.net/nb14eyav/)
- [live demo (chrome only): plnkr](https://plnkr.co/edit/iQn9xn5yCY4NUkXRF87o?p=preview)
- [source: examples/browser-example.html](examples/browser-example.html)

 

## 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 20+).
- A standalone browser bundle is produced for direct use from a browser console or `` tag.
- Legacy `Table(header, rows, footer, options)` and `Table(rows, options)` construction remains supported.

## Compatibility

### Node.js

**v6 requires Node.js 20 or newer.** This is a breaking change from the v5 line, which supported older Node.js releases. If your application must remain on an older Node version, stay on the v5 release line.

The published package provides both ESM and CommonJS entry points for Node.js. The CLI requires Node.js 20+ 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; wide Unicode characters are counted using `wcwidth`. Wrapping and truncation operate on the same measurement primitive.

## Development

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

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [tecfu](https://github.com/tecfu)
- **Source:** [tecfu/tty-table](https://github.com/tecfu/tty-table)
- **License:** MIT
- **Homepage:** https://www.npmjs.com/package/tty-table

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-tecfu-tty-table
- Seller: https://agentstack.voostack.com/s/tecfu
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
