| 1 | # Fixture app |
| 2 | |
| 3 | A small React app for manually exercising the `react-devtools-cdt-mcp` tools with |
| 4 | [chrome-devtools-mcp](https://github.com/ChromeDevTools/chrome-devtools-mcp). |
| 5 | Not part of the published package. |
| 6 | |
| 7 | It renders a variety of components so every tool has something to inspect: |
| 8 | function/host/context/memo/forwardRef nodes, a custom hook (nested `subHooks`), |
| 9 | keyed list items, and timer/button components that re-render (for profiling). |
| 10 | |
| 11 | Like `react-devtools-shell`, React (and the DevTools backend dependencies the |
| 12 | facade uses) are resolved from the monorepo build output via webpack aliases, so |
| 13 | the fixture runs against React from source — no CDN copy, and |
| 14 | `react_get_component_by_uid` hooks inspection matches the build exactly. |
| 15 | |
| 16 | ## Run |
| 17 | |
| 18 | 1. Build React for DevTools from the repo root (populates |
| 19 | `build/oss-experimental/`): |
| 20 | |
| 21 | ```sh |
| 22 | yarn build-for-devtools |
| 23 | ``` |
| 24 | |
| 25 | 2. Start the fixture dev server (bundles the package source + this app): |
| 26 | |
| 27 | ```sh |
| 28 | cd packages/react-devtools-cdt-mcp/fixtures/app |
| 29 | yarn start |
| 30 | ``` |
| 31 | |
| 32 | This opens `http://localhost:8080/`. |
| 33 | |
| 34 | 3. Point chrome-devtools-mcp at the page. The React tool group is discovered |
| 35 | automatically — list it with `list_3p_developer_tools` and call the tools with |
| 36 | `execute_3p_developer_tool({toolName, params})`. |
| 37 | |
| 38 | ## Test with the chrome-devtools-mcp CLI |
| 39 | |
| 40 | With the dev server running, drive the tools end-to-end from the CLI: |
| 41 | |
| 42 | 1. Start chrome-devtools-mcp with experimental third-party tools enabled: |
| 43 | |
| 44 | ```sh |
| 45 | chrome-devtools start --categoryExperimentalThirdParty=true |
| 46 | ``` |
| 47 | |
| 48 | 2. Navigate to the fixture page: |
| 49 | |
| 50 | ```sh |
| 51 | chrome-devtools navigate_page --url http://localhost:8080 |
| 52 | ``` |
| 53 | |
| 54 | 3. Run a React tool by name: |
| 55 | |
| 56 | ```sh |
| 57 | chrome-devtools execute_3p_developer_tool <react-tool-name> |
| 58 | ``` |