cypress-mcp
Allows AI agents to control a Cypress-powered browser for web testing, providing tools for navigation, interaction, DOM snapshots, network interception, and more.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cypress-mcpNavigate to the dashboard and take a screenshot of the page"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cypress-mcp
MCP (Model Context Protocol) server plugin for Cypress — let AI agents control your browser for testing.
Turn Cypress into an MCP server that AI clients (Claude Desktop, Cursor, Windsurf, etc.) can use to navigate, interact with, and test web applications.
Features
52 browser automation tools — navigate, click, type, screenshot, intercept network, iframes, and more
Accessibility-first DOM snapshots — ARIA-based page representation optimized for LLM understanding
Zero config — just 2 lines to integrate into your Cypress project
Network interception — capture, filter, and mock HTTP requests
Test generation — automatically generate Cypress tests from recorded sessions
Plugin system — extend with custom tools via third-party plugins
MCP standard — works with any MCP-compatible AI client
Quick Start
Install
npm install cypress-mcp --save-devConfigure (2 lines)
cypress.config.ts:
import { defineConfig } from 'cypress';
import { cypressMcp } from 'cypress-mcp/plugin';
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:3000', // your app
setupNodeEvents(on, config) {
cypressMcp(on, config);
return config;
},
},
});cypress/support/e2e.ts:
import 'cypress-mcp/support';Run
# Auto-detects baseUrl from cypress.config
npx cypress-mcp
# Or override baseUrl for a specific project
npx cypress-mcp --base-url http://localhost:4200
# All options
npx cypress-mcp --base-url http://localhost:3000 --browser chrome --port 3457 --debugConnect to MCP Clients
Claude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"cypress": {
"command": "npx",
"args": ["cypress-mcp"]
}
}
}baseUrl is auto-detected from cypress.config.ts in the working directory. To override:
{
"mcpServers": {
"cypress": {
"command": "npx",
"args": ["cypress-mcp", "--base-url", "http://localhost:4200"],
"env": {
"CYPRESS_BASE_URL": "http://localhost:4200"
}
}
}
}VS Code / Cursor:
{
"mcpServers": {
"cypress": {
"command": "npx",
"args": ["cypress-mcp", "--base-url", "http://localhost:3000"]
}
}
}Claude Code:
claude mcp add cypress npx cypress-mcp --base-url http://localhost:3000baseUrl Resolution Order
The CLI resolves baseUrl from multiple sources (highest priority first):
--base-urlCLI argumentCYPRESS_BASE_URLenvironment variableAuto-detected from
cypress.config.{ts,js}in current directoryNo baseUrl (Cypress works without it — use
browser_navigateto go anywhere)
Tools (38 total)
Navigation (4)
Tool | Description |
| Navigate to a URL |
| Go back in history |
| Go forward in history |
| Reload the page |
Interaction (9)
Tool | Description |
| Click an element (left/right/double) |
| Type text with keystroke simulation |
| Set input value directly |
| Select dropdown option |
| Check/uncheck checkbox or radio |
| Hover over element |
| Scroll page or element into view |
| Drag and drop elements |
| Press keyboard keys |
Snapshot & DOM (4)
Tool | Description |
| Core tool — accessibility tree snapshot |
| Find elements by role, text, state |
| Get element or page text content |
| Get HTML attribute values |
Network (5)
Tool | Description |
| List captured requests |
| Get full request details |
| Mock a network endpoint |
| Remove a mock |
| Wait for a specific request |
Screenshot & Visual (2)
Tool | Description |
| Capture screenshot (element or page) |
| Set viewport size/preset |
Console & Debug (2)
Tool | Description |
| Get console log/warn/error |
| Execute JavaScript in browser |
Tab Management (4)
Tool | Description |
| List open tabs (emulated) |
| Open new tab |
| Switch to tab |
| Close tab |
Storage & Cookies (5)
Tool | Description |
| Get cookies |
| Set a cookie |
| Clear cookies |
| Get/set/delete localStorage |
| Get/set/delete sessionStorage |
Dialog (1)
Tool | Description |
| Handle alert/confirm/prompt |
Utility (4)
Tool | Description |
| Wait for condition/time/element |
| Assert element state |
| Execute raw Cypress commands |
| Generate test from session history |
Architecture
┌─────────────────┐ stdio/SSE ┌─────────────────┐
│ AI Client │ ◄──────────────► │ MCP Server │
│ (Claude, etc.) │ │ (Node.js) │
└─────────────────┘ │ │
│ 38 Tool │
│ Handlers │
│ │
│ State Manager │
└────────┬────────┘
│ cy.task()
│ (polling)
┌────────┴────────┐
│ Cypress Browser │
│ │
│ Agent Loop │
│ DOM Snapshotter│
│ Net Interceptor│
│ Console Hook │
└─────────────────┘3-Layer Architecture:
MCP Server (Node.js) — Handles MCP protocol, tool registration, request routing
Bridge — cy.task() based polling between Node.js and Cypress browser
Cypress Runtime — Agent spec keeps browser open, executes commands, captures state
Options
cypressMcp(on, config, {
wsPort: 3456, // Bridge port
transport: 'stdio', // 'stdio' or 'sse'
ssePort: 3100, // SSE port (if transport === 'sse')
debug: false, // Debug logging
});How it Works
cypressMcp()starts an MCP server (stdio) and registers 38 tool handlersCypress runs an "agent spec" that keeps the browser open in a polling loop
When the AI client calls a tool (e.g.,
browser_navigate), the MCP server queues a commandThe browser-side agent polls for commands via
cy.task('mcpBridgePoll')Commands execute as real Cypress commands (
cy.visit,cy.click, etc.)Results flow back through
cy.task('mcpBridgeResponse')
Security
See SECURITY.md for security considerations, especially regarding browser_evaluate and browser_run_cypress tools.
Important: This tool is for development/testing only. Do not expose the MCP server to untrusted networks.
Requirements
Node.js >= 18
Cypress >= 12.0.0
License
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sbtungd2/cypress-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server