tablestakes

by oborchers

Not rated
GitHub

About

Read and edit HTML/Markdown tables in GitBook-synced documents via MCP tools.

Details

Author
oborchers
Categories
Productivity, Other, Communication

Setup

Install tablestakes in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/oborchers/tablestakes

Follow the installation instructions in the repository README, then restart your MCP client.

An MCP server that gives LLMs clean, surgical access to tables trapped in messy HTML.

Tools like GitBook, Notion exports, and CMS platforms collapse tables into single-line HTML when syncing to Markdown files. The result looks like this in your editor:

<table><thead><tr><th width="520.11">Requirement</th><th width="122.07">Priority</th><th>Priority 1-2-3</th></tr></thead><tbody><tr><td><strong>1.1</strong> Agent sees only their Salesforce-assigned cases <strong>in the currently selected organization</strong> (case is "assigned" when SF <code>Case.OwnerId</code> matches the agent's linked SF user ID)...</td><td>Must</td><td>1</td></tr></tbody></table>

This is unreadable for humans and unreliable for LLMs. Models struggle to parse collapsed HTML tables, frequently hallucinate cell boundaries, and cannot edit them without corrupting the structure.

tablestakes fixes this.It sits between the LLM and the file, converting tables to clean pipe format on read and writing back in the original format on save — preserving GitBook compatibility, HTML attributes, and inline formatting.

Discovery— scan a 26-table document in one call:

26 tables T0 pipe 5r 3c v:485f65f7b470 [Cross-Domain Dependencies] A:Integration | B:Source | C:Requirements T2 gitbook 18r 3c v:77a9495fd328 [Case List] A:Requirement | B:Priority | C:Priority 1-2-3 T7 gitbook 3r 4c v:d9a9a45a370f [Attachments] A:Requirement | B:Priority | C:Dependency | D:Priority 1-2-3

Read— collapsed HTML becomes a clean pipe table:

v:d9a9a45a370f gitbook 3r 4c [Attachments] A:Requirement | B:Priority | C:Dependency | D:Priority 1-2-3 | Requirement | Priority | Dependency | Priority 1-2-3 | | --- | --- | --- | --- | | 5.1 View inbound attachments in-app... | Must | — | 1 | | 5.2 Send outbound attachments... | Must | Blocked on SF API | 1 | | 5.3 Attachment file size limits... | Should | — | |

Write— surgical cell edit, version-checked:

14 characters. The file is updated, GitBook HTML format preserved,widthattributes intact.

Baseline: Claude Code's built-in Read + Edit tools operating on the same file. Measured on a synthetic 18-row, 4-column table with realistic requirement-style content (bold IDs, inline emphasis, mixed-length cells).

-

Read (HTML): collapsed HTML tags (<td>,<tr>,<th>,<strong>,width="...") are pure overhead. Pipe tables carry the same information without markup. The Read tool also addscat -nline-number prefixes.

Read (GFM): modest savings from stripping line-number prefixes and surrounding document context. The table content itself is already clean.

Write: the Edit tool requiresold_string(enough context to be unique in the file) +new_string(the modified version), both generated as output tokens. For GFM,old_stringis the entire row line (~190 chars). tablestakes needs only{"row": 0, "column": "B", "value": "Should"}(~18 tokens).

Discovery: without tablestakes, the LLM reads the entire file to find tables.list_tablesreturns a compact index — metadata + 1 preview row per table.

Compact pipe tableswith no column padding. Per theImprovingAgents benchmark, GFM pipe tables achieve the best token-to-accuracy ratio: 1.24x CSV cost at 51.9% QA accuracy, beating JSON (2.08x, 52.3%) and YAML (1.88x, 54.7%).

Tokenizer: tiktokencl100k_base(GPT-4). Claude uses a different tokenizer, but relative comparisons hold. The benchmark script (script.py) constructs tables programmatically and generates tablestakes output using the actual converter code — no hardcoded strings.

Read baseline:simulate_read_tool()wraps file content incat -nformat (line-number prefix per line), matching what Claude Code's Read tool returns. The full file (document text + table) enters the LLM context.

Write baseline: for each cell edit, the script computes the minimum uniqueold_stringby expanding leftward from the target<td>until the substring is unique in the file.new_stringis the same context with the cell value replaced. This is a best-case scenario for the Edit tool — a human might include more context than the minimum.

list_tables baseline: 26 copies of an 18-row GitBook HTML table in a markdown document. Naive = Read the full file (~28k tokens). tablestakes =list_tablesoutput withpreview_rows=0..3:

Reproduce:uv run --with tiktoken python scripts/script.py

claude mcp add tablestakes -- uvx tablestakes
codex mcp add tablestakes -- uvx tablestakes
gemini mcp add tablestakes -- uvx tablestakes

Or install from PyPI directly:pip install tablestakes

Add the following JSON to your client's MCP config file:

{ "mcpServers": { "tablestakes": { "command": "uvx", "args": ["tablestakes"] } } }

All write tools require aversionhash fromread_table— optimistic concurrency that prevents stale overwrites without locks.

While GitBook is the primary motivation, tablestakes works with any Markdown document containing HTML tables — CMS exports, Notion dumps, wiki migrations, or hand-written HTML in.mdfiles.

- Letter:"A","B","AA"(bijective base-26, like Excel)
- Name:"Priority"(must be unique)
- Composite:"B:Priority"(for disambiguation)
- Index:"0","1"(0-based)

make init # First-time setup: venv + deps + pre-commit hooks make check # All checks: format + lint + typecheck + test make test # Run tests only make test-cov # Tests with coverage report

mcp-name: io.github.oborchers/tablestakes

A Model Context Protocol (MCP) server for integrating Google Docs with AI clients.

An MCP server for integrating with the Kanka API, a worldbuilding and campaign management tool for tabletop RPGs.

Connect AI assistants to any MediaWiki wiki (Wikipedia, Fandom, corporate wikis) with 33+ tools for search, read, edit, and Markdown conversion.

A complete whiteboard app with bundled MCP server

Integrates with Wiki.js, enabling AI to read and update documentation.

MCP server for XWiki REST API — read your wiki from Claude and other AI agents

Publish complete websites directly from any AI client via API — no hosting setup, CMS, or configuration required.

Interact with ApostropheCMS, a Node.js-based content management system, to manage content snippets.

An MCP server for the Ghost blogging platform with Server-Sent Events (SSE) transport support.

An MCP server for interacting with the Prismic headless CMS.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.