PluginBench
Skill
Fail
Audit score 45

stitch::upload-to-stitch

google-labs-code/stitch-skills

Upload local assets to Stitch projects, bypassing MCP token limits.

What is stitch::upload-to-stitch?

This skill uploads images, mockups, HTML, and markdown files to a Stitch design project via HTTP, avoiding the base64 encoding token limits of direct MCP tool calls. Use it when you need to reliably transfer visual assets or extracted web content to Stitch.

  • Uploads PNG, JPEG, WebP images and HTML/markdown files to Stitch projects
  • Auto-detects MIME types from file extensions
  • Accepts optional metadata like screen title and generation source
  • Handles SSL certificate verification issues on macOS with certifi integration
  • Bypasses MCP tool base64 output token limits for large files

How to install stitch::upload-to-stitch

npx skills add https://github.com/google-labs-code/stitch-skills --skill stitch::upload-to-stitch
Prerequisites
  • Python 3 installed and accessible via python3 command
  • Valid Stitch API key (from MCP config, Gemini CLI settings, or Claude config)
  • Stitch project ID (obtainable via list_projects)
  • Local file to upload (image, HTML, or markdown)
  • Optional: certifi package for SSL certificate handling on macOS
Claude Code
Cursor
Windsurf
Cline

How to use stitch::upload-to-stitch

  1. 1.Identify the target Stitch project ID using list_projects
  2. 2.Locate and extract your Stitch API key from your MCP server configuration file (.gemini/antigravity/mcp_config.json, ~/.gemini/settings.json, or ~/.claude.json)
  3. 3.Prepare the local file you want to upload (image, HTML, or markdown)
  4. 4.Present the file path, size, and type to the user and wait for explicit approval before proceeding
  5. 5.Execute the upload script with python3 <SKILL_DIR>/scripts/upload_to_stitch.py, providing --project-id, --file-path, and --api-key at minimum
  6. 6.Optionally add --title (for HTML, use the route path like '/dashboard') and --generated-by (e.g., 'stitch::extract-static-html') for metadata
  7. 7.If SSL errors occur on macOS, install certifi or set SSL_CERT_FILE environment variable before running the script

Use cases

Good for
  • Upload design mockups or screenshots to a Stitch project for review
  • Transfer extracted HTML pages from web apps to Stitch with route-path titles
  • Share generated design markdown documentation with team via Stitch
  • Upload multiple visual assets when direct MCP calls fail due to token limits
  • Archive design artifacts with metadata about their generation source
Who it's for
  • Design system maintainers using Stitch
  • AI agents generating or extracting design assets
  • Teams collaborating on design documentation in Stitch
  • Developers automating design-to-code workflows

stitch::upload-to-stitch FAQ

Why can't I upload files directly via MCP tools?

Base64 encoding of even small files exceeds the model's output token limit (~16K tokens), causing uploads to fail or truncate. This skill sends files directly over HTTP instead.

Where do I find my Stitch API key?

Check your MCP server configuration: .gemini/antigravity/mcp_config.json, .gemini/jetski/mcp_config.json, ~/.gemini/settings.json, ~/.gemini/extensions/Stitch/gemini-extension.json, or ~/.claude.json. Extract the X-Goog-Api-Key header or auth argument.

What file types are supported?

PNG, JPEG, WebP images; HTML/HTM; and Markdown (.md) files. MIME type is auto-detected from the file extension.

What should I use for the --title parameter when uploading HTML?

Set it to the route path of the page (e.g., '/dashboard', '/settings/profile', '/inbox') so the screen name in Stitch clearly identifies the route.

How do I fix SSL certificate errors on macOS?

Install certifi (pip install certifi) or manually set the SSL_CERT_FILE environment variable before running the script: SSL_CERT_FILE=$(python3 -c "import certifi; print(certifi.where())") python3 <SKILL_DIR>/scripts/upload_to_stitch.py ...

Full instructions (SKILL.md)

Source of truth, from google-labs-code/stitch-skills.


