cy.prompt() vs. MCP agents: AI Designed for Testing, Not Just Tasks

September 10, 2025

By Jenna Beckett

cy.prompt() vs MCP Agent

AI is already reshaping how teams approach end-to-end testing, and MCP (Model Context Protocol) agents have quickly become a popular way to let large language models drive browsers. Many of you have asked if Cypress will release an MCP agent of our own. The short answer: we're not ruling it out. But our first step into AI needed to stay true to the Cypress philosophy of making testing easier. That’s why we’re building cy.prompt, not as a general-purpose agent, but as a specialized command designed to help teams write and maintain reliable tests.

Both approaches start with the same idea: describe what you want in plain language and let AI handle the details. But when the goal is reliable test automation, not just one-off test generation, how these approaches differ matters. 

What MCP Agents Do Well (and Where They Struggle)

MCP defines a standard way for AI models to interact with external tools. An MCP agent can talk to a browser driver through this protocol, generating test steps on demand. It’s flexible and model-agnostic, which makes it great for general-purpose automation. 

The challenge is that testing is not the same as “task completion”. As Brian Mann noted at Frontend Nation 2025, “tests aren’t tasks - they’re scientific instruments.” Like any scientific process, you need tools that deliver accurate, repeatable results. In practice, MCP-driven tests often run into:

  • One-off translation: prompts are converted to steps once, leaving you to maintain them.
  • Latency: agents may take minutes to reason about and execute a workflow.
  • Hallucinations: generated steps that don’t match the actual app.
  • Debugging gaps: limited visibility into why a step failed. 

For exploratory automation, these trade-offs may be acceptable. For CI pipelines running hundreds of tests daily, they’re deal breakers.

How cy.prompt Works Differently

cy.prompt() was designed to live inside the test runner itself. Instead of an external agent controlling the browser, you add a cy.prompt() call to your spec files:

cy.prompt(
  [
    "visit https://cloud.cypress.io/login",
    "click Log in with email",
    'type "[email protected]" in the email field',
    "type {{password}} in the password field",
    "click the login button",
  ],
  {
    excludeFromAI: { password: Cypress.env("password") },
  }
);

Cypress sends those steps to an AI model, generates Cypress commands, and then caches them for reuse. On the next run, the cached code executes as fast as any hand-written test. If your app changes and a selector breaks, Cypress re-runs the prompt to regenerate updated commands and selectors automatically. The approach creates several key differences:

  • Self-healing: Prompts adapt to UI changes instead of breaking on potentially insignificant semantic updates.
  • Speed: Cached runs execute in seconds, not minutes.
  • Transparency: The generated code is always available, and you can save it into your  test files whenever you want.
  • Debuggability: Every step appears in the Command Log with time-travel debugging, just like a standard Cypress command.

Why This Matters for Teams

When we asked users what they wanted most from AI in testing, the message was consistent: they need ways to write tests faster, keep them stable as applications change, and open participation in quality beyond just the engineers who know JavaScript. One user summed it up simply: “I just want to type a flow in plain English and have it run as a test.”

Authoring Speed

cy.prompt() is designed with these needs in mind. By letting teams describe test flows in natural language, it shortens the time from idea to working test, removing one of the biggest bottlenecks in modern QA. 

It also tackles two related but distinct challenges: stability and maintenance. 

Stability

Flaky tests erode confidence in CI pipelines, and cy.prompt() gives teams the flexibility to choose how they address that problem. Some teams will want predictability above all else. For them, cy.prompt() can quickly generate Cypress code with selectors that follow existing patterns and best practices, code you can save into your spec files and run just like the rest of your suite. 

Maintenance

Others may want to take it further. As one tester explained, “I need fewer false failures. I want my CI to fail because the app is broken, not because a selector changed.” For those teams, leaving prompts in place allows Cypress to automatically re-run them when cached steps break, regenerating code so tests evolve with the application instead of going stale.

Shifting Left

Beyond speed and resilience, cy.prompt() supports a shift-left culture by enabling people outside the core engineering team to contribute meaningful test cases. Product owners or QA specialists who understand user flows can write prompts directly, without needing to master Cypress syntax. This broadens who can participate in test creation and helps teams share responsibility for quality earlier in the development process.

Looking Ahead

MCP agents and Cypress’s cy.prompt() aren’t enemies. MCP is a powerful standard for connecting AI to tools, and it will continue to evolve. But when the goal is trustworthy test automation, we believe tests deserve a purpose-built approach. 

By embedding AI into the test runner itself, cy.prompt() combines the convenience of natural language with the rigor of Cypress. It’s AI-powered testing that stays fast, transparent, and resilient.

Try it Yourself

If you want to be among the first to start writing tests in natural language, then sign up for early access today.

cy.prompt() will be available as an experimental feature soon. During this extended experimental period, you can use it free of charge. A paid model will follow once the feature is generally available.