typst-mcp 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -8
- package/dist/index.js +1 -0
- package/dist/node-shim.js +5 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
# Typst Web MCP
|
|
3
|
+
# Typst Web MCP
|
|
4
4
|
|
|
5
|
-
**Model Context Protocol (MCP)
|
|
5
|
+
**Model Context Protocol (MCP) server for [`https://typst.app`](https://typst.app) — cloud projects, Yjs CRDT editing, and Typst compiler diagnostics**
|
|
6
|
+
|
|
7
|
+
Install from npm as [`typst-mcp`](https://www.npmjs.com/package/typst-mcp). Source repo: [`typst-web-mcp`](https://github.com/caphefalumi/typst-web-mcp).
|
|
6
8
|
|
|
7
9
|
[](https://www.npmjs.com/package/typst-mcp)
|
|
10
|
+
[](https://www.npmjs.com/package/typst-mcp)
|
|
8
11
|
[](./LICENSE)
|
|
12
|
+
[](https://github.com/caphefalumi/typst-web-mcp/actions/workflows/ci.yml)
|
|
9
13
|
[](https://github.com/caphefalumi/typst-web-mcp/actions/workflows/npm-publish.yml)
|
|
10
14
|
[](https://bun.sh)
|
|
11
15
|
[](https://www.typescriptlang.org/)
|
|
@@ -33,7 +37,7 @@
|
|
|
33
37
|
|
|
34
38
|
```mermaid
|
|
35
39
|
flowchart LR
|
|
36
|
-
Agent["AI Agent\n(Pi / Claude / Cursor)"] <-->|"JSON-RPC (stdio)"| MCP["typst-
|
|
40
|
+
Agent["AI Agent\n(Pi / Claude / Cursor)"] <-->|"JSON-RPC (stdio)"| MCP["typst-mcp\n(Node / TypeScript)"]
|
|
37
41
|
MCP <-->|"GraphQL (/v1/graphql)\n+ X-Typst-Preflight"| API["https://api.typst.app"]
|
|
38
42
|
MCP <-->|"REST Yjs & Blobs\n(/v1/files/:pid/:fid/yjs)"| API
|
|
39
43
|
MCP <-->|"Binary lib0 WebSocket\n(wss://api.typst.app/editing/v3)"| WS["typst.app Real-Time Sync"]
|
|
@@ -82,7 +86,7 @@ See [`docs/PROTOCOL.md`](./docs/PROTOCOL.md) for the complete reverse-engineered
|
|
|
82
86
|
npx -y typst-mcp
|
|
83
87
|
```
|
|
84
88
|
|
|
85
|
-
|
|
89
|
+
Runs the published [`typst-mcp`](https://www.npmjs.com/package/typst-mcp) package (Node `>= 18`). Use the same command in MCP config below. `-y` skips the npx install prompt.
|
|
86
90
|
|
|
87
91
|
**From source (development):**
|
|
88
92
|
|
|
@@ -125,15 +129,25 @@ bun run build
|
|
|
125
129
|
# Typecheck with strict TypeScript
|
|
126
130
|
bun run typecheck
|
|
127
131
|
|
|
128
|
-
#
|
|
132
|
+
# Full suite (includes test/smoke.test.ts: dist bin + npx -y typst-mcp)
|
|
129
133
|
bun test
|
|
134
|
+
|
|
135
|
+
# Smoke only (same as pi npx MCP config)
|
|
136
|
+
bun run test:smoke
|
|
130
137
|
```
|
|
131
138
|
|
|
139
|
+
Push/PR to `main` runs [`.github/workflows/ci.yml`](./.github/workflows/ci.yml) (`bun ci`, build, typecheck, `bun test`).
|
|
140
|
+
|
|
132
141
|
### Publishing to npm
|
|
133
142
|
|
|
134
|
-
|
|
143
|
+
Same flow as [Canvas-CLI](https://github.com/caphefalumi/Canvas-CLI):
|
|
144
|
+
|
|
145
|
+
1. Bump `version` in `package.json` (must not match a version already on npm).
|
|
146
|
+
2. Commit, push, and create a GitHub **Release** for that tag — or run **Actions → Publish → Run workflow** (`workflow_dispatch`).
|
|
147
|
+
|
|
148
|
+
[`.github/workflows/npm-publish.yml`](./.github/workflows/npm-publish.yml) runs the same checks as CI (`bun test`, including smoke) in a `test` job; the `publish` job runs only if that passes, on the `npm-publish` environment: `bun ci`, `bun run build`, then `npm publish --access public` via [npm trusted publishing](https://docs.npmjs.com/trusted-publishers) (OIDC). The publish step clears `NODE_AUTH_TOKEN` so the CLI uses GitHub OIDC instead of a stale token from `setup-node`.
|
|
135
149
|
|
|
136
|
-
**
|
|
150
|
+
**Trusted publisher (maintainers):** package [`typst-mcp`](https://www.npmjs.com/package/typst-mcp) → Settings → Trusted publishing → GitHub Actions — user/org `caphefalumi`, repo `typst-web-mcp`, workflow file `npm-publish.yml`, environment `npm-publish`, allow **npm publish**.
|
|
137
151
|
|
|
138
152
|
### Project Structure
|
|
139
153
|
|
|
@@ -153,7 +167,7 @@ typst-web-mcp/
|
|
|
153
167
|
│ │ └── typst-client.ts # TypstCloudClient (REST, GraphQL, WebSocket v3, Compiler facade)
|
|
154
168
|
│ ├── tools/
|
|
155
169
|
│ │ └── definitions.ts # MCP JSON Schema definitions for all 16 tools
|
|
156
|
-
│ └── index.ts # MCP stdio server entrypoint
|
|
170
|
+
│ └── index.ts # MCP stdio server entrypoint (dev); npm bin runs dist/index.js
|
|
157
171
|
├── test/
|
|
158
172
|
│ └── typst-mcp.test.ts # 7 test suites (57 assertions) covering codecs, CRDTs & E2E
|
|
159
173
|
├── LICENSE # MIT License
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typst-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for https://typst.app/ cloud projects, Yjs real-time text editing, asset management, and Typst compiler diagnostics",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"dev": "bun run src/index.ts",
|
|
42
42
|
"typecheck": "tsc --noEmit",
|
|
43
43
|
"test": "bun test",
|
|
44
|
+
"test:smoke": "bun test test/smoke.test.ts",
|
|
44
45
|
"prepublishOnly": "bun run build"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|