mcp-frontend-testing
Frontend testing tools for Model Context Protocol
claude mcp add --transport stdio studentofjs-mcp-frontend-testing npx -y mcp-frontend-testing
How to use
The MCP Frontend Testing Server provides tools to analyze frontend code and generate or run tests for JavaScript/TypeScript projects. It exposes utilities for code analysis, test generation for Jest and Cypress, and test execution, along with a dedicated component testing tool for React components. This enables LLM-powered workflows to inspect code, propose appropriate tests, generate concrete test code, and execute tests to obtain results, all through a unified MCP interface. Use the server to feed source code and receive analysis results, or to generate ready-to-run test suites that are tailored to your chosen framework and test type.
Within this server, you can access the following tools:
- analyzeCode: Accepts source code and (optionally) language to return an analysis indicating recommended testing strategies.
- generateTest: Generates test code based on the provided source code, framework (jest or cypress), test type (unit, component, or e2e), and optional language and description.
- runTest: Executes a given test suite by supplying source code, test code, framework, test type, and optional configuration, returning the test results.
- testReactComponent: Runs component tests specifically for React components, with options for framework, props, and automatic test generation when not provided. These tools are designed to integrate into an MCP client workflow so that an LLM can orchestrate testing tasks end-to-end for frontend projects.
How to install
Prerequisites:
- Node.js and npm installed on your machine (Node.js 14+ recommended).
- Access to the repository (clone or download).
Installation steps:
- Clone the repository: git clone <repository-url> mcp-frontend-testing
- Navigate into the project: cd mcp-frontend-testing
- Install dependencies: npm install
- Build the server (if applicable in this project): npm run build
- Run the server (choose transport as needed):
- For HTTP transport: npm run start:http
- For Stdio transport: npm run start:stdio Notes:
- If you publish this package to npm under the name mcp-frontend-testing, you can also start it via npx or npm/yarn scripts provided by the package.
Additional notes
Tips and common considerations:
- If you encounter port conflicts, adjust the port in the start scripts or environment variables as needed.
- The tools assume the project structure aligns with typical frontend projects (JS/TS, with Jest/Cypress support). If your project uses alternative configurations, you may need to adapt the test templates or templates/docs references.
- Environment variables and configuration options for test execution (e.g., timeouts, parallelism) can be provided via the config parameter of runTest; refer to the generated docs for supported fields.
- Ensure you have network access when using npx to install the package on demand, or install locally first for faster startup.
- The templates and docs resources mentioned in the README (templates://{framework}/{type} and docs://{topic}) provide quick references for common test templates and documentation topics (jest, cypress, react-testing-library).
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud