Cypress Test Generator▌
by jprealini
Automate Cypress test creation: analyze pages with Puppeteer to extract DOM elements and generate page object models, se
Automates Cypress test generation by analyzing web pages with Puppeteer to extract DOM elements and generate structured page object models with appropriate selectors and test patterns for end-to-end test automation.
Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.
best for
- / QA engineers setting up end-to-end tests
- / Frontend developers building test automation
- / Teams migrating to Page Object Model pattern
capabilities
- / Scrape web pages with Puppeteer
- / Extract DOM elements and selectors
- / Generate TypeScript Page Object classes
- / Create interaction methods for buttons and inputs
- / Parse HTML with element type detection
- / Generate getter methods for elements
what it does
Automatically generates Cypress Page Object Model classes by scraping web pages and extracting DOM elements with proper selectors and interaction methods.
about
Cypress Test Generator is a community-built MCP server published by jprealini that provides AI assistants with tools and capabilities via the Model Context Protocol. Automate Cypress test creation: analyze pages with Puppeteer to extract DOM elements and generate page object models, se It is categorized under browser automation, search web.
how to install
You can install Cypress Test Generator in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
license
MIT
Cypress Test Generator is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
readme
MCP Cypress Page Object Generator
This MCP server automatically generates Cypress Page Object classes for any web page provided.
<a href="https://glama.ai/mcp/servers/@jprealini/cypress-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@jprealini/cypress-mcp/badge" alt="Cypress Page Object Generator MCP server" /> </a>NPM package:
Features
- Web Scraping: Uses Puppeteer to fetch and render web pages
- HTML Parsing: Uses Cheerio to parse HTML and extract element information
- Page Object Generation: Creates complete TypeScript Page Object classes with:
- Private element locators
- Public getter methods
- Interaction methods (click, type, select, etc.)
Sample prompt:
Create a page object file using the following url: https://www.saucedemo.com/
Generated Output
The server generates:
1. Page Object Class ({ClassName}.ts)
export class ExampleComLoginPage {
// Private elements
#elements = {
button_login: () => cy.get('#login-button'),
input_username: () => cy.get('input[name="username"]'),
link_home: () => cy.contains('a', 'Home')
}
// Public getters
get ButtonLogin() { return this.#elements.button_login() }
get InputUsername() { return this.#elements.input_username() }
get LinkHome() { return this.#elements.link_home() }
// Interaction methods
clickButtonLogin() { return this.#elements.button_login().click() }
typeInputUsername(text: string) { return this.#elements.input_username().type(text) }
clickLinkHome() { return this.#elements.link_home().click() }
}
Element Types Supported
- Buttons: Click interactions with validation
- Input Fields: Type, clear, check/uncheck (for checkboxes/radio)
- Links: Click interactions with navigation verification
- Select Dropdowns: Select options with validation
- Textareas: Type and clear with content verification
- Forms: Submit interactions with success/error handling
Installation
Follow standard procedures to install an MCP in the client of your choice
Usage
-
Start the server:
node index.js -
Use with an MCP client: The server exposes a
generatePageObjectFiletool that accepts a URL parameter.Example tool call:
{ "method": "tools/call", "params": { "name": "generatePageObjectFile", "arguments": { "url": "https://example.com/login" } } } -
Response format: The server returns both the Page Object class:
// ===== PAGE OBJECT CLASS ===== // Save this as: ExampleComLoginPage.ts export class ExampleComLoginPage { ... }
Dependencies
@modelcontextprotocol/sdk: MCP server implementationpuppeteer: Web scraping and page renderingcheerio: HTML parsing and element selectionzod: Schema validationtypescript: Type safety
Error Handling
The server includes comprehensive error handling for:
- Invalid URLs
- Network connectivity issues
- Page loading failures
- HTML parsing errors
Browser Configuration
The server uses Puppeteer with the following settings:
- Headless mode for server environments
- No-sandbox mode for containerized deployments
- Network idle waiting for dynamic content
Contributing
To add support for new element types, interaction methods, or test patterns, modify the generatePageObjectClass function in index.js.
Troubleshooting: Updating to the Latest MCP Version
If you are intending to update to the latest version of this MCP server package but the new version is not being pulled by npm, try this:
- Clear the NPM cache and reinstall the package:
npm cache clean --force npm install @jprealini/cypress-mcp@latest --save-dev - If using a lockfile (
package-lock.jsonoryarn.lock), delete it and run:npm install - For global installs, update globally:
npm install -g @jprealini/cypress-mcp@latest - Verify the installed version:
npm list @jprealini/cypress-mcp
These steps ensure consumers always get the latest published MCP version and avoid issues with cached or locked old versions.
Example: Generated Page Object Format (saucedemo.com)
Below is an example of the expected Page Object format generated by MCP for saucedemo.com:
export class Swag_labsPage {
// Private elements
#elements = {
inputUsername: () => cy.get('[data-test="username"]'),
inputPassword: () => cy.get('[data-test="password"]'),
inputLoginButton: () => cy.get('[data-test="login-button"]')
}
// Element meta (currently not used for bulk actions)
// Public getters
get inputUsername() { return this.#elements.inputUsername() }
get inputPassword() { return this.#elements.inputPassword() }
get inputLoginButton() { return this.#elements.inputLoginButton() }
// Value/State getters
getValueInputUsername() { return this.#elements.inputUsername().invoke('val') }
getValueInputPassword() { return this.#elements.inputPassword().invoke('val') }
getTextInputLoginButton() { return this.#elements.inputLoginButton().invoke('text') }
// Interaction methods (per-element actions)
typeInputUsername(text) { return this.#elements.inputUsername().type(text) }
clearInputUsername() { return this.#elements.inputUsername().clear() }
typeInputPassword(text) { return this.#elements.inputPassword().type(text) }
clearInputPassword() { return this.#elements.inputPassword().clear() }
clickInputLoginButton() { return this.#elements.inputLoginButton().click() }
}
This format follows one of the mostly used page object standards, using data attributes for selectors, private element encapsulation, public getters, value/state getters, and interaction methods for each element.
If you need or expect a different pattern, you can generate this base structure using this MCP, and then use your own instruction set to edit it to fit your needs, using a prompt like:
Create a page object file using the following url: https://www.saucedemo.com/ and after creating it, edit it to meet the requirements described in my instructions.md file
FAQ
- What is the Cypress Test Generator MCP server?
- Cypress Test Generator is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
- How do MCP servers relate to agent skills?
- Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
- How are reviews shown for Cypress Test Generator?
- This profile displays 52 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.6 out of 5—verify behavior in your own environment before production use.
Use Cases▌
Web Research & Information Gathering
Fetch and extract information from websites automatically
Example
Research competitor pricing, scrape product reviews, monitor news mentions
Automate 5-10 hours/week of manual web research
Content Monitoring & Alerts
Track website changes, new content, price updates
Example
Monitor competitor blog for new posts, track stock availability, watch for pricing changes
Stay informed without manual checking, never miss important updates
Data Extraction & Aggregation
Extract structured data from multiple websites
Example
Compile product listings from 10 e-commerce sites, aggregate job postings, collect real estate data
Build datasets 100x faster than manual copying
API-less Integration
Interact with services that don't offer APIs
Example
Check form submissions, validate website functionality, test user flows
Automate interactions with any website, even without API
Implementation Guide▌
Prerequisites
- ›Claude Desktop or Cursor with MCP support
- ›Understanding of web scraping ethics and robots.txt
- ›Rate limiting awareness to avoid overwhelming target sites
- ›Knowledge of legal restrictions on data collection
Time Estimate
20-40 minutes including configuration and testing
Installation Steps
- 1.Install web automation MCP server via npm or pip
- 2.Configure allowed domains and rate limits in MCP config
- 3.Test with simple fetch: 'Get content from example.com'
- 4.Progress to extraction: 'Extract all product prices from this page'
- 5.Set up monitoring: 'Check this URL daily for changes'
- 6.Parse structured data: 'Create CSV from this table'
- 7.Respect robots.txt and rate limits always
Troubleshooting
- ⚠403 Forbidden: Website blocks bots—respect their wishes, use official API instead
- ⚠Rate limit errors: Slow down requests, add delays between fetches
- ⚠Stale data: Target site changed HTML structure—update selectors
- ⚠Timeout errors: Site is slow or blocking—increase timeout, try different user agent
- ⚠JavaScript-rendered content: Use headless browser MCP servers for dynamic sites
Best Practices▌
✓ Do
- +Check robots.txt and respect crawl rules
- +Rate limit requests: 1-2 requests/second maximum
- +Use official APIs when available instead of scraping
- +Identify your bot with descriptive user agent
- +Cache results to minimize repeated requests
- +Handle errors gracefully with retries and fallbacks
- +Validate extracted data for accuracy
✗ Don't
- −Don't scrape sites that explicitly forbid it (robots.txt, ToS)
- −Don't overwhelm servers with rapid requests—use rate limiting
- −Don't scrape personal data without consent and legal basis
- −Don't ignore copyright on extracted content
- −Don't assume HTML structure is stable—handle changes
- −Don't use scraped data for commercial purposes without permission
💡 Pro Tips
- ★Use CSS selectors or XPath for robust data extraction
- ★Set up monitoring alerts for extraction failures (structure changed)
- ★Implement exponential backoff for retries on failures
- ★Store raw HTML for reprocessing if extraction logic changes
- ★Combine with data analysis tools for insights from extracted data
- ★Consider using official APIs or RSS feeds as more stable alternatives
Technical Details▌
Architecture
MCP server handles HTTP requests, HTML parsing, JavaScript rendering (if headless browser), and returns structured data to Claude.
Protocols
- HTTP/HTTPS
- WebSocket (for real-time sites)
- Puppeteer/Playwright (for JavaScript sites)
Compatibility
- Static HTML sites
- JavaScript-rendered SPAs (with headless browser)
- REST APIs
- GraphQL endpoints
When to Use This▌
✓ Use When
Use for research automation, content monitoring, data aggregation from multiple sources, and when official APIs don't exist. Best for read-only information gathering.
✗ Avoid When
Avoid for sites with APIs (use API instead), sites that explicitly forbid scraping, when data is copyrighted, or for login-required content without proper authorization.
Integration▌
- →Scheduled monitoring with change detection
- →Multi-source data aggregation pipelines
- →Fallback to web scraping when API rate limits hit
- →Headless browser for JavaScript-heavy sites
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
List & Promote Your MCP Server
Share your MCP server with the developer community
Ratings
4.6★★★★★52 reviews- ★★★★★Pratham Ware· Dec 28, 2024
According to our notes, Cypress Test Generator benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
- ★★★★★Chinedu Martinez· Dec 28, 2024
Cypress Test Generator is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
- ★★★★★Kiara Flores· Dec 16, 2024
Cypress Test Generator is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
- ★★★★★Benjamin Dixit· Dec 16, 2024
Cypress Test Generator has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Sakshi Patil· Nov 19, 2024
We wired Cypress Test Generator into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
- ★★★★★Chinedu Ghosh· Nov 19, 2024
Cypress Test Generator has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Kaira Verma· Nov 7, 2024
Cypress Test Generator reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
- ★★★★★Mia Abbas· Oct 26, 2024
Useful MCP listing: Cypress Test Generator is the kind of server we cite when onboarding engineers to host + tool permissions.
- ★★★★★Chaitanya Patil· Oct 10, 2024
Cypress Test Generator is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
- ★★★★★Henry Desai· Oct 10, 2024
According to our notes, Cypress Test Generator benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
showing 1-10 of 52