cypress-mcp
MCP server that connects Claude to Cypress test runner, enabling reading spec files and inspecting test results including command logs, errors, and DOM snapshots.
README
cypress-mcp
MCP server that connects Claude to your Cypress test runner. Claude can read your spec files and see exactly what happened in the last test run — which commands ran, what failed, error messages, and DOM snapshots.
How it works
cypress open → test runs in browser
→ support/index.ts captures Cypress command log per test
→ cy.task('mcpSaveTestLog') transfers logs to node side
→ plugin/index.ts stores logs in memory
→ after:spec → merges logs + results → writes .cypress-mcp/last-run.json
Claude → MCP server → get_last_run → reads last-run.json
Setup
1. Install
npm install -D cypress-mcp
2. Register the plugin — cypress.config.ts
import { defineConfig } from 'cypress'
import { cypressMcpPlugin } from 'cypress-mcp/plugin'
export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
cypressMcpPlugin(on, config)
},
},
})
3. Import support — cypress/support/e2e.ts
import 'cypress-mcp/support'
4a. Configure Claude Desktop / Claude Code (stdio transport)
In your MCP settings (~/.config/claude/claude_desktop_config.json or claude mcp add):
{
"mcpServers": {
"cypress": {
"command": "npx",
"args": ["cypress-mcp", "--project", "/absolute/path/to/your/project"]
}
}
}
Or with claude mcp add:
claude mcp add cypress -- npx cypress-mcp --project /absolute/path/to/your/project
4b. HTTP transport (Ollama, custom bridges)
# Start MCP server in HTTP mode (random token printed to stderr)
npx cypress-mcp --project /path/to/project --transport http --port 3333
# Or with a fixed token for automated deployments
MCP_HTTP_TOKEN=$(openssl rand -hex 32) npx cypress-mcp --project /path/to/project --transport http --port 3333
# Server listens on:
# POST http://localhost:3333/mcp → tool calls (MCP Streamable HTTP)
MCP Tools
| Tool | Description |
|---|---|
list_specs |
List all Cypress spec files. Optional pattern glob (default: **/*.cy.{ts,js,tsx,jsx}) |
read_spec |
Read a spec file's content by relative path |
get_last_run |
Get results of the last test run: states, errors, command log, DOM snapshots |
get_screenshot |
Get info about a screenshot file: path, exists, size |
query_dom |
Query the DOM snapshot of a failed test using a CSS selector |
run_spec |
Run a single Cypress spec file and wait for completion. Returns exit code and summary |
Output format — .cypress-mcp/last-run.json
{
"timestamp": "2026-02-18T22:00:00Z",
"specs": [
{
"spec": "cypress/e2e/login.cy.ts",
"stats": { "passes": 3, "failures": 1, "pending": 0, "skipped": 0, "duration": 5230 },
"screenshots": ["/abs/path/to/Login -- should show error (failed).png"],
"tests": [
{
"title": "Login > should login with valid credentials",
"state": "passed",
"duration": 1200,
"error": null,
"domSnapshotPath": null,
"commands": [
{ "name": "visit", "message": "/login" },
{ "name": "get", "message": "#email" },
{ "name": "type", "message": "test@example.com" }
],
"consoleErrors": [],
"networkErrors": []
},
{
"title": "Login > should show error on invalid password",
"state": "failed",
"duration": 800,
"error": "Timed out retrying: Expected to find element: .error-message",
"domSnapshotPath": "snapshots/cypress-e2e-login-cy-ts/login--should-show-error-a1b2c3.html",
"commands": [...],
"consoleErrors": ["Uncaught TypeError: Cannot read property 'x' of null"],
"networkErrors": [{ "method": "POST", "url": "/api/login", "status": 500 }]
}
]
},
{
"spec": "cypress/e2e/dashboard.cy.ts",
"stats": { ... },
"screenshots": [],
"tests": [...]
}
]
}
All specs from a run are captured. In cypress run the accumulator resets on before:run. In cypress open results accumulate for the lifetime of the Cypress process. Failed tests include a domSnapshotPath pointing to an HTML file (up to 100 KB of document.body.outerHTML) stored under .cypress-mcp/snapshots/.
CLI options
Options:
--project <path> Cypress project root (default: current directory)
--transport <type> stdio or http (default: stdio)
--port <number> HTTP port, only for --transport http (default: 3333)
-V, --version Show version
-h, --help Show help
Add .cypress-mcp to .gitignore
.cypress-mcp/
Environment variables
| Variable | Description |
|---|---|
MCP_HTTP_TOKEN |
Set a fixed bearer token for HTTP transport (min 32 chars). If not set, a random token is generated on each start and printed to stderr. |
Development
This project uses Bun as the package manager:
bun install
bun run typecheck
bun run test
bun run build
Requirements
- Node.js 18+
- Cypress 12+
Author
Miroslav Myrha
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。