MCP Hub
Back to servers

Detox MCP

Detox MCP integrates the Detox mobile testing framework into AI workflows, allowing for automated end-to-end test execution, device management, and code generation for React Native applications.

Tools
12
Updated
Jan 1, 2026

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-mcp

Or install locally in your project:

npm install detox-mcp

Usage 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-mcp

Project 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

ToolDescription
detox_buildBuild app for Detox testing
detox_testRun E2E tests with full options
detox_initInitialize Detox in a project

Configuration

ToolDescription
detox_read_configRead and parse .detoxrc.js
detox_list_configurationsList available configurations
detox_validate_configValidate configuration
detox_create_configGenerate new configuration

Code Generation

ToolDescription
detox_generate_testGenerate complete test file
detox_generate_matcherGenerate element matcher code
detox_generate_actionGenerate action code
detox_generate_expectationGenerate expectation code

Devices

ToolDescription
detox_list_devicesList iOS simulators and Android emulators

Resources

Access contextual data via the resource URIs:

URIDescription
detox://configCurrent Detox configuration
detox://devicesAvailable simulators/emulators
detox://testsTest file listings
detox://api/matchersMatchers API reference
detox://api/actionsActions API reference
detox://api/expectationsExpectations API reference
detox://api/deviceDevice API reference

Prompts (Slash Commands)

Use these prompts in Claude Code for common workflows:

PromptDescription
/detox-testRun tests with smart defaults
/detox-generateGenerate test from description
/detox-setupInitialize Detox in project
/detox-debugDebug 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

VariableDescriptionDefault
DETOX_PROJECT_PATHPath to React Native projectCurrent 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 dev

License

MIT

Reviews

No reviews yet

Sign in to write a review