Get the FREE Ultimate OpenClaw Setup Guide →

cypress

Model Context Protocol (MCP) server for Cypress, enabling AI-powered test automation in Cursor

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio glh230-cypress-mcp-server node /path/to/cypress-mcp-server/src/index.js \
  --env CYPRESS_MCP_CONFIG="/path/to/cypress-mcp.config.yaml"

How to use

This MCP server integrates Cypress with Cursor AI, enabling AI-powered test automation, debugging, and test generation within the MCP framework. The server exposes tools to run Cypress tests, open the Cypress UI for interactive debugging, validate test files, generate tests from natural language descriptions, and retrieve results, screenshots, and videos from previous runs. You can control Cypress behavior via configuration in cypress-mcp.config.yaml, including project path, browser, headless mode, timeouts, and security settings. Use Cursor prompts to perform actions like running all tests in headless mode, executing specific spec files, generating tests from descriptions, or validating test files, with the MCP server translating prompts into Cypress commands and returning structured results. It supports an allowlist-based security model, execution time limits, and detailed logging to help diagnose issues during automation tasks.

How to install

Prerequisites:

  • Node.js 18.0.0 or higher
  • npm or yarn
  • A Cypress project (existing or new)

Option A: Install from npm (if published)

npm install -g cypress-mcp-server

Option B: Install from source

git clone https://github.com/yourusername/cypress-mcp-server.git
cd cypress-mcp-server
npm install
npm link  # Optional: link globally for CLI access

Configure and run (example):

  1. Create or edit the MCP config YAML at a known path, e.g. /path/to/cypress-mcp.config.yaml
  2. Start the MCP server using the Node entry point or your preferred launcher, ensuring CYPRESS_MCP_CONFIG points to the YAML:
export CYPRESS_MCP_CONFIG=/path/to/cypress-mcp.config.yaml
node /path/to/cypress-mcp-server/src/index.js
  1. If you expose a global CLI, you can start via the CLI name configured during npm link, e.g.:
cypress-mcp-server

Note: Adjust paths according to your environment and how you install the server.

Additional notes

Tips and notes:

  • Ensure your cypress-mcp.config.yaml is correctly formatted and points to the Cypress project.
  • Cursor must reference the MCP server name (e.g., cypress) in its mcp.json configuration to establish the connection.
  • The server supports an allowlist of Cypress commands and timeouts; tune security settings in the YAML under security.allowedCommands and security.maxExecutionTime.
  • Logs will be written to the configured log locations; ensure the log directory exists or is writable.
  • If using the Node-based invocation, ensure the path to src/index.js matches your repository structure; otherwise, adjust to your entry point.
  • For local development, you can run Cypress commands manually via npx cypress verify to validate your Cypress installation.
  • If you deploy in production, consider locking down environment variables and using absolute paths to configuration files.

Related MCP Servers

Sponsor this space

Reach thousands of developers