mcp-stitch 0.1.1 → 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/README.md CHANGED
@@ -2,6 +2,26 @@
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
+
5
25
  ## Links
6
26
 
7
27
  - npm: https://www.npmjs.com/package/mcp-stitch
@@ -101,8 +121,124 @@ For local development before publishing, build this repo and point VS Code at th
101
121
  }
102
122
  ```
103
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
+
104
126
  After VS Code starts the server, ask your agent to call `stitch_status` to confirm the setup.
105
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
+
106
242
  ## Tools
107
243
 
108
244
  - `stitch_status`
@@ -141,6 +277,22 @@ npm run build
141
277
  npm run dev
142
278
  ```
143
279
 
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
+
144
296
  ## Contributing
145
297
 
146
298
  Issues and pull requests are welcome. Please keep changes focused on the Stitch MCP server surface, avoid committing generated Stitch artifacts, and run:
@@ -163,9 +315,7 @@ ISC. See [LICENSE](LICENSE).
163
315
  ## Publishing Checklist
164
316
 
165
317
  ```bash
166
- npm run build
167
- npm pack --dry-run
168
- npm publish
318
+ npm run release
169
319
  ```
170
320
 
171
321
  See [docs/stitch-tools.md](docs/stitch-tools.md) for detailed tool inputs and Stitch contract notes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-stitch",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "MCP server for Google Stitch.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -18,12 +18,14 @@
18
18
  "dist",
19
19
  "docs/stitch-tools.md",
20
20
  "README.md",
21
- "LICENSE"
21
+ "LICENSE",
22
+ "scripts/release.sh"
22
23
  ],
23
24
  "scripts": {
24
25
  "dev": "tsx src/index.ts",
25
26
  "build": "tsc",
26
27
  "prepack": "npm run build",
28
+ "release": "bash scripts/release.sh",
27
29
  "start": "node dist/index.js"
28
30
  },
29
31
  "keywords": [
@@ -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."