
TYPST-web-MCP 将 AI 编码和编写代理直接连接到协作云项目。它不再依赖脆弱的浏览器 DOM 抓取,而是实现了原生 typst.app 客户端协议:
概览
TYPST-web-MCP 将 AI 编码和编写代理直接连接到协作云项目。它不再依赖脆弱的浏览器 DOM 抓取,而是实现了原生 typst.app 客户端协议: - 解码并变异多人游戏中的Y.Doc(doc.getText(“文本”)状态向量,以便外科手术的编辑保留协作者的光标和版本历史。- 用REST /v1/files/:p rojectId/:fileId/yjs的持久性编码和解码lib0可变长度的二进制帧(Subscribe、TextUpdate、Pong、刷新、Presence、Cursor、Leave)。- 完整项目CRUD,文件树检查,重命名/移动,删除,以及二进制人物/资源上传(PNG、JPG、SVG、PDF、字体)。- 通过GET /v1/to-signin + POST /v1/auth/signin(__Http-typst-session)进行认证,支持持久会话缓存和挑战时自动Cookie/Playwright的备份。
概述(AI 翻译)
模型上下文协议(MCP)服务器用于https://typst.app云协作、实时YJS CRDT编辑和编译器诊断
-2EA44F?style=平面方形)
概述
typst-web-mcp 将 AI 编码和编写代理直接连接到协作的 typst.app 云项目。它不再依赖脆弱的浏览器 DOM 抓取,而是实现了原生的 typst.app 客户端协议:
- 原生YJS CRDT文本同步: 解码并变异多人游戏
Y.Doc(doc.getText("text"))状态向量,以便外科手术编辑保留协作者光标和版本历史。 - 二进制
/editing/v3WebSocket 线协议: 编码和解码lib0可变长度的二进制帧(Subscribe,TextUpdate,Pong,Refresh,Presence,Cursor,Leave),并具有REST/v1/files/:projectId/:fileId/yjs的持久性。 - GraphQL 和 REST 项目管理: 完整项目 CRUD、文件树检查、重命名/移动、删除以及二进制图形/资产上传([
PNG、JPG、SVG、PDF、字体)。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Installation
Add typst-mcp to your MCP client configuration (.pi/agent/mcp-adapter.json, claude_desktop_config.json, or .cursor/mcp.json).
Prerequisites
- Node.js
>= 18 - Typst CLI (optional:
typstonPATHfor local CLI compilation speed; if not installed,typst_get_diagnosticsautomatically uses Typst Web cloud compiler diagnostics)
Option 1: Normal (Standard)
Runs the published typst-mcp package (npx -y typst-mcp):
{
"mcpServers": {
"typst-mcp": {
"command": "npx",
"args": ["-y", "typst-mcp"],
"env": {
"TYPST_EMAIL": "[email protected]",
"TYPST_PASSWORD": "your-password"
}
}
}
}
Option 2: Always Latest
Bypasses local npx cache to automatically pull and run the newest release on launch (npx -y typst-mcp@latest):
{
"mcpServers": {
"typst-mcp": {
"command": "npx",
"args": ["-y", "typst-mcp@latest"],
"env": {
"TYPST_EMAIL": "[email protected]",
"TYPST_PASSWORD": "your-password"
}
}
}
}
Overview
typst-web-mcp connects AI coding and writing agents directly to collaborative typst.app cloud projects. Instead of relying on brittle browser DOM scraping, it implements the native typst.app client protocol:
- Native Yjs CRDT Text Sync: Decodes and mutates multiplayer
Y.Doc(doc.getText("text")) state vectors so surgical edits preserve collaborator cursors and version history. - Binary
/editing/v3WebSocket Wire Protocol: Encodes and decodeslib0variable-length binary frames (Subscribe,TextUpdate,Pong,Refresh,Presence,Cursor,Leave) with REST/v1/files/:projectId/:fileId/yjspersistence. - GraphQL & REST Project Management: Full project CRUD, file tree inspection, rename/move, delete, and binary figure/asset uploads (
PNG,JPG,SVG,PDF, fonts). - Direct Authentication + Fallback: Authenticates via
GET /v1/to-signin+POST /v1/auth/signin(__Http-typst-session), with persistent session caching and automatic cookie/Playwright fallback on challenge.
安装
npx -y typst-mcp配置
{
"mcpServers": {
"typst-mcp": {
"command": "npx",
"args": ["-y", "typst-mcp"],
"env": {
"TYPST_EMAIL": "[email protected]",
"TYPST_PASSWORD": "your-password"
}
}
}
}