A guided checklist and proxy server for the Stitch MCP
npx @_davideast/stitch-mcp initThis single command will:
- Install Google Cloud CLI (if needed)
- Guide you through authentication with gcloud commands
- Set up application credentials
- Select a GCP project
- Configure IAM permissions
- Enable Stitch API
- Generate MCP configuration for your client
Example session:
Stitch MCP Setup
Step 1: Select your MCP client
✔ Which MCP client are you using? Antigravity
Step 2: Setting up Google Cloud CLI
✔ Google Cloud CLI ready (bundled): v552.0.0
Step 3: Setup Authentication
✔ Check your current setup status? Yes
Authenticate with Google Cloud
CLOUDSDK_CONFIG="~/.stitch-mcp/config" gcloud auth login
(copied to clipboard)
✔ Press Enter when complete Yes
✔ Logged in as you@gmail.com
Authorize Application Default Credentials
CLOUDSDK_CONFIG="~/.stitch-mcp/config" gcloud auth application-default login
(copied to clipboard)
✔ Press Enter when complete Yes
✔ ADC configured
Step 4: Select a Google Cloud project
✔ Select a project: My Project (my-project-id)
Step 5: Configure IAM Permissions
✔ Required IAM role is already configured.
Step 6: Generating MCP Configuration
✔ Configuration generated
Setup Complete! ✔
How it works: Commands are displayed and automatically copied to your clipboard. Run the command in your terminal, complete the OAuth flow in your browser, then press Enter to continue.
Example output:
{
"mcpServers": {
"stitch": {
"command": "npx",
"args": ["@_davideast/stitch-mcp", "proxy"],
"env": {
"STITCH_PROJECT_ID": "your-project-id"
}
}
}
}Copy this config into your MCP client settings and you're ready to use the Stitch MCP server.
npx @_davideast/stitch-mcp doctorRuns health checks on:
- ✔ Google Cloud CLI installation
- ✔ User authentication
- ✔ Application credentials
- ✔ Project configuration
- ✔ Stitch API connectivity
npx @_davideast/stitch-mcp logout
# Skip confirmation
npx @_davideast/stitch-mcp logout --force
# Clear all config
npx @_davideast/stitch-mcp logout --clear-configCan be configured with npx or installed globally.
npx @_davideast/stitch-mcp initOr install globally if you prefer:
npm install -g @_davideast/stitch-mcp
stitch-mcp initnpx @_davideast/stitch-mcp init [options]Options:
--local- Install gcloud locally to project instead of user home-y, --yes- Auto-approve verification prompts (skips "Check your current setup status?")-c, --client <client>- Specify MCP client (antigravity, vscode, cursor, claude-code, gemini-cli)-t, --transport <type>- Transport type (http or stdio)
What happens:
- MCP Client Selection - Choose your IDE/CLI
- gcloud Setup - Install or detect Google Cloud CLI
- User Authentication - OAuth login flow
- Application Credentials - API-level authentication
- Project Selection - Interactive picker with search
- IAM Configuration - Set up required permissions
- API Enablement - Enable Stitch API
- Connection Test - Verify API access
- Config Generation - Output ready-to-use MCP config
npx @_davideast/stitch-mcp doctor [options]Options:
--verbose- Show detailed error information
Diagnoses common setup issues and verifies:
- Google Cloud CLI is installed and accessible
- User is authenticated
- Application Default Credentials exist
- Active GCP project is configured
- Stitch API is reachable
npx @_davideast/stitch-mcp logout [options]Options:
--force- Skip confirmation prompts--clear-config- Delete entire gcloud config directory
Revokes both user authentication and Application Default Credentials. Useful for:
- Switching Google accounts
- Clearing authentication for testing
- Resetting state when troubleshooting
npx @_davideast/stitch-mcp proxy [options]Options:
--transport <type>- Transport type: 'stdio' or 'sse' (default: 'stdio')--port <number>- Port number (required for sse)--debug- Enable debug logging
This command is typically configured as the entry point in your MCP client settings. It handles:
- Automatic token refresh
- Request/response proxying
- Error handling
- Debug logging (when
--debugis enabled to/tmp/stitch-proxy-debug.log)
This library manages Google Cloud CLI:
- Prefers global installation: Uses existing
gcloudif available - Auto-installs locally: Downloads to
~/.stitch-mcp/google-cloud-sdkif needed - Isolated configuration: Separate config directory prevents config conflicts with other gcloud configurations
Two authentication flows are required for Stitch MCP server access:
-
User Auth (
gcloud auth login)- Identifies you to Google Cloud
- Opens browser for OAuth flow
-
Application Default Credentials (
gcloud auth application-default login)- Allows MCP server to make API calls on your behalf
- Separate OAuth flow with API-level permissions
The CLI presents these as a guided checklist. You run the commands yourself, then the CLI verifies completion:
Authenticate with Google Cloud
CLOUDSDK_CONFIG="~/.stitch-mcp/config" gcloud auth login
(copied to clipboard)
✔ Press Enter when complete Yes
✔ Logged in as you@gmail.com
The CLI automatically detects WSL, SSH sessions, Docker containers, and Cloud Shell. In these environments, browser-based auth may not work automatically. The CLI shows guidance:
⚠ WSL detected - browser redirect to localhost may not work
If browser auth fails, copy the URL from terminal and open manually.
Simply copy the OAuth URL from your terminal and paste it into your browser to complete authentication.
Direct Connection (HTTP) - Default for most clients:
{
"mcpServers": {
"stitch": {
"type": "http",
"url": "https://stitch.googleapis.com/mcp",
"headers": {
"Authorization": "Bearer <token>",
"X-Goog-User-Project": "<project-id>"
}
}
}
}Proxy Mode (STDIO) - Recommended for development:
{
"mcpServers": {
"stitch": {
"command": "npx",
"args": ["@_davideast/stitch-mcp", "proxy"],
"env": {
"STITCH_PROJECT_ID": "<project-id>"
}
}
}
}Proxy mode handles token refresh automatically and provides debug logging.
Ensure:
- You have Owner or Editor role on the GCP project
- Billing is enabled on your project
- Stitch API is enabled
Run doctor to diagnose:
npx @_davideast/stitch-mcp doctor --verboseThe tool now always prints authentication URLs to the terminal with a 5-second timeout to prevent hanging. If the URL doesn't appear:
- Check your terminal output carefully
- The URL starts with
https://accounts.google.com - If still not visible, check
/tmp/stitch-proxy-debug.log(if using proxy with--debug)
The bundled gcloud SDK maintains separate authentication from your global gcloud installation. To fully clear authentication:
npx @_davideast/stitch-mcp logout --force --clear-config-
Run the doctor command:
npx @_davideast/stitch-mcp doctor --verbose
-
Verify your project has billing enabled
-
Check that Stitch API is enabled:
gcloud services list --enabled | grep stitch -
Try re-authenticating:
npx @_davideast/stitch-mcp logout --force npx @_davideast/stitch-mcp init
# Install dependencies
bun install
# Run locally
bun run dev init
# Run tests
bun test
# Build
bun run build
# Verify package
bun run verify-packApache 2.0 © David East
Warning
Experimental Project - This is an independent, experimental tool.
This project is:
- NOT affiliated with, endorsed by, or sponsored by Google LLC, Alphabet Inc., or the Stitch API team
- Provided AS-IS with NO WARRANTIES of any kind
- NOT guaranteed to be maintained, secure, or compatible with future API versions
"Stitch" and "Google Cloud" are trademarks of Google LLC.
USE AT YOUR OWN RISK.