testing
Let LLMs author your integration tests—E2E-style.
claude mcp add --transport stdio mcpland-testing-mcp npx -y testing-mcp@latest
How to use
Testing MCP is an integration-focused MCP server that enables AI assistants to interact with live React test environments. It provides real-time inspection of the test page structure, console logs, and available testing APIs, plus the ability to execute JavaScript/TypeScript directly within the running test harness. This enables AI to explore the DOM, trigger events, and iterate on test steps without requiring manual edits to test files. Once connected, you gain access to MCP tools such as get_current_test_state, execute_test_step, and get_generated_code, which help you inspect, run, and generate test code with context-aware guidance. The server is designed for multi-client use, allowing concurrent connections from Claude Desktop, Cursor, VS Code, and more, all coordinated through a bridge daemon that allocates ports dynamically.
To use Testing MCP, first install the package in your project and configure the MCP server in your AI assistant (for example Claude Desktop or VS Code). Then connect your tests using the testing-mcp client helper in your test setup (e.g., a Jest setup file), and wrap your test interactions with the connect() call. When connected, you can prompt the AI to inspect the current page structure, run test steps, or generate assertions. Remember to set TESTING_MCP=true locally to enable the bridge during development, and disable or bypass it in CI environments.
How to install
Prerequisites:
- Node.js 18+ installed on your machine
- npm, yarn, or pnpm for package installation
Step-by-step installation:
- Install the package as a development dependency:
npm install -D testing-mcp
# or
yarn add -D testing-mcp
# or
pnpm add -D testing-mcp
-
Verify Node 18+ and ES module support in your environment. The project uses ES modules and the WebSocket API.
-
Configure MCP server in your AI assistant configuration (example shown below).
{
"testing-mcp": {
"command": "npx",
"args": ["-y", "testing-mcp@latest"]
}
}
- If you plan to run tests with the bridge locally, export TESTING_MCP in your environment:
export TESTING_MCP=true
- Add the testing-mcp client usage in your test setup (as shown in the README) and start integrating AI-assisted testing in your workflow.
Additional notes
Tips and common considerations:
- Environment variables: TESTING_MCP enables the bridge; RTL_SKIP_AUTO_CLEANUP can be set to prevent automatic DOM cleanup after test hooks if you need to preserve state for AI inspection.
- In CI environments, Testing MCP is automatically disabled to avoid unnecessary overhead.
- If you plan to connect multiple test files simultaneously, leverage the Multi-Client Architecture to avoid port conflicts.
- Ensure your Node.js version remains compatible with ES modules and the WebSocket API used by the MCP bridge.
- The MCP Tools panel (or equivalent UI in your integration) exposes actions like get_current_test_state, execute_test_step, and get_generated_code to help you inspect, run, and generate test code.
- When writing tests with the provided connect() helper, you can supply context objects and contextDescriptions to aid AI understanding of your APIs.
Related MCP Servers
mcp
BrowserStack's Official MCP Server
furi
CLI & API for MCP management
mcp -arangodb
This is a TypeScript-based MCP server that provides database interaction capabilities through ArangoDB. It implements core database operations and allows seamless integration with ArangoDB through MCP tools. You can use it wih Claude app and also extension for VSCode that works with mcp like Cline!
CodeRAG
Advanced graph-based code analysis for AI-assisted software development
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!
dida
A Model Context Protocol (MCP) server for interacting with TickTick/Dida365 task management service. This server provides tools to manage tasks, projects, and tags through the TickTick API.