TablaCognita

TablaCognita

A browser-based Markdown editor that enables AI to co-write documents via MCP tools, with real-time collaboration and no data stored on servers.

Category
访问服务器

README

TablaCognita

Co-write with any AI. In your browser. No data on anyone's server.

TablaCognita is a browser-based Markdown editor where AI is a first-class participant, not a feature bolted onto a text box. Select text and send it to your AI. Watch edits land in real time. Undo anything. The AI sees the document through MCP tools — the same protocol that powers Claude Desktop, Cursor, and every other MCP-capable client.

Your document lives in your browser. The relay server is a stateless wire. Nobody stores your writing.

How It Works

┌──────────────┐   MCP (stdio | HTTP)   ┌──────────────┐   WebSocket   ┌──────────────────┐
│  Your AI     │◄───────────────────────►│    Relay      │◄────────────►│  Browser Editor   │
│  (Claude,    │   Tool calls/results    │  (stateless)  │              │  (source of truth)│
│   Cursor,    │                         │               │              │                   │
│   any MCP)   │                         └──────────────┘              │  CodeMirror 6     │
└──────────────┘                                                       │  Live preview     │
                                                                       │  Section tracking │
                                                                       │  Lock management  │
                                                                       └──────────────────┘

The AI reads and writes through 17 MCP tools. The editor handles section addressing, fuzzy text matching, collision avoidance, and undo. The relay just passes messages. That's it.

Quick Start

git clone https://github.com/pstryder/tablacognita.git
cd tablacognita
npm install
npm start

Open http://localhost:3000 in your browser. The editor is live.

Connect your MCP client. For Claude Desktop, add to your config:

{
  "mcpServers": {
    "tabla-cognita": {
      "command": "node",
      "args": ["server/index.js", "--transport", "stdio"],
      "cwd": "/path/to/tablacognita"
    }
  }
}

Your AI can now read your document, edit sections, replace text, and respond to selections you send it from the editor.

What Your AI Can Do

Readread_document, get_structure, get_section. The AI sees your full document, section outline, or individual sections by heading name or stable ID.

Writereplace_section, replace_text, insert_after, append. Section-level edits with auto-locking. Fuzzy text matching that works through markdown formatting (**bold text** matched by searching "bold text"). Full document replacement requires your confirmation in the browser.

Coordinaterequest_edit_lock, release_lock, get_cursor_context, get_dirty_regions, poll_context. The AI knows where your cursor is, which sections you've edited since it last looked, and can lock sections for multi-step operations. All locks have TTLs — nothing stays locked forever.

Manageopen_document, snapshot, restore_snapshot, get_revision_history. Named checkpoints saved to your browser's IndexedDB. Restore any snapshot with one tool call.

Key Design Decisions

Browser is source of truth. The relay holds zero document state. If the relay restarts, your document is still in your browser. The AI reconnects and continues.

Section IDs are stable. Rename a heading from "Introduction" to "Overview" — the section ID doesn't change. The AI can always find its way back.

Agent edits are undoable. Every AI edit goes through CodeMirror's transaction system. Ctrl+Z works on AI edits exactly like your own.

Locks are intent signals, not mutexes. Auto-locks during edits are atomic and invisible. Explicit locks for multi-step operations have TTLs and never block you — just a gentle indicator that the AI is working on a section.

Notifications are fire-and-forget. The editor tells the AI when you move between sections, rename headings, or delete content. If the transport doesn't support notifications, the AI can poll instead. No feature depends on notifications arriving.

No data leaves your browser. Documents live in CodeMirror's state. Snapshots live in IndexedDB. The relay is a WebSocket bridge with no storage. There is nothing to subpoena.

Project Structure

server/
  index.js          — MCP server + Express + WebSocket relay
  relay.js          — WebSocket relay, request/response correlation
  sessions.js       — Session management
  tools.js          — MCP tool definitions and handlers

editor/
  index.html        — Editor shell with CodeMirror 6 via ESM CDN
  app.js            — Editor logic, WebSocket handlers, all tool implementations
  styles.css        — Dark theme

shared/
  protocol.js       — Message types, error codes, constants
  sections.js       — Section parser with stable ID registry
  fuzzy.js          — 4-level fuzzy matching cascade
  locks.js          — Lock state machine with TTL
  notifications.js  — Notification debouncing and validation

test/
  relay.test.js     — Full relay round-trip tests
  sections.test.js  — Section parser unit tests
  fuzzy.test.js     — Fuzzy matching unit tests
  locks.test.js     — Lock state machine tests
  notifications.test.js — Notification system tests
  mock-browser.js   — Mock WebSocket client for automated testing

Running Tests

npm test              # All 122 tests
npm run test:sections # Section parser only
npm run test:fuzzy    # Fuzzy matching only
npm run test:relay    # Relay round-trip only

Transport Modes

npm start                    # HTTP transport (default, port 3000)
npm run start:stdio          # stdio transport (for local MCP clients)
npm start -- --port 8080     # Custom port

Requirements

  • Node.js 18+
  • A modern browser
  • Any MCP-capable AI client

Architecture Details

See DESIGN.md for the full specification: tool contracts, WebSocket protocol, invariants, failure modes, and build plan.

License

Apache 2.0

Credits

TablaCognita was designed and built by Pete Marchetti (PStryder) at Technomancy Laboratories, with architectural review and first live edit by Kee (Claude Opus 4.6).

The page that knows. — tabla cognita

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选