Skip to content

MCP Server

The Shiplight MCP server gives your AI coding agent the ability to drive a real browser — launch sessions, inspect pages, perform actions, capture evidence, and read console and network logs. All browser actions are deterministic, so no LLM API keys are needed by the server itself. Your coding agent (Claude Code, Cursor, VS Code, Codex, etc.) handles the reasoning; Shiplight executes.

Package: @shiplightai/mcp. Always run latest via npx -y @shiplightai/mcp@latest — no manual update step.

How It Works

Your agent works through a simple loop:

launch → inspect → interact → verify → close

  1. Launchnew_session opens a Chromium browser. Choose fresh, a persistent Chrome profile, or attach to an already-open browser. Emulation, extensions, and recording are configurable per session.
  2. Inspectinspect_page returns a DOM tree plus a Set-of-Mark screenshot with element indices the agent can reference.
  3. Interactact performs actions (click, type, scroll, upload, keyboard, tab switching) using element indices from inspect_page.
  4. Verify — the agent re-inspects the page, or pulls get_browser_console_logs / get_browser_network_logs to confirm the change.
  5. Closeclose_session returns video and Playwright trace paths if recording was enabled.

For end-to-end workflows that use this loop, see Browser Automation.

Install

For per-agent copy-paste install commands (Claude Code, Cursor, VS Code, Codex, Gemini CLI, Copilot CLI, Claude Desktop, Zed, OpenCode, Antigravity), see Quick Start → Step 1.

Manual config

For agents that add-mcp doesn't cover, paste this into your agent's MCP config file (location varies — check your agent's docs):

json
{
  "mcpServers": {
    "shiplight": {
      "command": "npx",
      "args": ["-y", "@shiplightai/mcp@latest"],
      "env": {
        "PWDEBUG": "console"
      }
    }
  }
}

Tool Reference

Session Management

ToolDescription
new_sessionLaunch a browser with optional emulation and extensions
close_sessionClose a session (returns video/trace paths if recording)
close_allClose all sessions
get_session_stateGet current URL and session type
save_storage_stateSave cookies/localStorage for fast session restore
attach_to_browserConnect to an existing browser via relay or CDP

new_session accepts a rich set of browser_options — viewport, mobile emulation, color scheme, locale, geolocation, proxy, persistent profile, and more. See Browser Options for the full list.

Page Inspection

ToolDescription
navigateNavigate to a URL
get_page_infoGet current page URL and title (lightweight, no screenshot)
inspect_pageDOM tree + Set-of-Mark screenshot (element indices for the act tool)
get_locatorsExtract Playwright locator/xpath for elements

Actions

ToolDescription
actExecute browser actions (click, type, scroll, etc.) using element indices from inspect_page

Debugging

ToolDescription
get_browser_console_logsGet browser console output with filtering
get_browser_network_logsGet network requests with status filtering
clear_logsClear console and network logs

Reporting

ToolDescription
generate_html_reportGenerate a self-contained HTML report with screenshots, video, and checklist
upload_html_reportUpload an HTML report to Shiplight Cloud for sharing

Configuration

All configuration is done through environment variables. The MCP server discovers them in this order:

  1. Your project's .env file (auto-discovered on startup)
  2. The env block in your MCP server config
  3. Shell exports

Environment Variables

VariableRequiredDescription
SHIPLIGHT_API_TOKENFor cloud featuresShiplight API token — enables cloud sync tools. Get your token from app.shiplight.ai/settings/api-tokens.
SHIPLIGHT_RELAY_PORTFor relay attachPort for the Chrome extension relay server. Required when using attach_to_browser via the Shiplight Chrome extension. See Attach to Existing Browser.
PWDEBUGNoPlaywright debug mode. The install commands set PWDEBUG=console so the agent sees browser console output inline.

Next Steps

Released under the MIT License.