name: stitch::upload-to-stitch description: >- Upload local assets (images, mockups, extracted HTML, design markdown) to a Stitch project. ALWAYS use this skill when you need to upload visual assets, HTML pages, or design docs to Stitch, particularly when direct MCP tool calls fail or truncate due to base64 token limits. allowed-tools:

  • "stitch*:*"
  • "Bash"
  • "Read"
  • "Write"
  • "web_fetch"

Upload-to-Stitch

Upload local assets (images, mockups, HTML, and markdown files) to a Stitch project using the provided upload script, which bypasses the MCP tool's base64 output token limits.

[!NOTE] The AI model cannot upload files via MCP tools directly because the base64 encoding of even a small file exceeds the model's output token limit (~16K tokens). This script reads the file and sends it directly over HTTP.

Steps

1. Identify Target Project

Use list_projects to find the correct projectId.

2. Get the API Key

Locate your active MCP server configuration file and extract the API key:

  • Antigravity: .gemini/antigravity/mcp_config.json or .gemini/jetski/mcp_config.json
  • Gemini CLI: ~/.gemini/settings.json or ~/.gemini/extensions/Stitch/gemini-extension.json
  • Claude Code: ~/.claude.json

Extract:

  • API Key: From the X-Goog-Api-Key header or auth argument
  • MCP URL (optional): From the httpUrl or endpoint argument (defaults to https://stitch.googleapis.com)

[!IMPORTANT] If you cannot find the API key in any of these locations, or if you cannot access these files, you MUST ask the user to provide the Stitch API key. Do not proceed without a valid API key.

3. Run Upload Script

[!WARNING] Checkpoint — User Confirmation Required. Before running the upload script, you MUST pause and present the file(s) to be uploaded (paths, sizes, and types) to the user and wait for explicit approval. Do NOT execute the upload script until the user confirms.

Use run_command to execute the Python script:

python3 <SKILL_DIR>/scripts/upload_to_stitch.py \
  --project-id <PROJECT_ID> \
  --file-path <PATH_TO_FILE> \
  --api-key <API_KEY> \
  [--api-url <STITCH_API_URL>] \
  [--title <SCREEN_TITLE>] \
  [--generated-by <GENERATED_BY>]

[!TIP] macOS / SSL Certificate Troubleshooting: If the upload fails with ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] unable to get local issuer certificate, this means your Python installation does not have root certificate authorities configured.

The script automatically attempts to use the certifi package to load the CA bundle if it is installed in your python environment. If certifi is not installed, you can either install it (pip install certifi) or manually supply the SSL_CERT_FILE environment variable when running the script:

SSL_CERT_FILE=$(python3 -c "import certifi; print(certifi.where())") python3 <SKILL_DIR>/scripts/upload_to_stitch.py \
  --project-id <PROJECT_ID> \
  --file-path <PATH_TO_FILE> \
  --api-key <API_KEY> \
  [--api-url <STITCH_API_URL>] \
  [--title <SCREEN_TITLE>] \
  [--generated-by <GENERATED_BY>]

Supported File Types

ExtensionMIME Type
.pngimage/png
.jpg, .jpegimage/jpeg
.webpimage/webp
.html, .htmtext/html
.mdtext/markdown

The script auto-detects MIME type from the file extension.

Script Options

  • --project-id: Required. The Stitch project ID.
  • --file-path: Required. Path to the local file to upload.
  • --api-key: Required. API key for Stitch authorization.
  • --api-url: Optional. Base URL of the Stitch API. Defaults to https://stitch.googleapis.com.
  • --title: Optional. Title for the uploaded screen. When uploading extracted HTML from a web app, set this to the route path of the page (e.g., '/dashboard', '/settings/profile', '/inbox') so that the screen name/title in Stitch clearly identifies the route.
  • --generated-by: Optional. Specify how the uploaded file was generated (e.g., 'stitch::extract-static-html' skill, 'Claude Code', 'Codex', 'Gemini' etc.).