Get the FREE Ultimate OpenClaw Setup Guide →

testing

Let LLMs author your integration tests—E2E-style.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Install the package as a development dependency:
npm install -D testing-mcp
# or
yarn add -D testing-mcp
# or
pnpm add -D testing-mcp
  1. Verify Node 18+ and ES module support in your environment. The project uses ES modules and the WebSocket API.

  2. Configure MCP server in your AI assistant configuration (example shown below).

{
  "testing-mcp": {
    "command": "npx",
    "args": ["-y", "testing-mcp@latest"]
  }
}
  1. If you plan to run tests with the bridge locally, export TESTING_MCP in your environment:
export TESTING_MCP=true
  1. 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

Sponsor this space

Reach thousands of developers