Integrates with the Detox mobile testing framework (developed by Wix) to enable building and running E2E tests, generating test code, managing device configurations, and accessing test API references for React Native applications.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Detox MCPrun detox tests on iOS simulator for login flow"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Detox MCP
An MCP (Model Context Protocol) server for integrating the Detox mobile testing framework with Claude Code.
Features
Test Execution: Build and run Detox E2E tests with full options
Configuration Management: Read, validate, and generate Detox configurations
Code Generation: Generate test code, matchers, actions, and expectations
Device Management: List iOS simulators and Android emulators
Resources: Access configuration, devices, tests, and API reference
Prompts: Slash commands for common workflows
Installation
npm install -g detox-mcpOr install locally in your project:
npm install detox-mcpUsage with Claude Code
Add to Claude Code
# Add globally
claude mcp add detox-mcp
# Or with npx
claude mcp add --transport stdio detox-mcp -- npx detox-mcpProject Configuration
Create .mcp.json in your project root:
{
"mcpServers": {
"detox": {
"command": "npx",
"args": ["detox-mcp"],
"env": {
"DETOX_PROJECT_PATH": "/path/to/your/react-native/project"
}
}
}
}Available Tools
Test Execution
Tool | Description |
| Build app for Detox testing |
| Run E2E tests with full options |
| Initialize Detox in a project |
Configuration
Tool | Description |
| Read and parse .detoxrc.js |
| List available configurations |
| Validate configuration |
| Generate new configuration |
Code Generation
Tool | Description |
| Generate complete test file |
| Generate element matcher code |
| Generate action code |
| Generate expectation code |
Devices
Tool | Description |
| List iOS simulators and Android emulators |
Resources
Access contextual data via the resource URIs:
URI | Description |
| Current Detox configuration |
| Available simulators/emulators |
| Test file listings |
| Matchers API reference |
| Actions API reference |
| Expectations API reference |
| Device API reference |
Prompts (Slash Commands)
Use these prompts in Claude Code for common workflows:
Prompt | Description |
| Run tests with smart defaults |
| Generate test from description |
| Initialize Detox in project |
| Debug failing tests |
Examples
Run Tests
Ask Claude: "Run my Detox tests on iOS simulator"Claude will use detox_build and detox_test tools to execute your tests.
Generate Test Code
Ask Claude: "Generate a Detox test for the login flow"Claude will use detox_generate_test to create test code.
Check Configuration
Ask Claude: "What Detox configurations are available?"Claude will use detox_list_configurations to show available configs.
Requirements
Node.js 18+
Detox installed in your React Native project
For iOS: Xcode and applesimutils
For Android: Android SDK and emulator
Environment Variables
Variable | Description | Default |
| Path to React Native project | Current directory |
Development
# Clone the repo
git clone https://github.com/your-username/detox-mcp
# Install dependencies
npm install
# Build
npm run build
# Run in development
npm run devLicense
MIT