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.
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
Or install locally in your project:
Usage with Claude Code
Add to Claude Code
Project Configuration
Create .mcp.json in your project root:
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
Claude will use detox_build and detox_test tools to execute your tests.
Generate Test Code
Claude will use detox_generate_test to create test code.
Check Configuration
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
License
MIT