@zaai-dev/mcp 0.3.1 → 0.6.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/LICENSE +21 -21
- package/README.md +54 -13
- package/dist/bin/http.js +449 -37
- package/dist/bin/http.js.map +1 -1
- package/dist/bin/stdio.js +449 -37
- package/dist/bin/stdio.js.map +1 -1
- package/package.json +57 -56
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Zaai Studio
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zaai Studio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Zaai Dev MCP
|
|
2
2
|
|
|
3
|
-
Model Context Protocol server for the [Zaai Dev](https://
|
|
3
|
+
Model Context Protocol server for the [Zaai Dev](https://zaaidev.com) platform. Exposes your captured design references to MCP-compatible AI tools — Claude Code, Claude Desktop, Cursor, Continue, Cline, anything else that speaks MCP.
|
|
4
4
|
|
|
5
5
|
After a one-time token paste, prompts like *"list my last 5 captures tagged hero and show me their palettes"* call the workspace directly and pull back real data.
|
|
6
6
|
|
|
@@ -9,8 +9,8 @@ After a one-time token paste, prompts like *"list my last 5 captures tagged hero
|
|
|
9
9
|
You need:
|
|
10
10
|
|
|
11
11
|
- **Node 20 or newer** (`node --version`)
|
|
12
|
-
- A **Zaai Dev workspace account** at https://
|
|
13
|
-
- An **MCP token** — mint one at https://
|
|
12
|
+
- A **Zaai Dev workspace account** at https://zaaidev.com
|
|
13
|
+
- An **MCP token** — mint one at https://zaaidev.com/dev/settings/tokens (pick "mcp" as the kind). The token-mint screen also shows the config snippets below pre-filled with your secret.
|
|
14
14
|
|
|
15
15
|
### Claude Desktop
|
|
16
16
|
|
|
@@ -34,7 +34,7 @@ Add to `claude_desktop_config.json` — merge into the existing `mcpServers` blo
|
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
Restart Claude Desktop. The
|
|
37
|
+
Restart Claude Desktop. The 23 tools below appear in the slash-command picker.
|
|
38
38
|
|
|
39
39
|
### Cursor
|
|
40
40
|
|
|
@@ -77,9 +77,35 @@ ZAAI_HTTP_PORT=3001 \
|
|
|
77
77
|
|
|
78
78
|
**Single-tenant in v1.5** — one process serves one workspace token. Run one process per token if you need multi-tenant, or wait for v2 which adds per-request token binding. Most "I want HTTP" use cases are single-tenant anyway.
|
|
79
79
|
|
|
80
|
+
## Verify it's working
|
|
81
|
+
|
|
82
|
+
Three checks, cheapest first — climb until one fails and that's your problem:
|
|
83
|
+
|
|
84
|
+
1. **`health`** — no token, no network, no credits. Confirms the server process launched and speaks MCP. It's the first thing to click in the MCP Inspector; from an agent, ask *"call the zaai-dev health tool"*. Returns `{ ok, version, node, uptimeSeconds }`.
|
|
85
|
+
2. **`whoami`** — needs your token, still free. The first call that reaches the workspace: it returns your `userId`, `orgId`, project scope, and credit balance. If this works, your token is valid and you're fully connected. Ask *"call whoami"*.
|
|
86
|
+
3. **`list_captures`** — needs token **and** real data (costs 1 credit). Returns your newest captures; if ids come back, the whole pipeline works end to end.
|
|
87
|
+
|
|
88
|
+
Reading the result:
|
|
89
|
+
|
|
90
|
+
- `health` works but `whoami` returns **`Unauthorized`** → the token is wrong/revoked, or you pasted an **extension** token (`zaai_ext_*`) instead of an **MCP** one (`zaai_mcp_*`). Mint a fresh `mcp` token at [/dev/settings/tokens](https://zaaidev.com/dev/settings/tokens) and restart your client.
|
|
91
|
+
- `health` itself doesn't run → the server never booted. Almost always a missing/blank `ZAAI_API_TOKEN` in your client config (the process fails fast on startup). Check the env block, then restart.
|
|
92
|
+
|
|
93
|
+
No client handy? Smoke-test the stdio binary straight from a terminal — initialize and call `health` over JSON-RPC (any non-empty `zaai_mcp_*` value gets you past the boot check, since `health` never hits the network):
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
printf '%s\n' \
|
|
97
|
+
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"0"}}}' \
|
|
98
|
+
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
|
|
99
|
+
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"health","arguments":{}}}' \
|
|
100
|
+
| ZAAI_API_TOKEN=zaai_mcp_smoke npx -y @zaai-dev/mcp
|
|
101
|
+
# → {"ok":true,"version":"0.6.1", ...}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
See [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) for the full first-install checklist.
|
|
105
|
+
|
|
80
106
|
## Tools
|
|
81
107
|
|
|
82
|
-
All tools except `health` need a valid token. All tools except `health` and `whoami` charge credits per successful call (your workspace plan determines the monthly grant — see [pricing](https://
|
|
108
|
+
All tools except `health` need a valid token. All tools except `health` and `whoami` charge credits per successful call (your workspace plan determines the monthly grant — see [pricing](https://zaaidev.com/dev/pricing)).
|
|
83
109
|
|
|
84
110
|
### Captures (org-wide)
|
|
85
111
|
|
|
@@ -94,21 +120,33 @@ All tools except `health` need a valid token. All tools except `health` and `who
|
|
|
94
120
|
| `get_html` | Just the HTML. Page → full HTML; element → outerHTML; composite → concat with markers. | 1 |
|
|
95
121
|
| `get_animation` | Just the animation data — CSS transitions, keyframes, library hints. | 1 |
|
|
96
122
|
| `get_media` | Just the media inventory — videos, images, backgrounds, carousels. | 1 |
|
|
123
|
+
| `get_structure` | Just the Layer-Explorer teardown — the structure map (nodes w/ depth, rects, selectors, components, flags). Page/element → one map; composite → per-element. | 1 |
|
|
97
124
|
|
|
98
125
|
### Brand brief + references (project-scoped, v0.2.0+)
|
|
99
126
|
|
|
100
|
-
These tools each take a `project_id` arg (find via the workspace at `
|
|
127
|
+
These tools each take a `project_id` arg (find via the workspace at `zaaidev.com/dev/projects/<id>` — the UUID is in the URL). The five brief-read tools also accept an optional `brief_id` to target a specific brief on projects that have more than one; omit it for the project's default brand-identity brief.
|
|
101
128
|
|
|
102
129
|
| Tool | What it does | Cost |
|
|
103
130
|
|---|---|---|
|
|
104
|
-
| `
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
131
|
+
| `list_briefs` | Every brief on a project — id, type, name, status, current-version metadata. Call first, then pass `brief_id`. | 1 |
|
|
132
|
+
| `get_brand_brief` | Full published brief: positioning, values, voice, audience, design intent, decisions. Optional `brief_id`. | 1 |
|
|
133
|
+
| `get_voice` | Voice slice only — one-liner, tone descriptors, do/don't say, example phrases. Optional `brief_id`. | 1 |
|
|
134
|
+
| `get_audience` | Primary + secondary segments, needs, channels. Optional `brief_id`. | 1 |
|
|
135
|
+
| `get_design_intent` | Descriptors + anti-descriptors + inspiration summary. Optional `brief_id`. | 1 |
|
|
136
|
+
| `get_brand_tokens` | Colors, fonts, radius, shadow scales. Optional `brief_id`. | 1 |
|
|
109
137
|
| `get_decisions` | Paginated decisions log with attribution + brief_field links. | 1 |
|
|
138
|
+
| `log_decision` | Record a brand/design decision (what, why, optional brief_field). Write tool. | 1 |
|
|
110
139
|
| `get_references` | Paginated project-scoped reference list. | 1 |
|
|
111
140
|
| `search_references` | Keyword search within a project's references. | 1 |
|
|
141
|
+
| `add_reference` | Create a URL-only reference capture from a link. Write tool. | 5 |
|
|
142
|
+
|
|
143
|
+
### Docs / block-docs (project-scoped, v0.3.0+)
|
|
144
|
+
|
|
145
|
+
| Tool | What it does | Cost |
|
|
146
|
+
|---|---|---|
|
|
147
|
+
| `list_docs` | Every doc on a project — id, type, name, status, current-version metadata. Friendly alias of `list_briefs`. | 1 |
|
|
148
|
+
| `get_doc` | A doc as an agent-ready block list — text + capture references with role/treatment, the captured **`code`** (element outerHTML + computed CSS + build tokens, or page HTML) to build from real values, and the sign-off (approval) signal. Omit `doc_id` for the brand-identity doc. | 1 |
|
|
149
|
+
| `get_project_bundle` | The whole project in one call — project meta, all docs (as above), and capture summaries. Can be large. | 1 |
|
|
112
150
|
|
|
113
151
|
Plus the `zaai-capture://{id}` resource template — attach individual captures to a conversation via the resource picker.
|
|
114
152
|
|
|
@@ -117,13 +155,16 @@ Plus the `zaai-capture://{id}` resource template — attach individual captures
|
|
|
117
155
|
| Error class | Meaning | Action |
|
|
118
156
|
|---|---|---|
|
|
119
157
|
| `Unauthorized` | Token invalid, revoked, or wrong kind | Mint a fresh `mcp` token, update your config, restart |
|
|
120
|
-
| `InsufficientCredits` | Out of credits for the month | [Top up](https://
|
|
158
|
+
| `InsufficientCredits` | Out of credits for the month | [Top up](https://zaaidev.com/dev/settings/billing) or wait for the monthly grant |
|
|
121
159
|
| `CaptureNotFound` | id doesn't exist OR is in a project the token can't see | `list_captures` to find valid ids |
|
|
122
160
|
| `InvalidCaptureId` / `InvalidProjectId` | id isn't a UUID | Pass a UUID from `list_captures` / the workspace URL |
|
|
123
161
|
| `ProjectNotFound` | project_id isn't in your org | Check the id, or that the token's project scope allows this project |
|
|
124
162
|
| `ProjectArchived` | Project exists but is archived | Unarchive in the workspace or use a different project |
|
|
125
163
|
| `OutOfScope` | Token is scoped to specific projects + this isn't one of them | Mint a token without project scope, or add this project to the existing token |
|
|
126
|
-
| `
|
|
164
|
+
| `wrong_brief_type` | A brief tool was called against a brief of the wrong type | Use `list_briefs` to find a brief of the expected type, pass its `brief_id` |
|
|
165
|
+
| `InvalidDocId` | `get_doc` was passed a malformed doc id | Use `list_docs` for valid ids, or omit `doc_id` for the default doc |
|
|
166
|
+
| `RateLimited` | Exceeded ~60 calls/min for this token | The server already retried with backoff — wait a moment before retrying |
|
|
167
|
+
| `UnknownCaptureField` | Hit a focused-getter route with an unknown field | Use one of: `palette`, `html`, `animation`, `media`, `structure` |
|
|
127
168
|
|
|
128
169
|
Errors return as `isError: true` in the tool result so the LLM can read and act on them.
|
|
129
170
|
|