react-devtools-cdt-mcp

Integrates React tools with chrome-devtools-mcp.

Importing react-devtools-cdt-mcp/register before React installs the DevTools hook and registers a React tool group via chrome-devtools-mcp's devtoolstooldiscovery / __dtmcp third-party-tool protocol. The React tools then become discoverable and callable inside a chrome-devtools-mcp session — no separate server.

Usage

Import the register entry before React so the hook is installed before React initializes:

import 'react-devtools-cdt-mcp/register';
import React from 'react';

The package root is side-effect-free and exports the lower-level API for custom targets:

import {register, buildToolGroup} from 'react-devtools-cdt-mcp';

When the page runs under chrome-devtools-mcp, the React tools are listed by list_3p_developer_tools and callable either via execute_3p_developer_tool({toolName, params}) or directly via evaluate_script (window.__dtmcp.executeTool(toolName, params)).

Conventions

Tools

react_get_component_tree

Snapshot of the component tree.

react_get_component_by_uid

Detailed info for a single component.

react_get_component_by_dom_element

Detailed info for the React DOM component corresponding to a DOM element.

react_find_components

Find components by case-insensitive name substring.

react_get_component_source

Definition source location of a component.

react_get_owner_stack_trace

Raw owner stack trace — the chain of JSX creation locations up to the root.

react_get_parent_stack

Rendered parent list — where a component is mounted in the rendered component tree.

react_get_owner_stack

Structured owner list — which components created/rendered this element through JSX.

react_start_profiling

Start a profiling session that records per-commit render timing.

react_stop_profiling

Stop the active profiling session.

react_get_trace_overview

Per-commit overview of a recorded trace.

react_get_commit_report

Detailed report for a single commit.