mcp-server

v0.26.0
@letsrunit/mcp-server Checked 4 days ago Published 2 months ago

MCP server for letsrunit — AI-agent browser test generation and execution

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

letsrunit_session_start

Launch a new browser session. Does not navigate anywhere — use letsrunit_run with a Given step to navigate. Set baseURL to enable relative paths like "Given I'm on the homepage".

ParameterTypeDescription
baseURLstringBase URL for the session, e.g. "http://localhost:3000". Enables relative paths in Given steps like "Given I'm on the homepage" or "Given I'm on page \"/login\""
headlessbooleanRun browser in headless mode (default: true)
languagestringBrowser language code, e.g. 'en', 'fr'
viewportHeightintegerViewport height in pixels (default: 720)
viewportWidthintegerViewport width in pixels (default: 1280)

letsrunit_run

Execute Gherkin steps or a complete feature in the browser. Accepts a single step line, multiple step lines, a full Scenario, or a full Feature. Returns status, steps, reason on failure, and journal entries. Does not return a page snapshot — call letsrunit_snapshot explicitly if you need the DOM.

ParameterTypeDescription
input *stringGherkin text to execute: one or more step lines (e.g. "Given I am on \"https://example.com\""), a Scenario block, or a full Feature block.
sessionId *stringSession ID returned by letsrunit_session_start

letsrunit_snapshot

Get the current page HTML, scrubbed for LLM consumption. Use selector to scope to a DOM subtree.

ParameterTypeDescription
sessionId *stringSession ID
dropHeadbooleanRemove the <head> element (default: true)
dropHiddenbooleanRemove hidden/inert nodes (default: true)
pickMainbooleanKeep only the <main> element (default: auto)
selectorstringCSS selector — return only the matching element's outer HTML instead of the full page
stripAttributesnumberAttribute allowlist level: 0=none, 1=semantic (default), 2=aggressive

letsrunit_screenshot

Take a screenshot of the current page. Optionally crop to a specific element (selector) or highlight elements before capturing (mask).

ParameterTypeDescription
sessionId *stringSession ID
fullPagebooleanCapture the full scrollable page (default: false)
maskarrayCSS selectors whose matching elements are highlighted (dark overlay, element spotlighted).
selectorstringCSS selector — crop screenshot to the bounding box of this element

letsrunit_debug

Evaluate JavaScript on the current page via Playwright page.evaluate(). Use for debugging — not for test logic.

ParameterTypeDescription
script *stringJavaScript expression or function body to evaluate in the page context
sessionId *stringSession ID

letsrunit_session_close

Close a browser session and release its resources.

ParameterTypeDescription
sessionId *stringSession ID to close

letsrunit_list_steps

List available step definitions for a session. Optionally filter by step type (Given/When/Then).

ParameterTypeDescription
sessionId *stringSession ID returned by letsrunit_session_start
typestringOptional step type filter

letsrunit_list_sessions

List all active browser sessions.

letsrunit_reload

Reload built-in and project support step definitions without restarting the MCP server.

ParameterTypeDescription
cwdstringProject directory to resolve cucumber support files from. Defaults to current project cwd.

letsrunit_diff

Diff the current live page against the HTML snapshot from the last passing test of a scenario. Pass the scenarioId returned by letsrunit_run. Returns a unified HTML diff and paths to baseline screenshots. By default only considers baseline tests from the current git ancestry (gitTreeOnly: true).

ParameterTypeDescription
scenarioId *stringScenario UUID returned by letsrunit_run
sessionId *stringSession ID returned by letsrunit_session_start
gitTreeOnlybooleanRestrict baseline to tests from the current git ancestry (default: true)