Skip to main content
Glama

Universal Model Context Protocol (MCP) Setup for Previews

Previews provides a universal Model Context Protocol (MCP) server supporting:

  1. Local Stdio Transport: Standard stdio subprocess bridge (npx preview-mcp) for all AI coding environments, IDEs, and CLI tools.

  2. Remote Transports: Direct SSE (/mcp/sse) and HTTP JSON-RPC (/mcp) hosted on Cloudflare Workers edge for remote agents, cloud runtimes, and webhook integrations.

Authentication is powered entirely by your Google Account, reusing the existing session flow without custom token tables or passwords.


1. Zero-Friction Desktop Setup (Claude Desktop, Cursor, Windsurf)

To configure your desktop AI apps and authenticate with Google in one single step, run:

npx preview-mcp setup

This auto-detects installed desktop apps (such as Claude Desktop and Cursor), writes or updates their MCP configurations safely, and launches the browser to sign in with your Google Account.

To target a specific app:

npx preview-mcp setup claude    # Configure Claude Desktop
npx preview-mcp setup cursor    # Configure Cursor
npx preview-mcp setup all       # Configure all detected clients

Related MCP server: Gemini-Cloud-Agent-MCP

2. Quick Authentication & Re-authentication (Google Login)

Run this command anytime to sign in or re-authenticate:

npx preview-mcp login

(Or alias npx preview-mcp reauthenticate)

This opens your browser to sign in with Google. Once verified, credentials are automatically saved to ~/.preview/config.json.

Alternatively, if you're already logged into the Previews web dashboard, click "MCP / AI Agents" in the top navigation bar to copy your Google session token directly.


3. Manual Agent & IDE Configurations

All tools support the standard MCP JSON configuration format.

Antigravity / Gemini Code Assist

Add to your project's .gemini/settings.json or workspace MCP configuration:

{
  "mcpServers": {
    "preview": {
      "command": "npx",
      "args": ["-y", "preview-mcp"],
      "env": {
        "PREVIEWS_BASE_URL": "https://previews.kartikarora.me"
      }
    }
  }
}

Or connect directly to the remote SSE endpoint without a local Node.js process:

{
  "mcpServers": {
    "preview": {
      "url": "https://previews.kartikarora.me/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_GOOGLE_SESSION_TOKEN"
      }
    }
  }
}

Cursor (.cursor/mcp.json or Settings → MCP)

{
  "mcpServers": {
    "preview": {
      "command": "npx",
      "args": ["-y", "preview-mcp"],
      "env": {
        "PREVIEWS_BASE_URL": "https://previews.kartikarora.me"
      }
    }
  }
}

OpenAI Codex / ChatGPT Desktop

Add to your client configuration:

{
  "mcpServers": {
    "preview": {
      "command": "npx",
      "args": ["-y", "preview-mcp"],
      "env": {
        "PREVIEWS_BASE_URL": "https://previews.kartikarora.me"
      }
    }
  }
}

Windsurf (~/.codeium/windsurf/mcp_config.json)

{
  "mcpServers": {
    "preview": {
      "command": "npx",
      "args": ["-y", "preview-mcp"],
      "env": {
        "PREVIEWS_BASE_URL": "https://previews.kartikarora.me"
      }
    }
  }
}

Claude Desktop (claude_desktop_config.json)

Run npx preview-mcp setup to automatically configure Claude Desktop.

Or configure manually in:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "preview": {
      "command": "npx",
      "args": ["-y", "preview-mcp"],
      "env": {
        "PREVIEWS_BASE_URL": "https://previews.kartikarora.me"
      }
    }
  }
}

Claude Plugin (Claude Code & Claude Desktop)

Install Previews as a native Claude plugin directly from GitHub:

claude plugin add kartikarora/preview-mcp

(Or clone https://github.com/kartikarora/preview-mcp into your Claude plugins directory)

Claude Code (.mcp.json or CLI)

Claude Code supports both standard HTTP transport with native Authenticate / Re-authenticate prompts, and local stdio:

# Direct HTTP transport with OAuth discovery:
claude mcp add --transport http preview https://previews.kartikarora.me/mcp

# Or stdio CLI transport:
claude mcp add preview -- npx -y preview-mcp

Inside your Claude Code session, type /mcp and select Authenticate or Re-authenticate to sign in directly with Google in your browser.

Zed Editor (~/.config/zed/settings.json)

{
  "experimental.features": {
    "model_context_protocol": true
  },
  "context_servers": {
    "preview": {
      "command": {
        "path": "npx",
        "args": ["-y", "preview-mcp"]
      }
    }
  }
}

3. Remote Cloud Agents (Direct Network / SSE)

For automated cloud agents (Antigravity, Gemini, OpenAI Codex, LangChain, LlamaIndex, Anthropic SDK, or custom scripts), no Node.js process is required. Connect directly over HTTP:

  • SSE Endpoint: https://previews.kartikarora.me/mcp

  • HTTP POST Endpoint: https://previews.kartikarora.me/mcp

  • Header:

    Authorization: Bearer <GOOGLE_SESSION_TOKEN>

    (Or query parameter ?token=<GOOGLE_SESSION_TOKEN> on SSE connection)


4. Available MCP Tools

Tool

Description

authenticate

Check status or get instructions to authenticate/re-authenticate with Google.

create_preview

Deploy v1 preview. Autonomously deployed when building web UI; returns live URL.

update_preview

Deploy new version (v2, v3, etc.) on the same URL for rapid voice iteration.

get_preview_diff

Get plain-text unified diff between any two versions (e.g. 1..2).

list_previews

List active preview projects owned by the authenticated Google user.

get_preview

Inspect project details, status, files, and versions.

set_preview_password

Set, update, or remove password protection.

delete_preview

Delete preview project and clean up R2 storage.


5. Prototyping & Voice Workflow Prompts

Previews exposes MCP Prompts for zero-friction prototyping:

Prompt

Description

figma_prototype

Transforms Figma designs, screenshots, or layout specs into high-fidelity live web prototypes with Google Fonts, Lucide icons, and Unsplash images.

voice_iterate

Applies conversational voice feedback ("yapping into the mic") to an existing preview project without changing its URL.

Available Tools

7 tools
authenticateB

Check authentication status or sign in with your Google account for Previews.

Inputs: no named parameters.

create_previewB

Deploy an HTML/CSS/JS project to a live preview URL on an isolated subdomain. Automatically deploy live interactive prototypes and return live URLs for fast feedback.

Inputs: files (required), slug, password.

delete_previewA

Permanently delete a preview project and all its versions and assets.

Inputs: slug (required).

get_preview_diffA

View file-by-file text diff between two versions of a preview.

Inputs: slug (required), to_version, from_version.

list_previewsB

List active HTML preview projects owned by the authenticated user.

Inputs: limit, offset.

set_preview_passwordB

Set, update, or remove password protection for an existing preview project.

Inputs: slug (required), password.

update_previewA

Deploy a new version to an existing preview slug. Automatically iterates on the existing prototype while preserving version history.

Inputs: slug (required), files (required), changelog.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a clearly distinct operation in the preview lifecycle: auth, list, create, update, diff, password management, and delete. create_preview and update_preview could superficially overlap, but their descriptions clearly distinguish deploying a new project from deploying a new version to an existing slug.

    Naming Consistency4/5

    The set mostly follows a consistent verb_noun convention: list_previews, create_preview, update_preview, get_preview_diff, set_preview_password, and delete_preview. The lone authenticate tool is a reasonable special-case verb but is a minor deviation from the pattern.

    Tool Count5/5

    Seven tools is well-scoped for an HTML preview deployment service. Each tool corresponds to a meaningful operation without redundant endpoints.

    Completeness4/5

    Core CRUD lifecycle coverage is present: list, create, update, and delete, plus diffing and password protection. Minor gaps exist, such as no dedicated get_preview or list_versions operation, but agents can work around these via list_previews and get_preview_diff.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables web-based AI chat clients to securely operate a local machine through one OAuth-gated MCP endpoint, exposing governed tools for file read/write/edit, whitelisted shell commands, search, Git, SQLite, browser automation, DevTools, background tasks, localhost fetches, clipboard, notifications, ports, and Postman. It lets users build and edit projects, inspect databases and local APIs, drive browser workflows, and manage long-running jobs from a browser or mobile device without granting unrestricted shell access.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables web AI clients and local IDEs to securely operate a local machine through an OAuth-gated MCP endpoint, with governed tools for files, shell, search, Git, SQLite, browser automation, DevTools, background tasks, localhost services, clipboard, notifications, ports, Postman, and AIObox windows.
      MIT