
Cypress Mcp
io.github.miroslavmyrha由 GitHub 帳號 miroslavmyrha 發布v0.1.2更新於 Oct 24, 2026
Shows an AI assistant the last cypress run: command log, errors, screenshots, DOM of failed tests.
發布方自己的服務:Cypress Cloud MCP
概覽
讓 AI 助理查看最近一次 Cypress 測試執行的指令記錄、錯誤、截圖與失敗測試的 DOM。
- 可以做什麼
- 它讀取最近一次 cypress run 的結果,讓助理看到每個測試執行了哪些指令、失敗的錯誤訊息、截圖,以及失敗當下的 DOM 快照。工具包含 list_specs、read_spec、get_config、get_last_run、get_screenshot、query_dom 與 run_spec,其中 run_spec 可執行單一 spec 並等待完成。
- 適用情境
- 當 Cypress 測試以 headless 模式在本機或 CI 執行,而你希望助理直接看到失敗原因時使用。若你是在開啟的 Cypress 應用程式中邊寫測試邊除錯,官方 cypress tap 更合適。
- 執行需求
- 需 Node.js 18+ 與 Cypress 12+,並在 cypress.config 註冊外掛、在 support 檔案匯入支援模組。以 npm 套件 @miroslavmyrha/cypress-mcp 安裝,透過 stdio 或 HTTP 連線;HTTP 模式可設定 MCP_HTTP_TOKEN。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Cypress Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
cypress-mcp
MCP server that shows an AI assistant what happened in your last cypress run: which commands each test ran, what failed, the error, a screenshot, and the page as it was at the moment of the failure.
It is made for headless runs, on your machine and in CI. That is the place the official tools do not reach, see How it compares.
Example
A spec with three tests, the last of which fails:
After cypress run, the assistant calls get_last_run and gets the commands that ran, the error and the path of a DOM snapshot (output shortened):
It can then look into the page as it was when the test failed. query_dom with the selector .todo-count:
So the counter exists, under another selector, and the assistant can fix the test without anyone pasting logs into the chat.
How it works
How it compares
Cypress has two tools of its own for AI assistants. They cover other situations than this one.
Use cypress tap while you write a test with the Cypress app open. Use this package when the tests run headless and the assistant should see why one failed.
The results are written in the after:spec event, which Cypress fires in run mode. In cypress open that event needs experimentalInteractiveRunEvents.
Before anything reaches the assistant, values that look like secrets are redacted, and content that comes from the tested application is marked as untrusted data.
Setup
1. Install
Note: the unscoped
cypress-mcpname on npm belongs to an unrelated project. Always use the scoped@miroslavmyrha/cypress-mcp.
2. Register the plugin in cypress.config.ts
3. Import support in cypress/support/e2e.ts
4a. Configure Claude Desktop / Claude Code (stdio transport)
In your MCP settings (~/.config/claude/claude_desktop_config.json or claude mcp add):
Or with claude mcp add:
4b. HTTP transport (Ollama, custom bridges)
MCP Tools
Output format of .cypress-mcp/last-run.json
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
Add .cypress-mcp to .gitignore
Environment variables
Development
This project uses Bun as the package manager:
Requirements
- Node.js 18+
- Cypress 12+ (developed and tested with Cypress 13)
Author
Miroslav Myrha
License
MIT
來源:README.md,提交 f6b9153
工具
0版本歷史
1- v0.1.2最新Oct 13, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
