@_davideast/stitch-mcp 0.3.2 → 0.4.0
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
CHANGED
|
@@ -21,16 +21,16 @@ npx @_davideast/stitch-mcp site -p <project-id>
|
|
|
21
21
|
|
|
22
22
|
## Features
|
|
23
23
|
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
24
|
+
- **Preview designs locally** — serve all screens from a project on a Vite dev server
|
|
25
|
+
- **Build an Astro site from your designs** — map screens to routes and generate a deployable project
|
|
26
|
+
- **Give your agent design context** — proxy Stitch tools to your IDE's coding agent with automatic token refresh
|
|
27
|
+
- **Explore your design data** — browse projects, screens, and metadata in the terminal or via CLI
|
|
28
|
+
- **Browse projects in your terminal** — navigate screens interactively with copy, preview, and open actions
|
|
29
|
+
- **Set up in one command** — guided wizard handles gcloud, auth, and MCP client configuration
|
|
30
30
|
|
|
31
31
|
## MCP integration
|
|
32
32
|
|
|
33
|
-
Add this to your MCP client config to give coding agents access to Stitch tools
|
|
33
|
+
Add this to your MCP client config to give coding agents access to Stitch tools:
|
|
34
34
|
|
|
35
35
|
```json
|
|
36
36
|
{
|
|
@@ -45,161 +45,9 @@ Add this to your MCP client config to give coding agents access to Stitch tools
|
|
|
45
45
|
|
|
46
46
|
Supported clients: VS Code, Cursor, Claude Code, Gemini CLI, Codex, OpenCode.
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## Installation
|
|
51
|
-
|
|
52
|
-
Run directly with `npx` (no install needed):
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npx @_davideast/stitch-mcp <command>
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Or install globally:
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
npm install -g @_davideast/stitch-mcp
|
|
62
|
-
stitch-mcp <command>
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Commands
|
|
66
|
-
|
|
67
|
-
### `init` — Set up authentication and MCP config
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
npx @_davideast/stitch-mcp init [options]
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
| Option | Description |
|
|
74
|
-
|--------|-------------|
|
|
75
|
-
| `--local` | Install gcloud locally to project directory instead of user home |
|
|
76
|
-
| `-y, --yes` | Auto-approve verification prompts |
|
|
77
|
-
| `--defaults` | Use default values for prompts |
|
|
78
|
-
| `-c, --client <client>` | MCP client to configure (antigravity, vscode, cursor, claude-code, gemini-cli, codex, opencode) |
|
|
79
|
-
| `-t, --transport <type>` | Transport type (`http` or `stdio`) |
|
|
80
|
-
|
|
81
|
-
Walks through a setup wizard: MCP client selection, gcloud installation, OAuth login, application credentials, project selection, IAM permissions, Stitch API enablement, connection test, and config generation.
|
|
82
|
-
|
|
83
|
-
### `doctor` — Verify configuration health
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
npx @_davideast/stitch-mcp doctor [options]
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
| Option | Description |
|
|
90
|
-
|--------|-------------|
|
|
91
|
-
| `--verbose` | Show detailed error information |
|
|
92
|
-
|
|
93
|
-
Checks that gcloud is installed, user is authenticated, Application Default Credentials exist, a GCP project is configured, and the Stitch API is reachable.
|
|
48
|
+
### Virtual tools
|
|
94
49
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
npx @_davideast/stitch-mcp serve -p <project-id>
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
| Option | Description |
|
|
102
|
-
|--------|-------------|
|
|
103
|
-
| `-p, --project <id>` | **Required.** Project ID |
|
|
104
|
-
|
|
105
|
-
Fetches all screens from a Stitch project and serves them on a local Vite dev server. Each screen gets its own route for previewing rendered HTML in the browser.
|
|
106
|
-
|
|
107
|
-
### `screens` — Explore screens in a project
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
npx @_davideast/stitch-mcp screens -p <project-id>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
| Option | Description |
|
|
114
|
-
|--------|-------------|
|
|
115
|
-
| `-p, --project <id>` | **Required.** Project ID |
|
|
116
|
-
|
|
117
|
-
Opens an interactive terminal UI for browsing all screens in a project.
|
|
118
|
-
|
|
119
|
-
### `site` — Build an Astro site from screens
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
npx @_davideast/stitch-mcp site -p <project-id> [options]
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
| Option | Description |
|
|
126
|
-
|--------|-------------|
|
|
127
|
-
| `-p, --project <id>` | **Required.** Project ID |
|
|
128
|
-
| `-o, --output <dir>` | Output directory (default: `.`) |
|
|
129
|
-
| `-e, --export` | Export screen-to-route config as `build_site` JSON (no interactive UI) |
|
|
130
|
-
|
|
131
|
-
Launches an interactive screen-to-route mapper, then generates an Astro project with the following structure:
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
├── package.json
|
|
135
|
-
├── astro.config.mjs
|
|
136
|
-
└── src/
|
|
137
|
-
├── layouts/Layout.astro
|
|
138
|
-
└── pages/
|
|
139
|
-
├── index.astro # screen mapped to "/"
|
|
140
|
-
└── about.astro # screen mapped to "/about"
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
External assets (fonts, images) are downloaded to `public/assets/` with URLs rewritten to local paths.
|
|
144
|
-
|
|
145
|
-
Press `e` in the interactive builder to export the current screen-to-route config as JSON to stdout (useful for piping into `build_site`).
|
|
146
|
-
|
|
147
|
-
### `view` — Interactive resource browser
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
npx @_davideast/stitch-mcp view [options]
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
| Option | Description |
|
|
154
|
-
|--------|-------------|
|
|
155
|
-
| `--projects` | List all projects |
|
|
156
|
-
| `--name <name>` | Resource name to view |
|
|
157
|
-
| `--sourceScreen <name>` | Source screen resource name |
|
|
158
|
-
| `--project <id>` | Project ID |
|
|
159
|
-
| `--screen <id>` | Screen ID |
|
|
160
|
-
| `--serve` | Serve the screen via local server |
|
|
161
|
-
|
|
162
|
-
Browse Stitch resources in a navigable JSON tree. Supports drilling into nested objects and performing actions on selected nodes.
|
|
163
|
-
|
|
164
|
-
**Keyboard shortcuts:**
|
|
165
|
-
|
|
166
|
-
| Key | Action |
|
|
167
|
-
|-----|--------|
|
|
168
|
-
| `↑` / `↓` | Navigate up/down |
|
|
169
|
-
| `Enter` | Expand/collapse or drill into nested object |
|
|
170
|
-
| `Backspace` | Go back one level |
|
|
171
|
-
| `c` | Copy selected value to clipboard |
|
|
172
|
-
| `cc` | Extended copy (downloads content for URLs) |
|
|
173
|
-
| `s` | Preview HTML — serves `htmlCode` in-memory and opens browser |
|
|
174
|
-
| `o` | Open project in Stitch web app |
|
|
175
|
-
| `q` | Quit viewer |
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
# Browse all projects
|
|
179
|
-
npx @_davideast/stitch-mcp view --projects
|
|
180
|
-
|
|
181
|
-
# View a specific screen
|
|
182
|
-
npx @_davideast/stitch-mcp view --project <project-id> --screen <screen-id>
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### `tool` — Invoke MCP tools directly
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
npx @_davideast/stitch-mcp tool [toolName] [options]
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
| Option | Description |
|
|
192
|
-
|--------|-------------|
|
|
193
|
-
| `-s, --schema` | Show tool arguments and schema |
|
|
194
|
-
| `-d, --data <json>` | JSON data (like `curl -d`) |
|
|
195
|
-
| `-f, --data-file <path>` | Read JSON from file (like `curl -d @file`) |
|
|
196
|
-
| `-o, --output <format>` | Output format: `json`, `pretty`, `raw` (default: `pretty`) |
|
|
197
|
-
|
|
198
|
-
Calls any MCP tool (including virtual tools) from the command line. Run without a tool name to list available tools.
|
|
199
|
-
|
|
200
|
-
**Virtual tools:**
|
|
201
|
-
|
|
202
|
-
These tools are not part of the upstream Stitch MCP server. They are added by the proxy and combine multiple API calls into higher-level operations for coding agents.
|
|
50
|
+
The proxy exposes these tools alongside the upstream Stitch MCP tools. They combine multiple API calls into higher-level operations for coding agents:
|
|
203
51
|
|
|
204
52
|
- **`build_site`** — Builds a site from a project by mapping screens to routes. Returns the design HTML for each page.
|
|
205
53
|
- **`get_screen_code`** — Retrieves a screen and downloads its HTML code content.
|
|
@@ -231,72 +79,62 @@ npx @_davideast/stitch-mcp tool build_site -d '{
|
|
|
231
79
|
}'
|
|
232
80
|
```
|
|
233
81
|
|
|
234
|
-
|
|
82
|
+
## Explore your designs
|
|
83
|
+
|
|
84
|
+
Use `view` and `tool` to browse your design data and understand what's available before prompting agents.
|
|
235
85
|
|
|
236
86
|
```bash
|
|
237
|
-
|
|
238
|
-
|
|
87
|
+
# Browse all projects
|
|
88
|
+
npx @_davideast/stitch-mcp view --projects
|
|
239
89
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
| `--transport <type>` | Transport type: `stdio` or `sse` (default: `stdio`) |
|
|
243
|
-
| `--port <number>` | Port number (required for `sse`) |
|
|
244
|
-
| `--debug` | Enable debug logging to `/tmp/stitch-proxy-debug.log` |
|
|
90
|
+
# Inspect a specific screen
|
|
91
|
+
npx @_davideast/stitch-mcp view --project <project-id> --screen <screen-id>
|
|
245
92
|
|
|
246
|
-
|
|
93
|
+
# Invoke any MCP tool from the CLI
|
|
94
|
+
npx @_davideast/stitch-mcp tool [toolName]
|
|
95
|
+
```
|
|
247
96
|
|
|
248
|
-
|
|
97
|
+
Inside the `view` browser: `c` copies the selected value, `s` previews HTML in your browser, `o` opens the project in Stitch, and `q` quits. Use arrow keys to navigate and Enter to drill into nested data.
|
|
249
98
|
|
|
250
|
-
|
|
251
|
-
{
|
|
252
|
-
"mcpServers": {
|
|
253
|
-
"stitch": {
|
|
254
|
-
"command": "npx",
|
|
255
|
-
"args": ["@_davideast/stitch-mcp", "proxy"]
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
```
|
|
99
|
+
Run `tool` without a name to list all available tools, or with `-s` to see a tool's schema.
|
|
260
100
|
|
|
261
|
-
|
|
101
|
+
---
|
|
262
102
|
|
|
263
|
-
|
|
264
|
-
{
|
|
265
|
-
"mcpServers": {
|
|
266
|
-
"stitch": {
|
|
267
|
-
"command": "npx",
|
|
268
|
-
"args": ["@_davideast/stitch-mcp", "proxy", "--transport", "sse", "--port", "3100"]
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
```
|
|
103
|
+
## Installation
|
|
273
104
|
|
|
274
|
-
|
|
105
|
+
Run directly with `npx` (no install needed):
|
|
275
106
|
|
|
276
107
|
```bash
|
|
277
|
-
npx @_davideast/stitch-mcp
|
|
108
|
+
npx @_davideast/stitch-mcp <command>
|
|
278
109
|
```
|
|
279
110
|
|
|
280
|
-
|
|
281
|
-
|--------|-------------|
|
|
282
|
-
| `--force` | Skip confirmation prompts |
|
|
283
|
-
| `--clear-config` | Delete entire gcloud config directory |
|
|
284
|
-
|
|
285
|
-
Revokes both user authentication and Application Default Credentials.
|
|
286
|
-
|
|
287
|
-
### `snapshot` — Create UI snapshots
|
|
111
|
+
Or install globally:
|
|
288
112
|
|
|
289
113
|
```bash
|
|
290
|
-
|
|
114
|
+
npm install -g @_davideast/stitch-mcp
|
|
115
|
+
stitch-mcp <command>
|
|
291
116
|
```
|
|
292
117
|
|
|
293
|
-
|
|
294
|
-
|--------|-------------|
|
|
295
|
-
| `-c, --command <command>` | The command to snapshot (e.g. `init`) |
|
|
296
|
-
| `-d, --data <file>` | Path to JSON data file |
|
|
297
|
-
| `-s, --schema` | Print the data schema for the command |
|
|
118
|
+
## Commands
|
|
298
119
|
|
|
299
|
-
|
|
120
|
+
| Command | Description |
|
|
121
|
+
|---------|-------------|
|
|
122
|
+
| **Setup** | |
|
|
123
|
+
| `init` | Set up auth, gcloud, and MCP client config |
|
|
124
|
+
| `doctor` | Verify configuration health |
|
|
125
|
+
| `logout` | Revoke credentials |
|
|
126
|
+
| **Development** | |
|
|
127
|
+
| `serve -p <id>` | Preview project screens locally |
|
|
128
|
+
| `screens -p <id>` | Browse screens in terminal |
|
|
129
|
+
| `view` | Interactive resource browser |
|
|
130
|
+
| **Build** | |
|
|
131
|
+
| `site -p <id>` | Generate Astro project from screens |
|
|
132
|
+
| `snapshot` | Save screen state to file |
|
|
133
|
+
| **Integration** | |
|
|
134
|
+
| `tool [name]` | Invoke MCP tools from CLI |
|
|
135
|
+
| `proxy` | Run MCP proxy for agents |
|
|
136
|
+
|
|
137
|
+
Run any command with `--help` for full options.
|
|
300
138
|
|
|
301
139
|
## Authentication
|
|
302
140
|
|
|
@@ -351,23 +189,11 @@ Then use the proxy with `STITCH_USE_SYSTEM_GCLOUD=1`:
|
|
|
351
189
|
|
|
352
190
|
### "Permission Denied" errors
|
|
353
191
|
|
|
354
|
-
Ensure
|
|
355
|
-
- You have Owner or Editor role on the GCP project
|
|
356
|
-
- Billing is enabled on your project
|
|
357
|
-
- Stitch API is enabled
|
|
358
|
-
|
|
359
|
-
Run `doctor` to diagnose:
|
|
360
|
-
```bash
|
|
361
|
-
npx @_davideast/stitch-mcp doctor --verbose
|
|
362
|
-
```
|
|
192
|
+
Ensure you have Owner or Editor role, billing is enabled, and the Stitch API is enabled. Run `doctor --verbose` to diagnose.
|
|
363
193
|
|
|
364
194
|
### Authentication URL not appearing
|
|
365
195
|
|
|
366
|
-
The tool prints authentication URLs to the terminal with a 5-second timeout.
|
|
367
|
-
|
|
368
|
-
1. Check your terminal output carefully
|
|
369
|
-
2. The URL starts with `https://accounts.google.com`
|
|
370
|
-
3. If using proxy with `--debug`, check `/tmp/stitch-proxy-debug.log`
|
|
196
|
+
The tool prints authentication URLs to the terminal with a 5-second timeout. Look for a URL starting with `https://accounts.google.com`. If using proxy with `--debug`, check `/tmp/stitch-proxy-debug.log`.
|
|
371
197
|
|
|
372
198
|
### Already authenticated but showing logged in
|
|
373
199
|
|
|
@@ -379,23 +205,12 @@ npx @_davideast/stitch-mcp logout --force --clear-config
|
|
|
379
205
|
|
|
380
206
|
### API connection fails after setup
|
|
381
207
|
|
|
382
|
-
|
|
383
|
-
```bash
|
|
384
|
-
npx @_davideast/stitch-mcp doctor --verbose
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
2. Verify your project has billing enabled
|
|
388
|
-
|
|
389
|
-
3. Check that Stitch API is enabled:
|
|
390
|
-
```bash
|
|
391
|
-
gcloud services list --enabled | grep stitch
|
|
392
|
-
```
|
|
208
|
+
Run `doctor --verbose` to diagnose. Verify your project has billing and the Stitch API enabled. If issues persist, re-authenticate:
|
|
393
209
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
```
|
|
210
|
+
```bash
|
|
211
|
+
npx @_davideast/stitch-mcp logout --force
|
|
212
|
+
npx @_davideast/stitch-mcp init
|
|
213
|
+
```
|
|
399
214
|
|
|
400
215
|
### WSL / SSH / Docker environments
|
|
401
216
|
|