About React Devtools Cdt
React Devtools Cdt is an MCP server published by react in the Browser category: the library for web and native user interfaces. Conduid read 17 tools from its source: compile, parse-react-component-tree, query-react-dev-docs, react, react_find_components, react_get_commit_report and 11 more. It is published to npm as react-devtools-cdt-mcp, a package with no command-line entry point.
The react/react monorepo this package is published from has 253K stars and 52K forks, is licensed MIT, and its last commit was on 2 Dec 2026. The latest release is v19.3.1 (14 Oct 2026): React Server Components Improve transport protocol (#37845 by @unstubbable and @eps1lon). It follows v19.2.9 (14 Oct 2026), and the 5 most recent releases go back to v19.3.0 (9 Sep 2026). It passes all 4 static checks Conduid ran on the repository. Its topics include declarative, frontend, library, react and ui.
Install
npm install react-devtools-cdt-mcpgit clone https://github.com/react/reactTools (17)
compileCompile code with React Compiler. This tool will return the compiled output, which is automatically memoized React components and hooks, written in JavaScript or TypeScript. You can run this tool whenever you want to check if some React code will compile successfully. You can also run this tool every time you make a suggestion to code, to see how it affects the compiled output. If the compiler returns a diagnostic message, you should read the diagnostic message and try to fix the code and run the compiler again to verify. After compiling code successfully, you should run it through the review-react-runtime to verify the compiled code is faster than the original. <bailouts> When you encounter a bailout or diagnostic message, first think and try to understand where the error is coming from. You can use tools such as puppeteer if available to browse the documentation links provided in the diagnostic, and then read that information to understand the error in more detail. You can propose fixes after doing so. This is a non-exhaustive list of bailouts where you should take specific actions: - React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved: fix this by first removing the manual memo (useMemo/useCallback) and then try compiling again. use the review-react-runtime tool to verify that the compiled code can run without crashing. if it crashes, the original code likely breaks the Rules of React and so cannot be safely compiled. </bailouts>| Parameter | Type | Description |
|---|---|---|
| passName | string | |
| text * | string |
parse-react-component-treeThis tool gets the component tree of a React App. passing in a url will attempt to connect to the browser and get the current state of the component tree. If no url is passed in, the default url will be used (http://localhost:3000). <requirements> - The url should be a full url with the protocol (http:// or https://) and the domain name (e.g. localhost:3000). - Also the user should be running a Chrome browser running on debug mode on port 9222. If you receive an error message, advise the user to run the following comand in the terminal: MacOS: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome" Windows: "chrome.exe --remote-debugging-port=9222 --user-data-dir=C: empchrome" </requirements>| Parameter | Type | Description |
|---|---|---|
| url | string |
query-react-dev-docsThis tool lets you search for official docs from react.dev. This always has the most up to date information on React. You can look for documentation on APIs such as <ViewTransition>, <Activity>, and hooks like useOptimistic, useSyncExternalStore, useTransition, and more. Whenever you think hard about React, use this tool to get more information before proceeding.| Parameter | Type | Description |
|---|---|---|
| query * | string |
reactInspect and profile the running React app. Components are addressed by stable uids (e.g. "r5") from react_get_component_tree; pass a uid to the other tools.react_find_componentsFind components whose name contains a substring (case-insensitive). Paginated: {page, pageSize, totalCount, totalPages, results}, where results are tree nodes. rootUid limits the search to a subtree.| Parameter | Type | Description |
|---|---|---|
| name * | string | Name substring to match. |
| page | number | Page number (default 1). |
| pageSize | number | Results per page (default 10). |
| rootUid | string | Limit the search to this component's subtree. |
react_get_commit_reportDetailed report for one commit of a trace: {committedAt, priority, renderDuration, layoutDuration, passiveDuration, components}, where components is {uid, name, type, actualDuration, selfDuration} sorted by actualDuration descending.| Parameter | Type | Description |
|---|---|---|
| commitIndex * | number | Zero-based commit index within the trace. |
| traceName * | string | The trace to query. |
react_get_component_by_dom_elementDetailed info for the React host component of a DOM element: {uid, type, name, key?, props?, meta}. meta is always present and carries type-specific info; it is always null for host nodes. This is the host node (e.g. a button or div), not the function component that rendered it. The element is an opaque page-side reference, such as the currently selected Chrome DevTools element.| Parameter | Type | Description |
|---|---|---|
| element * | object | DOM element reference from the Chrome DevTools MCP page snapshot. |
react_get_component_by_uidDetailed info for one component by uid: {uid, type, name, key?, props?, hooks?, meta}. props excludes children and is normalized for serialization; when includeHooks is true, hooks is the nested hooks tree ({id, name, value, subHooks}), present only for function/forwardRef/memo components. meta is always present and carries type-specific info: for type "suspense" it is {isSuspended: boolean} (true while the boundary shows its fallback), otherwise null.| Parameter | Type | Description |
|---|---|---|
| includeHooks | boolean | Whether to inspect hooks for function components (default false). |
| uid * | string | Component uid, e.g. "r5". |
react_get_component_sourceSource location where a component is defined: {source: {name, fileName, line, column}}, or {source: null} when unavailable (e.g. host components or production builds).| Parameter | Type | Description |
|---|---|---|
| uid * | string | Component uid, e.g. "r5". |
react_get_component_treeSnapshot of the React component tree as {nodes}, where nodes is a flat array of {uid, type, name, key, firstChild, nextSibling}. firstChild/nextSibling link nodes by uid. uid is the stable handle the other tools accept. Covers every mounted root unless rootUid scopes the walk (depth defaults to 20).| Parameter | Type | Description |
|---|---|---|
| depth | number | Maximum tree depth to traverse (default 20). |
| rootUid | string | Start the snapshot from this component uid (e.g. "r5"). |
react_get_owner_stackJSX owner chain for a component, from immediate owner to root owner: an array of {uid, name, type} (empty for a root component). Owners describe which components created/rendered this element through JSX, not where it is mounted in the rendered component tree. This DEV-only metadata differs from structural parents.| Parameter | Type | Description |
|---|---|---|
| uid * | string | Component uid, e.g. "r5". |
react_get_owner_stack_traceOwner stack trace for a component — the chain of JSX creation sites up to the root, as a raw string ({stack}) for source-map symbolication. DEV-only (empty in production).| Parameter | Type | Description |
|---|---|---|
| uid * | string | Component uid, e.g. "r5". |
react_get_parent_stackRendered parent chain for a component, from immediate parent to root: an array of {uid, name, type}. Parents describe where the node is mounted in the rendered component tree and may include host DOM components and the root. This differs from owners, which describe JSX creation/render ownership.| Parameter | Type | Description |
|---|---|---|
| uid * | string | Component uid, e.g. "r5". |
react_get_trace_overviewPer-commit overview of a trace — one row each: {commit, committedAt, renderDuration, layoutDuration, passiveDuration, componentsChanged}. Durations are in ms (null if the build omits profiler timing).| Parameter | Type | Description |
|---|---|---|
| traceName * | string | The trace to query. |
react_start_profilingStart a profiling session that records render timing on every commit. Returns {status: "started", traceName}; errors if a session is already active.| Parameter | Type | Description |
|---|---|---|
| traceName | string | Trace name (auto-generated if omitted). |
react_stop_profilingStop the active profiling session. Returns {status: "stopped", traceName, commits} (commits recorded); errors if none is active.review-react-runtimeRun this tool every time you propose a performance related change to verify if your suggestion actually improves performance. <requirements> This tool has some requirements on the code input: - The react code that is passed into this tool MUST contain an App functional component without arrow function. - DO NOT export anything since we can't parse export syntax with this tool. - Only import React from 'react' and use all hooks and imports using the React. prefix like React.useState and React.useEffect </requirements> <goals> - LCP - loading speed: good ≤ 2.5 s, needs-improvement 2.5-4 s, poor > 4 s - INP - input responsiveness: good ≤ 200 ms, needs-improvement 200-500 ms, poor > 500 ms - CLS - visual stability: good ≤ 0.10, needs-improvement 0.10-0.25, poor > 0.25 - (Optional: FCP ≤ 1.8 s, TTFB ≤ 0.8 s) </goals> <evaluation> Classify each metric with the thresholds above. Identify the worst category in the order poor > needs-improvement > good. </evaluation> <iterate> (repeat until every metric is good or two consecutive cycles show no gain) - Always run the tool once on the original code before any modification - Run the tool again after making the modification, and apply one focused change based on the failing metric plus React-specific guidance: - LCP: lazy-load off-screen images, inline critical CSS, preconnect, use React.lazy + Suspense for below-the-fold modules. if the user requests for it, use React Server Components for static content (Server Components). - INP: wrap non-critical updates in useTransition, avoid calling setState inside useEffect. - CLS: reserve space via explicit width/height or aspect-ratio, keep stable list keys, use fixed-size skeleton loaders, animate only transform/opacity, avoid inserting ads or banners without placeholders. - Compare the results of your modified code compared to the original to verify that your changes have improved performance. </iterate>| Parameter | Type | Description |
|---|---|---|
| iterations | number | |
| text * | string |
Security checks
From the react/react monorepo, not this package alone.
Static checks derived from the repository 4 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 565 words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by yarn.lock and 5 more.
2 checks have not been run yet.
Releases
From the react/react monorepo.
README
The repository's README runs to about 565 words, fetched 4 days ago. The original in the repository is authoritative.
Read full README