AI Runtime Debugging đ
Reading source code only tells an AI agent what your app should do. To debug what it actually does, the agent needs to look inside the running app. Since v22, Angular registers in-page AI debugging tools in development mode, so an agent connected to Chrome can ask Angular directly for the live dependency-injection graph and signal graph.
What youâll learn
Section titled âWhat youâll learnâ- What Angularâs AI runtime debugging tools are and when theyâre available
- What
angular:di_graphandangular:signal_graphreturn - How an AI agent calls them through Chrome DevTools for agents (
chrome-devtools-mcp) - Prompts that make good use of them, and their current limits
What Angular registers
Section titled âWhat Angular registersâWhen an Angular platform is created in dev mode, Angular listens for a browser event named devtoolstooldiscovery. Chrome DevTools dispatches this event to ask the page which developer tools it offers, and Angular answers with a tool group named Angular containing two tools:
| Tool | Input | Returns |
|---|---|---|
angular:di_graph | none | The whole dependency injection graph: the element-injector tree (per component/directive host element) and the environment-injector tree, with the providers at each level and their values if already created |
angular:signal_graph | target: the host element of a component | The reactive graph behind that component: signals, computeds, effects and the template, with current values and which node reads which |
Good to know:
- Dev mode only. The tools are registered only when
ngDevModeis on (for exampleng serve). Production builds donât include them. - No setup. Thereâs no provider to add â they register when the platform starts and unregister when itâs destroyed.
- Read-only. They inspect state; they donât change your app.
- Not WebMCP. These are debugging tools for developers, not tools for your usersâ agents. App features for agents are covered in WebMCP Tools.
angular:di_graph output (shape)
Section titled âangular:di_graph output (shape)âelementInjectorRoots[] one per Angular root ([ng-version]) on the page name, type: 'element' providers[] { token, value } hostElement DOM element of the component/directive children[] nested element injectorsenvironmentInjectorRoot name, type: 'environment' | 'null' providers[] { token, value } children[] child environment injectors (e.g. lazy routes)Use it for questions like âwhy do these two components get different instances of CartStore?â or âwhich injector provides API_URL on the checkout page?â.
Current limitations (documented in the implementation): the link between a component and the specific environment injector it uses isnât included, and pages with multiple Angular apps (micro-frontends) arenât supported.
angular:signal_graph output (shape)
Section titled âangular:signal_graph output (shape)ânodes[] { kind: 'signal' | 'computed' | 'effect' | 'template', value, label, epoch }edges[] { consumer, producer } indexes into nodes[]: "nodes[consumer] reads nodes[producer]"label is the variable name when Angular can tell (const total = computed(...) â total). The graph includes signals from services that the component depends on, but not signals used only by child components. Itâs ideal for âwhy didnât this view update?â or âwhat does cartTotal depend on?â.
Letting an AI agent use them
Section titled âLetting an AI agent use themâThe tools are discovered by Chrome DevTools. The simplest way to give a coding agent (Copilot, Claude Code, Cursor, Gemini CLIâŠ) access is Chrome DevTools for agents, the chrome-devtools-mcp MCP server. Its third-party tools category is experimental and off by default, so enable it with a flag:
{ "servers": { "chrome-devtools": { "command": "npx", "args": ["-y", "chrome-devtools-mcp@latest", "--categoryExperimentalThirdParty=true"] }, "angular-cli": { "command": "npx", "args": ["-y", "@angular/cli", "mcp"] } }}With that flag the agent gets two extra MCP tools:
list_3p_developer_toolsâ lists in-page developer tools, including Angularâsangular:di_graphandangular:signal_graphexecute_3p_developer_toolâ runs one of them and returns the result
A typical session:
- The agent starts your dev server (for example with the Angular MCP serverâs
devserver_start). - It opens
http://localhost:4200in Chrome viachrome-devtools-mcpand reproduces the bug. - It calls
list_3p_developer_tools, thenexecute_3p_developer_toolwithangular:di_graphorangular:signal_graph. - It compares the live graph with the source code and proposes a fix.
Example prompts:
Open http://localhost:4200/cart in Chrome. Use the Angular in-page developer toolsto get the DI graph and tell me which injector provides CartStore for <app-cart-summary>and <app-mini-cart>. Are they the same instance?The total in <app-cart-summary> doesn't update after removing an item.Use angular:signal_graph on that component's host element, explain the dependencychain for the total, and point to the missing or wrong signal dependency.Related debugging tools
Section titled âRelated debugging toolsâ- Angular DevTools (browser extension) shows the component tree, DI tree, signal graph and profiler for humans. See Angular DevTools.
provideStabilityDebugging()(@angular/core) logs which pending tasks keep an app from becoming stable â useful for SSR/hydration timeouts. Itâs on by default in dev mode when you useprovideClientHydration(); add it manually only for temporary debugging in other setups.- The Angular MCP server lets the agent build, test and read dev-server logs, which pairs well with runtime inspection.
Key takeaways
Section titled âKey takeawaysâ- In dev mode, Angular 22 exposes
angular:di_graphandangular:signal_graphto Chrome DevTools through thedevtoolstooldiscoveryevent. - AI agents reach them through
chrome-devtools-mcpwith--categoryExperimentalThirdParty=true(list_3p_developer_tools/execute_3p_developer_tool). - Use them to answer âwhich instance?â (DI) and âwhy didnât it update?â (signals) questions with real runtime data.
Next steps
Section titled âNext stepsâ- Set up the Angular MCP server: Angular MCP Server
- Understand injector hierarchies: Dependency Injection
- Understand signal dependencies: Signals