关于 TablaCognita
TablaCognita 是面向使用 MCP 兼容 AI 客户端协作写作用户的浏览器 Markdown 编辑器。它支持按章节编辑和撤销,同时将文档保存在浏览器中,并通过无状态中继传递消息。
主要功能
- 01浏览器内实时 Markdown 编辑
- 02通过 17 个 MCP 工具读写
- 03按章节编辑并保持稳定 ID
- 04可撤销 AI 修改并保存快照
- 05通过锁和上下文协调编辑
适用场景
- 01让 AI 修改选中的段落
- 02通过 MCP 客户端编辑指定章节
- 03恢复浏览器保存的文档快照
MCP 相关
MCP 服务提供 17 个用于读取、编辑、协调和管理文档的工具,并通过 WebSocket 中继与浏览器编辑器通信。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://app.tablacognita.com/mcpclaude mcp add --transport http pstryder-tablacognita https://app.tablacognita.com/mcp{"mcpServers":{"pstryder-tablacognita":{"type":"http","url":"https://app.tablacognita.com/mcp"}}}在 Cursor 中打开{"servers":{"pstryder-tablacognita":{"type":"http","url":"https://app.tablacognita.com/mcp"}}}在 VS Code 中打开{"mcpServers":{"pstryder-tablacognita":{"type":"http","url":"https://app.tablacognita.com/mcp"}}}{"mcpServers":{"pstryder-tablacognita":{"serverUrl":"https://app.tablacognita.com/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
https://app.tablacognita.com/mcp需要授权工具
详细介绍
TablaCognita
与任意 AI 协同创作。在浏览器中完成。数据不会存储在任何人的服务器上。
TablaCognita 是一款基于浏览器的 Markdown 编辑器,AI 是其中的一等参与者,而非后来附加到文本框上的功能。选中文本并发送给 AI。实时查看编辑结果。随时撤销。AI 通过 MCP 工具查看文档——这与 Claude Desktop、Cursor 及所有其他支持 MCP 的客户端使用的是同一协议。
文档保存在你的浏览器中。中继服务只是无状态的传输通道。没有人会存储你的文字。
工作原理
┌──────────────┐ 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 │
└──────────────────┘
AI 通过 17 个 MCP 工具读取和写入内容。编辑器负责章节定位、模糊文本匹配、冲突避免和撤销。中继服务只负责传递消息。仅此而已。
快速开始
git clone https://github.com/pstryder/tablacognita.git
cd tablacognita
npm install
npm start
在浏览器中打开 http://localhost:3000。编辑器即可使用。
连接你的 MCP 客户端。对于 Claude Desktop,请将以下内容添加到配置中:
{
"mcpServers": {
"tabla-cognita": {
"command": "node",
"args": ["server/index.js", "--transport", "stdio"],
"cwd": "/path/to/tablacognita"
}
}
}
现在,你的 AI 可以读取文档、编辑章节、替换文本,也可以响应你从编辑器发送给它的选区。
AI 可以做什么
读取 — read_document、get_structure、get_section。AI 可以查看完整文档、章节大纲,或通过标题名称或稳定 ID 查看单个章节。
写入 — replace_section、replace_text、insert_after、append。支持自动锁定的章节级编辑。支持模糊文本匹配,可跨 Markdown 格式进行匹配(搜索“bold text”即可匹配 **bold text**)。替换整个文档需要你在浏览器中确认。
协调 — request_edit_lock、release_lock、get_cursor_context、get_dirty_regions、poll_context。AI 可以知道光标位置、上次查看后你编辑过哪些章节,还可以为多步操作锁定章节。所有锁都有 TTL,不会永远保持锁定状态。
管理 — open_document、snapshot、restore_snapshot、get_revision_history。命名检查点保存在浏览器的 IndexedDB 中。一次工具调用即可恢复任意快照。
关键设计决策
**浏览器是事实来源。**中继服务不保存任何文档状态。即使中继服务重启,文档仍保存在你的浏览器中。AI 重新连接后即可继续工作。
**章节 ID 保持稳定。**将标题从“Introduction”改为“Overview”,章节 ID 也不会改变。AI 始终可以找到对应章节。
**Agent 的编辑可以撤销。**每次 AI 编辑都会经过 CodeMirror 的事务系统。撤销 AI 编辑时,Ctrl+Z 的效果与你自己编辑时完全相同。
**锁是意图信号,而非互斥锁。**编辑期间的自动锁定是原子且不可见的。用于多步操作的显式锁定有 TTL,而且绝不会阻止你操作——它只是轻柔地提示 AI 正在处理某个章节。
**通知采用即发即弃方式。**当你切换章节、重命名标题或删除内容时,编辑器会通知 AI。如果传输方式不支持通知,AI 可以改为轮询。没有任何功能依赖通知一定送达。
**数据不会离开你的浏览器。**文档保存在 CodeMirror 的状态中。快照保存在 IndexedDB 中。中继服务是一个不存储数据的 WebSocket 桥接器。没有任何数据可供传票调取。
项目结构
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
运行测试
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
传输模式
npm start # HTTP transport (default, port 3000)
npm run start:stdio # stdio transport (for local MCP clients)
npm start -- --port 8080 # Custom port
要求
- Node.js 18+
- 现代浏览器
- 任意支持 MCP 的 AI 客户端
架构详情
完整规范请参阅 DESIGN.md:工具契约、WebSocket 协议、不变量、故障模式和构建计划。
许可证
Apache 2.0
致谢
TablaCognita 由 Pete Marchetti (PStryder) 在 Technomancy Laboratories 设计并构建,Kee (Claude Opus 4.6) 参与了架构评审并完成了首次实时编辑。
知晓一切的页面。—— tabla cognita
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。