mcp-stitch 0.1.0 → 0.1.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 +15 -0
- package/README.md +201 -2
- package/package.json +14 -3
- package/scripts/release.sh +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jason McAlpin
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,11 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
MCP server for Google Stitch. It exposes Stitch project, screen, design-system, generation, edit, variant, and artifact export tools over stdio for VS Code and other MCP-compatible agents.
|
|
4
4
|
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- [Links](#links)
|
|
8
|
+
- [Status](#status)
|
|
9
|
+
- [Requirements](#requirements)
|
|
10
|
+
- [Install](#install)
|
|
11
|
+
- [Environment](#environment)
|
|
12
|
+
- [VS Code Setup](#vs-code-setup)
|
|
13
|
+
- [Cursor Setup](#cursor-setup)
|
|
14
|
+
- [Continue Setup](#continue-setup)
|
|
15
|
+
- [Codex Setup](#codex-setup)
|
|
16
|
+
- [Tools](#tools)
|
|
17
|
+
- [Safety](#safety)
|
|
18
|
+
- [Development](#development)
|
|
19
|
+
- [Release Script](#release-script)
|
|
20
|
+
- [Contributing](#contributing)
|
|
21
|
+
- [Security](#security)
|
|
22
|
+
- [License](#license)
|
|
23
|
+
- [Publishing Checklist](#publishing-checklist)
|
|
24
|
+
|
|
25
|
+
## Links
|
|
26
|
+
|
|
27
|
+
- npm: https://www.npmjs.com/package/mcp-stitch
|
|
28
|
+
- GitHub: https://github.com/jasonmcalpin/mcp-stitch
|
|
29
|
+
- Google Stitch: https://stitch.withgoogle.com/
|
|
30
|
+
- Model Context Protocol: https://modelcontextprotocol.io/
|
|
31
|
+
|
|
32
|
+
## Status
|
|
33
|
+
|
|
34
|
+
Early public release. The server is usable, but the Stitch API surface may evolve.
|
|
35
|
+
|
|
5
36
|
## Requirements
|
|
6
37
|
|
|
7
38
|
- Node.js 20 or newer
|
|
8
39
|
- A Google API key with access to Stitch
|
|
9
40
|
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
Most MCP clients can run this package with `npx`:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx -y mcp-stitch
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
You normally do not run that command directly in a terminal. Add it to your MCP client configuration as shown below.
|
|
50
|
+
|
|
10
51
|
## Environment
|
|
11
52
|
|
|
12
53
|
Required:
|
|
@@ -80,8 +121,124 @@ For local development before publishing, build this repo and point VS Code at th
|
|
|
80
121
|
}
|
|
81
122
|
```
|
|
82
123
|
|
|
124
|
+
Open the VS Code Command Palette with `Cmd+Shift+P` on macOS or `Ctrl+Shift+P` on Windows/Linux, then run `MCP: List Servers` to start or restart the server.
|
|
125
|
+
|
|
83
126
|
After VS Code starts the server, ask your agent to call `stitch_status` to confirm the setup.
|
|
84
127
|
|
|
128
|
+
## Cursor Setup
|
|
129
|
+
|
|
130
|
+
In Cursor, open `Cursor Settings > MCP` and add a new server:
|
|
131
|
+
|
|
132
|
+
- Name: `stitch`
|
|
133
|
+
- Type / Transport: `stdio`
|
|
134
|
+
- Command: `npx`
|
|
135
|
+
- Arguments:
|
|
136
|
+
- `-y`
|
|
137
|
+
- `mcp-stitch`
|
|
138
|
+
|
|
139
|
+
Environment variables:
|
|
140
|
+
|
|
141
|
+
- `GOOGLE_API_KEY`: your Google API key
|
|
142
|
+
- `PROJECT_ROOT`: absolute path to the project where artifacts should be exported
|
|
143
|
+
|
|
144
|
+
Cursor may not expand VS Code variables like `${workspaceFolder}`, so use a real absolute path for `PROJECT_ROOT`, for example:
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
/Users/you/Workspace/my-project
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
You can also use Cursor's MCP JSON config:
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"mcpServers": {
|
|
155
|
+
"stitch": {
|
|
156
|
+
"command": "npx",
|
|
157
|
+
"args": ["-y", "mcp-stitch"],
|
|
158
|
+
"env": {
|
|
159
|
+
"GOOGLE_API_KEY": "your-key-here",
|
|
160
|
+
"PROJECT_ROOT": "/absolute/path/to/your/project"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
After adding it, ask Cursor Agent to call `stitch_status`.
|
|
168
|
+
|
|
169
|
+
## Continue Setup
|
|
170
|
+
|
|
171
|
+
Continue supports MCP servers in Agent mode. One local setup option is to create a file like:
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
.continue/mcpServers/stitch.yaml
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Example:
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
name: Stitch MCP
|
|
181
|
+
version: 0.1.0
|
|
182
|
+
schema: v1
|
|
183
|
+
|
|
184
|
+
mcpServers:
|
|
185
|
+
- name: Stitch
|
|
186
|
+
type: stdio
|
|
187
|
+
command: npx
|
|
188
|
+
args:
|
|
189
|
+
- "-y"
|
|
190
|
+
- "mcp-stitch"
|
|
191
|
+
env:
|
|
192
|
+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
193
|
+
PROJECT_ROOT: /absolute/path/to/your/project
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Use Continue's secrets or your local environment for `GOOGLE_API_KEY`; do not commit a literal key.
|
|
197
|
+
|
|
198
|
+
## Codex Setup
|
|
199
|
+
|
|
200
|
+
In the Codex app, add a new MCP server with the `+` button:
|
|
201
|
+
|
|
202
|
+
- Name: `stitch`
|
|
203
|
+
- Transport: `STDIO`
|
|
204
|
+
- Command to launch: `npx`
|
|
205
|
+
- Arguments:
|
|
206
|
+
- `-y`
|
|
207
|
+
- `mcp-stitch`
|
|
208
|
+
|
|
209
|
+
Environment variables:
|
|
210
|
+
|
|
211
|
+
- `GOOGLE_API_KEY`: your Google API key
|
|
212
|
+
- `PROJECT_ROOT`: absolute path to the project where artifacts should be exported
|
|
213
|
+
|
|
214
|
+
Codex may not expand VS Code variables like `${workspaceFolder}`, so use a real absolute path for `PROJECT_ROOT`, for example:
|
|
215
|
+
|
|
216
|
+
```text
|
|
217
|
+
/Users/you/Workspace/my-project
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
After adding the server, restart or reconnect it and ask Codex to call `stitch_status`.
|
|
221
|
+
|
|
222
|
+
For Codex CLI or manual setup, add a stdio MCP server to your Codex config, usually:
|
|
223
|
+
|
|
224
|
+
```text
|
|
225
|
+
~/.codex/config.toml
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Example:
|
|
229
|
+
|
|
230
|
+
```toml
|
|
231
|
+
[mcp_servers.stitch]
|
|
232
|
+
command = "npx"
|
|
233
|
+
args = ["-y", "mcp-stitch"]
|
|
234
|
+
|
|
235
|
+
[mcp_servers.stitch.env]
|
|
236
|
+
GOOGLE_API_KEY = "your-key-here"
|
|
237
|
+
PROJECT_ROOT = "/absolute/path/to/your/project"
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Keep this in your local Codex config if it contains a real API key.
|
|
241
|
+
|
|
85
242
|
## Tools
|
|
86
243
|
|
|
87
244
|
- `stitch_status`
|
|
@@ -103,6 +260,15 @@ After VS Code starts the server, ask your agent to call `stitch_status` to confi
|
|
|
103
260
|
|
|
104
261
|
Mutating tools require `confirm: true`.
|
|
105
262
|
|
|
263
|
+
## Safety
|
|
264
|
+
|
|
265
|
+
- Secrets are read from environment variables and are not printed by `stitch_status`.
|
|
266
|
+
- `STITCH_API_BASE_URL` defaults to Google's Stitch MCP endpoint.
|
|
267
|
+
- Artifact export paths are constrained to `PROJECT_ROOT` or `STITCH_OUTPUT_DIR`.
|
|
268
|
+
- Mutating Stitch tools require `confirm: true`.
|
|
269
|
+
|
|
270
|
+
Do not commit `.env`, generated artifact bundles, or Stitch output directories. This repo's `.gitignore` excludes the common local output paths.
|
|
271
|
+
|
|
106
272
|
## Development
|
|
107
273
|
|
|
108
274
|
```bash
|
|
@@ -111,12 +277,45 @@ npm run build
|
|
|
111
277
|
npm run dev
|
|
112
278
|
```
|
|
113
279
|
|
|
114
|
-
##
|
|
280
|
+
## Release Script
|
|
281
|
+
|
|
282
|
+
Maintainers can publish a release and push the matching Git commit/tag with:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
npm run release
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
The script defaults to a patch release. You can pass another npm version bump:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
npm run release -- minor
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
It runs `npm version`, builds, previews the npm package, asks for confirmation before publishing, then commits, tags, and pushes the release.
|
|
295
|
+
|
|
296
|
+
## Contributing
|
|
297
|
+
|
|
298
|
+
Issues and pull requests are welcome. Please keep changes focused on the Stitch MCP server surface, avoid committing generated Stitch artifacts, and run:
|
|
115
299
|
|
|
116
300
|
```bash
|
|
117
301
|
npm run build
|
|
118
302
|
npm pack --dry-run
|
|
119
|
-
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
before opening a pull request.
|
|
306
|
+
|
|
307
|
+
## Security
|
|
308
|
+
|
|
309
|
+
Please do not open public issues containing API keys, private project IDs, exported Stitch payloads, or other sensitive data. If a report requires private details, open a minimal issue first and note that you need a private disclosure path.
|
|
310
|
+
|
|
311
|
+
## License
|
|
312
|
+
|
|
313
|
+
ISC. See [LICENSE](LICENSE).
|
|
314
|
+
|
|
315
|
+
## Publishing Checklist
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
npm run release
|
|
120
319
|
```
|
|
121
320
|
|
|
122
321
|
See [docs/stitch-tools.md](docs/stitch-tools.md) for detailed tool inputs and Stitch contract notes.
|
package/package.json
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-stitch",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "MCP server for Google Stitch.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"mcp-stitch": "./dist/index.js"
|
|
8
8
|
},
|
|
9
|
+
"homepage": "https://github.com/jasonmcalpin/mcp-stitch#readme",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/jasonmcalpin/mcp-stitch.git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/jasonmcalpin/mcp-stitch/issues"
|
|
16
|
+
},
|
|
9
17
|
"files": [
|
|
10
18
|
"dist",
|
|
11
19
|
"docs/stitch-tools.md",
|
|
12
|
-
"README.md"
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"scripts/release.sh"
|
|
13
23
|
],
|
|
14
24
|
"scripts": {
|
|
15
25
|
"dev": "tsx src/index.ts",
|
|
16
26
|
"build": "tsc",
|
|
17
27
|
"prepack": "npm run build",
|
|
28
|
+
"release": "bash scripts/release.sh",
|
|
18
29
|
"start": "node dist/index.js"
|
|
19
30
|
},
|
|
20
31
|
"keywords": [
|
|
@@ -24,7 +35,7 @@
|
|
|
24
35
|
"google-stitch",
|
|
25
36
|
"vscode"
|
|
26
37
|
],
|
|
27
|
-
"author": "",
|
|
38
|
+
"author": "Jason McAlpin",
|
|
28
39
|
"license": "ISC",
|
|
29
40
|
"type": "module",
|
|
30
41
|
"dependencies": {
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
VERSION_BUMP="${1:-patch}"
|
|
5
|
+
NPM_CACHE="${NPM_CACHE:-/private/tmp/mcp-stitch-npm-cache}"
|
|
6
|
+
|
|
7
|
+
case "$VERSION_BUMP" in
|
|
8
|
+
patch|minor|major|prepatch|preminor|premajor|prerelease)
|
|
9
|
+
;;
|
|
10
|
+
*)
|
|
11
|
+
echo "Invalid version bump: $VERSION_BUMP"
|
|
12
|
+
echo "Use one of: patch, minor, major, prepatch, preminor, premajor, prerelease"
|
|
13
|
+
exit 1
|
|
14
|
+
;;
|
|
15
|
+
esac
|
|
16
|
+
|
|
17
|
+
if ! git diff --quiet || ! git diff --cached --quiet; then
|
|
18
|
+
echo "Working tree has uncommitted changes. That is okay for a release,"
|
|
19
|
+
echo "but they will be included in the release commit after publish."
|
|
20
|
+
echo
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
echo "Release bump: $VERSION_BUMP"
|
|
24
|
+
echo "npm cache: $NPM_CACHE"
|
|
25
|
+
echo
|
|
26
|
+
|
|
27
|
+
read -r -p "Commit message: " COMMIT_MESSAGE
|
|
28
|
+
if [[ -z "${COMMIT_MESSAGE// }" ]]; then
|
|
29
|
+
echo "Commit message is required."
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
echo
|
|
34
|
+
echo "Bumping package version..."
|
|
35
|
+
npm version "$VERSION_BUMP" --no-git-tag-version
|
|
36
|
+
|
|
37
|
+
VERSION="$(node -p "require('./package.json').version")"
|
|
38
|
+
TAG="v$VERSION"
|
|
39
|
+
|
|
40
|
+
echo
|
|
41
|
+
echo "Building..."
|
|
42
|
+
npm run build
|
|
43
|
+
|
|
44
|
+
echo
|
|
45
|
+
echo "Checking package contents..."
|
|
46
|
+
npm --cache "$NPM_CACHE" pack --dry-run
|
|
47
|
+
|
|
48
|
+
echo
|
|
49
|
+
read -r -p "Publish mcp-stitch@$VERSION to npm? [y/N] " CONFIRM_PUBLISH
|
|
50
|
+
case "$CONFIRM_PUBLISH" in
|
|
51
|
+
y|Y|yes|YES)
|
|
52
|
+
npm --cache "$NPM_CACHE" publish --access public
|
|
53
|
+
;;
|
|
54
|
+
*)
|
|
55
|
+
echo "Publish cancelled. Version files were updated but no npm package was published."
|
|
56
|
+
exit 1
|
|
57
|
+
;;
|
|
58
|
+
esac
|
|
59
|
+
|
|
60
|
+
echo
|
|
61
|
+
echo "Committing and pushing..."
|
|
62
|
+
git add .
|
|
63
|
+
git commit -m "$COMMIT_MESSAGE"
|
|
64
|
+
git tag "$TAG"
|
|
65
|
+
git push
|
|
66
|
+
git push origin "$TAG"
|
|
67
|
+
|
|
68
|
+
echo
|
|
69
|
+
echo "Released mcp-stitch@$VERSION and pushed $TAG."
|