npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-devtools-cdt-mcp

v0.1.0

Published

Browser library that registers React inspection and profiling tools with chrome-devtools-mcp

Readme

react-devtools-cdt-mcp

This is an experimental library. It is based on the experimental third-party developer tools API in chrome-devtools-mcp.

Browser library that registers React inspection and profiling tools with chrome-devtools-mcp.

This is not an MCP server and does not go in your MCP client config. Import it in the page under test; chrome-devtools-mcp discovers the React tools from the page.

Third-party tools are experimental. They require chrome-devtools-mcp 1.3.0+ and --categoryExperimentalThirdParty=true.

Install

npm install react-devtools-cdt-mcp

Usage

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

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

react-devtools-cdt-mcp/register throws outside a browser-like environment. The package root is side-effect-free and exports the lower-level API for custom targets:

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

chrome-devtools-mcp setup

Add the experimental third-party category to your MCP client config:

{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp@latest",
        "--categoryExperimentalThirdParty=true"
      ]
    }
  }
}

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)).

These tools can expose component props and hook values to the MCP client. Use them in local or otherwise trusted debugging sessions.

Conventions

  • UIDs — components are identified by a stable uid like r5. UIDs are consistent across every tool and across re-renders. These UIDs don't survive page reloads.
  • Output — every tool returns the shape described below as a plain JavaScript value. On failure a tool returns {error: string} instead.
  • Durations — profiler durations are in milliseconds, or null when the build does not collect profiling timing.

Tools

react_get_component_tree

Snapshot of the component tree.

  • Input: depth? (number, max depth, default 20), rootUid? (string, start from this component).
  • Output: {nodes} where nodes is an array of {uid, type, name, key, firstChild, nextSibling}. firstChild and nextSibling reference other nodes by uid (or are null).

react_get_component_by_uid

Detailed info for a single component.

  • Input: uid (string, required), includeHooks? (boolean, default false).
  • Output: {uid, type, name, key?, props?, hooks?}. props excludes children and is normalized to a serialization-safe shape; when includeHooks is true, hooks (function, forwardRef, and memo components) is an array of {id, name, value, subHooks}. Inspecting hooks re-renders the component's render function; effects are not run.

react_get_component_by_dom_element

Detailed info for the React host component corresponding to a DOM element (the host node itself, not the function component that rendered it).

  • Input: element (object, required). This is an opaque page-side DOM element reference. Chrome DevTools MCP clients pass this as {uid: string}, using an element uid from the page snapshot.
  • Output: {uid, type, name, key?, props?}.

react_find_components

Find components by case-insensitive name substring.

  • Input: name (string, required), rootUid? (string, limit to subtree), page? (number, default 1), pageSize? (number, default 10).
  • Output: {page, pageSize, totalCount, totalPages, results} where results is an array of tree nodes (same shape as react_get_component_tree).

react_get_component_source

Definition source location of a component.

  • Input: uid (string, required).
  • Output: {source: {name, fileName, line, column}}, or {source: null} when the location cannot be determined (e.g. host components, production builds).

react_get_owner_stack_trace

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

  • Input: uid (string, required).
  • Output: {stack: string} (DEV-only; empty in production).

react_get_parent_stack

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

  • Input: uid (string, required).
  • Output: an array of {uid, name, type}, ordered from immediate parent to root (empty for the root). This can include host DOM components and the root.

react_get_owner_stack

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

  • Input: uid (string, required).
  • Output: an array of {uid, name, type}, ordered from immediate owner to root owner (empty for a root component). DEV-only. Owners are not structural parents; use react_get_parent_stack for mounted tree ancestry.

react_start_profiling

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

  • Input: traceName? (string, trace name; auto-generated if omitted).
  • Output: {status: "started", traceName}.

react_stop_profiling

Stop the active profiling session.

  • Input: none.
  • Output: {status: "stopped", traceName, commits} (commits is the number of commits recorded).

react_get_trace_overview

Per-commit overview of a recorded trace.

  • Input: traceName (string, required).
  • Output: array of {commit, committedAt, renderDuration, layoutDuration, passiveDuration, componentsChanged}, one row per commit.

react_get_commit_report

Detailed report for a single commit.

  • Input: traceName (string, required), commitIndex (number, required; zero-based).
  • Output: {committedAt, priority, renderDuration, layoutDuration, passiveDuration, components} where components is an array of {uid, name, type, actualDuration, selfDuration} sorted by actualDuration descending.