cypress-mcp

v0.5.3
com.jadev-corp/cypress-mcp Checked 11 hours ago Published 6 days ago

Run and debug Cypress tests from an AI agent: compact failures with file:line, error, screenshot.

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

cypress_run Run Cypress specs

Run Cypress headless in one launch: a spec, path:line, a glob or a list. Returns per failure file:line, error, screenshot and the page at the failure (URL, console and network errors, similar selectors), plus a runId.

ParameterTypeDescription
browserstringBrowser from `cypress info`: chrome, firefox, edge, electron, chrome:beta... Default: the project's
cloudobjectCypress Cloud: record: true needs projectId and CYPRESS_RECORD_KEY in the server env
componentbooleanComponent tests
envobjectCypress env values
headedbooleanShow the browser
projectstringMonorepos: folder with cypress.config.* (default: from the spec path)
repeatintegerRun the selected tests n times, to prove a flaky fix
specSpec path, "path:line" for the test at that line, a glob such as cypress/e2e/**/*.cy.ts, or a list. Omit for every spec
testNamestringOnly tests whose full title contains this
timeoutintegerms, default 300000
verbosebooleanAlso list passing tests

cypress_get_failure Inspect a Cypress run

Details of a run from cypress_run. view "failures" (default): each failure with source excerpt, error, diff, stack, screenshot. "page": the page at one failure (DOM/ARIA outline, URL, console and network errors, command log, similar selectors). "tests": every test. "screenshots": image links, the last attempt of each retried test. "output": the end of Cypress's output.

ParameterTypeDescription
attemptsbooleanview "screenshots": also the earlier attempts of retried tests
failureintegerOnly this failure, by its number in the run result
imagebooleanAdd the screenshots as images, scaled to 1000 px wide
runIdstringrunId returned by cypress_run. "last" is the latest run of this server, which can be another agent's.
viewstring

cypress_list_specs List Cypress specs

List spec files with their test counts, read statically (nothing runs). titles: true adds each test's full title, the text testName matches. In a monorepo, lists every project's specs.

ParameterTypeDescription
patternstringGlob relative to the project root. Default: the project's specPattern
projectstringMonorepos: one project folder. Default: every project
titlesbooleanInclude test titles

cypress_doctor Check the Cypress setup

Check the Cypress setup: config file, Cypress install, specs, support file, failure context, Cloud settings. Starts Cypress once to load the config (about 15 s) unless quick is true. Use it when a run cannot start, not before every session.

ParameterTypeDescription
projectstringMonorepos: the project folder to check
quickbooleanSkip starting Cypress; check files and install only