mcp-rn-devtools
This MCP server enables real-time debugging and inspection of running React Native apps, providing access to console logs, errors, network requests, navigation state, storage, and performance profiling.
README
mcp-rn-devtools
An MCP server that gives Claude (or any MCP host) real-time access to your running React Native app — console logs, errors, network, state, storage, performance profiling, and more. Zero config for basics, optional SDK for full power.
How It Works
Claude / MCP Host
│ MCP (stdio)
▼
mcp-rn-devtools (server)
├── CDP WebSocket ──► RN App (Hermes / Metro) ← zero config
└── SDK WebSocket ◄── mcp-rn-devtools-sdk ← optional, in-app
Layer 1 — CDP (zero config): Connects to your app via Chrome DevTools Protocol through Metro's debugger proxy. Captures console logs, errors, warnings, network requests, and provides JS evaluation, memory profiling, CPU profiling, and source map resolution. No app changes needed.
Layer 2 — SDK (optional): Install mcp-rn-devtools-sdk in your app for navigation state, Redux/Zustand state inspection, AsyncStorage/MMKV reading, render profiling, and more reliable console/error capture through a dual-channel architecture.
Installation
With Claude Code
claude mcp add rn-devtools -- npx -y mcp-rn-devtools
Or add .mcp.json to your project root (shared with your team):
{
"mcpServers": {
"rn-devtools": {
"command": "npx",
"args": ["-y", "mcp-rn-devtools"]
}
}
}
With Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"rn-devtools": {
"command": "npx",
"args": ["-y", "mcp-rn-devtools"]
}
}
}
Manual
npm install -g mcp-rn-devtools
Quick Start
- Start your React Native app — Metro must be running, Hermes engine (default since RN 0.70).
- Add the MCP server to your Claude config (see above).
- Ask Claude about your app:
- "What errors is my app showing?"
- "Show me the recent network requests"
- "What's the current navigation state?"
- "Profile the CPU for 3 seconds and show me the hot functions"
Available Tools
Logging & Errors
| Tool | Source | Description |
|---|---|---|
get_console_logs |
CDP + SDK | Console output (log, info, debug) with level filter and search |
get_errors |
CDP + SDK | JS errors and exceptions with stack traces |
get_warnings |
CDP + SDK | LogBox warnings from console.warn |
health_check |
CDP + SDK | Connection status, error/warning/request counts, uptime |
Network
| Tool | Source | Description |
|---|---|---|
get_network_requests |
CDP + SDK | HTTP requests with URL, method, status, timing, headers |
get_failed_requests |
CDP + SDK | Requests with status >= 400 or network errors |
Memory & Performance
| Tool | Source | Description |
|---|---|---|
get_memory_usage |
CDP | Current heap usage (used / total / percentage) |
take_heap_snapshot |
CDP | Heap snapshot summary — object count, top retainers by size |
get_cpu_profile |
CDP | CPU profile for N seconds — hot functions sorted by self time |
force_gc |
CDP | Trigger garbage collection, return before/after heap comparison |
Navigation
| Tool | Source | Description |
|---|---|---|
get_navigation_state |
SDK | Current route, stack, params (React Navigation) |
get_navigation_timing |
SDK | Screen transition timing with per-route summary |
State & Storage
| Tool | Source | Description |
|---|---|---|
get_app_state |
SDK | Redux/Zustand store state with dot-path access (e.g. auth.user.name) |
get_action_log |
SDK | Redux action dispatch history with filtering and summary |
get_storage_keys |
SDK | List AsyncStorage or MMKV keys with search |
get_storage_value |
SDK | Read a specific storage value |
Render Profiling
| Tool | Source | Description |
|---|---|---|
get_render_profile |
SDK | Component render events — mount/update durations, slow renders, per-component summary |
Advanced
| Tool | Source | Description |
|---|---|---|
evaluate_js |
CDP | Execute JavaScript in the app's global scope |
resolve_source_location |
CDP | Resolve bundled line:column to original source file via Metro source maps |
Source legend: CDP = works without SDK (zero config). SDK = requires the SDK installed in the app. CDP + SDK = dual-channel, captures from both sources.
SDK Setup
Install the SDK for navigation, state, storage, render profiling, and more reliable log/error capture:
npm install mcp-rn-devtools-sdk --save-dev
# or
yarn add mcp-rn-devtools-sdk --dev
Basic Usage
import { RNDevtoolsProvider } from 'mcp-rn-devtools-sdk';
export default function App() {
return (
<RNDevtoolsProvider>
<YourApp />
</RNDevtoolsProvider>
);
}
With Navigation (React Navigation)
import { RNDevtoolsProvider } from 'mcp-rn-devtools-sdk';
import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native';
export default function App() {
const navigationRef = useNavigationContainerRef();
return (
<RNDevtoolsProvider navigationRef={navigationRef}>
<NavigationContainer ref={navigationRef}>
<YourNavigator />
</NavigationContainer>
</RNDevtoolsProvider>
);
}
With State Inspection (Redux / Zustand)
import { RNDevtoolsProvider, createDevtoolsMiddleware } from 'mcp-rn-devtools-sdk';
// Redux — create middleware before store
const devtoolsMiddleware = createDevtoolsMiddleware('main');
const store = configureStore({
reducer: rootReducer,
middleware: (getDefault) => getDefault().concat(devtoolsMiddleware),
});
// Zustand — pass store directly
const useAuthStore = create((set) => ({ /* ... */ }));
export default function App() {
return (
<RNDevtoolsProvider
stateManagers={{ redux: store, auth: useAuthStore }}
reduxMiddlewares={[devtoolsMiddleware]}
>
<YourApp />
</RNDevtoolsProvider>
);
}
With Storage
import AsyncStorage from '@react-native-async-storage/async-storage';
import { MMKV } from 'react-native-mmkv';
const storage = new MMKV();
<RNDevtoolsProvider asyncStorage={AsyncStorage} mmkv={storage}>
<YourApp />
</RNDevtoolsProvider>
Per-Component Render Profiling
The SDK automatically tracks renders at the root level. For per-component granularity:
import { RNDevtoolsProfiler } from 'mcp-rn-devtools-sdk';
<RNDevtoolsProfiler id="UserList">
<UserList />
</RNDevtoolsProfiler>
Provider Props
| Prop | Type | Description |
|---|---|---|
navigationRef |
RefObject |
React Navigation container ref for route tracking |
stateManagers |
Record<string, StateStore> |
Redux/Zustand stores for state inspection |
reduxMiddlewares |
DevtoolsMiddleware[] |
Middlewares created via createDevtoolsMiddleware() |
asyncStorage |
AsyncStorageLike |
AsyncStorage instance for storage reading |
mmkv |
MMKVLike |
MMKV instance for storage reading |
port |
number |
WebSocket port (default: 8098) |
host |
string |
Dev machine host (auto-detected: localhost iOS, 10.0.2.2 Android) |
The SDK automatically strips itself from production builds via
__DEV__checks — zero overhead in release.
Configuration
| Environment Variable | Default | Description |
|---|---|---|
METRO_PORT |
8081 |
Metro bundler port |
SDK_PORT |
8098 |
SDK WebSocket port |
MCP_RN_DEBUG |
- | Enable debug logging |
Architecture
The server uses two communication channels:
-
CDP (Chrome DevTools Protocol): Connects through Metro's inspector proxy (
/jsonendpoint) to the Hermes engine. Provides console events, JS evaluation, heap/CPU profiling, and source maps. The server callsDebugger.enableto transition Hermes fromRunningDetachedtoRunningstate, thenRuntime.enablefor console event capture. Reconnects automatically with exponential backoff if the connection drops. -
SDK WebSocket: A lightweight bridge running on a separate port. The React Native SDK sends console logs, errors, network requests, navigation state, render events, state snapshots, and storage data. This provides a reliable second channel — if CDP drops, the SDK channel keeps working.
Both channels feed into shared managers (LogManager, ErrorManager, NetworkManager, etc.), and tools query these managers regardless of which channel provided the data.
Compatibility
- React Native: 0.71+
- Engine: Hermes (default since RN 0.70)
- Platforms: iOS, Android
- Node.js: 20+
- MCP Hosts: Claude Code, Claude Desktop, or any MCP-compatible client
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.