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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。