CLI Init — Quick Setup
Set up React Native MCP in your project with a single command.
This replaces all manual steps (babel config, client config, gitignore) with one interactive wizard.
How it works
Steps in detail
Step 1 — Project Detection
The init command reads your project directory and automatically detects:
If react-native is not found in package.json, the command exits with an error.
Step 1.5 — External Tool Check
Automatically checks whether adb (Android) and idb (iOS, macOS only) are installed.
If a tool is missing, a warning with install instructions is shown, but setup continues. For detailed instructions see Install & connect — Native tools.
Step 2 — MCP Client Selection
You are prompted to choose your MCP client. This determines where the config file is created.
The generated config contains:
If the file already exists, the react-native-mcp entry is merged in — existing settings are preserved.
Step 3 — Apply Changes
Three files are modified (after the tool check):
- babel.config.js — Appends
@ohah/react-native-mcp-server/babel-presetto thepresetsarray. - MCP client config — Created or merged as described above.
- .gitignore — Appends
/results/(used by E2E test outputs).
Each step is idempotent: running init again skips already-applied changes.
Step 4 — Next Steps
Based on your project type, the command shows what to do next:
- Expo:
npx expo start - Bare RN:
REACT_NATIVE_MCP_ENABLED=true npx react-native start
Options
Idempotent
Running init multiple times is safe:
$ npx -y @ohah/react-native-mcp-server init --client cursor -y