Skip to content

MCP Tool Reference ​

The Shiplight MCP server lets your coding agent drive a real browser: open or attach to a session, inspect pages, perform actions, capture evidence, and read console and network logs. The server does not require an LLM API key. Your coding agent handles the reasoning; Shiplight executes the browser operations.

Package: @shiplightai/mcp. Always run the latest shiplight-mcp executable with bunx --bun --package @shiplightai/mcp@latest shiplight-mcp. No manual update step. Install it once per agent. See Quick Start.

This page covers the tools and their main parameters. For task-focused instructions and example prompts, see Guides.

How It Works ​

Your agent usually follows this sequence:

start → inspect → act → verify → close → report

  1. Start — new_session opens Chromium. attach_to_browser connects to a browser that is already running. Both return a session_id for the other tools.
  2. Load the action schema — after starting or attaching, the agent reads the shiplight://schemas/action-entity MCP resource for the current act parameters.
  3. Inspect — inspect_page saves a DOM snapshot and a matching Set-of-Mark screenshot. The DOM includes element indices for actions.
  4. Act — act performs one or more browser actions using those element indices.
  5. Verify — the agent inspects the resulting page and can check console or network logs when needed.
  6. Close and report — close_session saves the video and Playwright trace for a recorded session. generate_html_report then builds a local evidence report.

Tools ​

Sessions and Connections ​

ToolDescription
new_sessionOpen Chromium with optional emulation, a persistent profile, an extension, restored storage, or evidence recording
attach_to_browserConnect through a CDP URL or the Shiplight Chrome extension relay. See Attach to your browser
save_storage_stateSave cookies, local storage, and IndexedDB to a file for use in a later new_session
close_sessionClose one session and return its evidence paths. Omit session_id to close all open sessions

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

ToolDescription
navigateOpen a URL. If url is omitted, return the current URL without navigating
get_page_infoReturn the current URL and page title without taking a screenshot
inspect_pageSave a DOM snapshot and matching Set-of-Mark screenshot, then return their file paths
get_locatorsReturn Playwright locators, XPath, frame paths, tags, and text for up to 50 element indices from inspect_page

Actions ​

ToolDescription
actRun one or more actions. Each action needs a plain-language description and any parameters defined by the action schema

act supports these actions:

CategoryActions
Pointerclick, double_click, right_click, hover
Text and keysinput_text, clear_input, press
Formsselect_dropdown_option, get_dropdown_options, set_date_for_native_date_picker
Scrollingscroll, scroll_to_text, scroll_on_element
Navigationgo_to_url, go_back, reload_page
Tabsswitch_tab, close_tab
Waitingwait, wait_for_download_complete
Filesupload_file
Valuessave_variable

The action schema is the source of truth for required fields such as element_index, keys, file paths, and timeouts. MCP clients can read it from shiplight://schemas/action-entity.

upload_file takes paths relative to the project root (the folder the MCP server runs in) or absolute paths. Each action's result has a step_index, and a screenshot_path of the active tab after that action when one could be taken.

Debugging ​

ToolDescription
get_browser_console_logsReturn the latest 100 console entries, optionally filtered by timestamp and log type
get_browser_network_logsReturn the latest 100 requests, optionally filtered by start time or outcome (errors includes failed ones)

Both logs cover every tab of the session, from the first page load of new_session on, and tag each entry with its tab: the index the tab had when the entry was logged, as inspect_page lists tabs and switch_tab takes it. The console log includes uncaught exceptions and unhandled rejections, as error entries whose text starts with Uncaught. The network log adds a request when it starts: status is absent until its response arrives, and failure gives the reason a request failed, such as net::ERR_CONNECTION_REFUSED. WebSocket handshakes appear with resourceType: "websocket" and never get a status; one without failure connected or is still connecting. Each call's log_count counts every matching entry, also those beyond the 100 it returns.

Reporting ​

ToolDescription
generate_html_reportBuild a self-contained local HTML report from a closed session that was started with record_evidence: true

The report can include a title, summary, acceptance checks, a video player, and a Playwright trace viewer link. Pass the local_video_path returned by close_session to play the recording from its local file (or a video_url). Pass its local_trace_path to show where the trace is saved and the command that opens it in the latest Playwright trace viewer, or a trace_url where you uploaded the trace for the viewer link. The report is written to output_path, by default report.html in the system temp directory, and the tool returns its path. Each step shows the screenshot taken after its action, and a check shows the steps it cites. The report fails if any step or any check failed, and a check fails if a step it cites failed.

Browser Options ​

The new_session tool accepts browser_options to control viewport, emulation, extensions, and more. Your AI coding agent uses these parameters automatically based on your instructions.

All Browser Options ​

OptionTypeDescriptionDefault
viewportobject{ width, height } in pixels1280 × 720
is_mobilebooleanEmulate mobile device behavior (CSS media queries, meta viewport)false
has_touchbooleanEnable touch eventsfalse
user_agentstringCustom user agent string—
color_schemestring"light", "dark", or "no-preference""light"
timezone_idstringTimezone ID (e.g., "America/New_York")—
geolocationobject{ latitude, longitude, accuracy? }—
localestringBrowser locale (e.g., "en-US", "ja-JP")—
disable_securitybooleanDisable web security (CORS, CSP)false
record_evidencebooleanEnable video and trace recordingfalse
headlessbooleanRun browser in headless modefalse
proxyobject{ server, username?, password? }—
path_to_extensionstringPath to unpacked Chrome extension directory—
user_data_dirstringChrome user data directory for persistent profile—

Top-Level Options ​

These are passed alongside browser_options, not inside it:

OptionTypeDescription
starting_urlstringURL to navigate to on session creation (default: about:blank)
storage_state_pathstringPath to storage state file to restore cookies/localStorage

Configuration ​

The server keeps environment variables already supplied by the MCP client or inherited from its host process. It then loads a .env file from its current working directory as a fallback. Values in .env do not override existing values.

Common Environment Variables ​

VariableDescription
SHIPLIGHT_RELAY_PORTPort for the Chrome extension relay used by attach_to_browser
TERMINATION_TIMEOUTSession termination timeout in milliseconds
SHIPLIGHT_ACTION_INDICATORSSet to 1 to show an on-page indicator before each action
LOG_LEVELServer log level: ERROR, WARN, INFO (default), or DEBUG
SHIPLIGHT_TELEMETRYSet to 0 to disable anonymous usage telemetry
DO_NOT_TRACKSet to 1 to disable anonymous usage telemetry

The current server enables PWDEBUG=console automatically so generated action data can include semantic Playwright locators.

For manual MCP setup, expand Use another coding agent in the Quick Start.

Released under the MIT License.