Debugging Angular Apps with AI: Chrome DevTools MCP + Angular CLI MCP in Practice
We gave AI 3 hidden bugs in an Angular app and only told it what users complained about. See how Chrome DevTools MCP and Angular CLI MCP helped it find, fix, and test them in minutes.

On this page48 sections
In short: Chrome DevTools MCP and Angular CLI MCP let an AI assistant run your Angular app, open it in a real browser, and check what users actually see. We gave Claude Code 3 hidden bugs, and it found each one in under 5 minutes, from user complaints alone.
Try it yourself: https://github.com/SamarthBhattRorix/wms-angular-devtools-mcp-demo
1. Introduction
You ask AI to fix a bug. It reads your code and says, "Looks fine to me."
But the bug is still there.
That happens because many frontend bugs don't live in the code. They live in the running app. The page freezes when you type. An API call fails quietly. A filter shows the wrong rows. To catch these, someone has to open the browser and look.
Now, AI can do that too.
With two free, open-source MCP tools, Chrome DevTools MCP and Angular CLI MCP, an AI coding assistant can:
- start your Angular app,
- open it in a real Chrome window,
- check the console, network calls, and performance,
- fix the code, run the tests, and check the browser again.
We wanted to see if this really works. So we built a small Angular warehouse dashboard, hid 3 bugs in it, and gave each one to Claude Code. We only told it what a user would complain about. No hints.
Here are the results:
- Broken API call: found in about 1 minute
- Slow page: found in under 3 minutes, with real numbers
- Wrong filter: found, fixed, tested, and re-checked in under 5 minutes
Along the way, we picked up a few practical tips, like how to record a performance trace without crashing the browser tab.
2. Why AI couldn't really debug Angular apps before
Here's how most of us fix a frontend bug with AI today.
We open the app and something looks wrong. We press F12, open the console, and copy the error. We paste it into the AI chat. The AI suggests a fix. We try it, and it's still broken. So we go back to the browser, copy more details, and paste again.
We become the AI's eyes. It only knows what we copy and paste.
And some problems are hard to copy at all:
- Slow pages. We can say "it feels slow," but the AI can't feel it. It needs real timing numbers.
- Silent failures. Some requests fail without any clear error on screen. Unless someone opens the Network tab, nobody even knows what to paste.
- Wrong results. The page shows the wrong numbers, but nothing crashes. There's no error message to copy.
So the AI ends up guessing from the code. Sometimes the guess is right. Often it isn't.
Here's what changes with MCP:
| Before | With Chrome DevTools MCP + Angular CLI MCP | |
|---|---|---|
| Who opens the browser? | The developer | The AI |
| Who reads the console and network? | The developer copies and pastes | The AI reads them directly |
| Slow page | "It feels slow" | Real numbers from a performance trace |
| After the fix | The developer tests it manually | The AI runs the tests and checks the browser again |
The AI stops guessing and starts checking.
3. The two tools, explained simply
First, a quick word on MCP (Model Context Protocol). It's a standard way to give an AI assistant new tools. Instead of only reading and writing code, the AI can now do things, like start a server or open a browser. If you want the full picture, our team explained MCP in detail in Building an MCP Server for a WMS.
For this demo, we used two MCP servers. The easiest way to think about them:
- Angular CLI MCP is the AI's hands in your project.
- Chrome DevTools MCP is the AI's eyes in the browser.
Angular CLI MCP comes built into the Angular CLI (official docs). You don't install anything extra. It lets the AI:
- start and stop the dev server (like running
ng serve), - build the project,
- run the unit tests,
- search the official Angular docs.
Chrome DevTools MCP comes from the Chrome DevTools team (GitHub). It lets the AI:
- open your app in a real Chrome window,
- click, type, and scroll like a user,
- read console messages and network requests,
- record a performance trace and read the numbers,
- take screenshots.
Here's how they work together:
| Step | Tool |
|---|---|
| Start the app | Angular CLI MCP |
| Open it and find the problem | Chrome DevTools MCP |
| Fix the code | The AI assistant itself |
| Run the tests | Angular CLI MCP |
| Check the fix in the browser | Chrome DevTools MCP |
In our setup, Angular CLI MCP gave the AI 9 tools, and Chrome DevTools MCP gave it 33.
4. Setup
Setup takes about 10 minutes. Here's what you need:
- Node.js (we used 24.21.0)
- Angular CLI (we used 22.3.0)
- Google Chrome
- Claude Code (needs a paid Claude plan)
Step 1: Get the demo app
git clone https://github.com/SamarthBhattRorix/wms-angular-devtools-mcp-demo
cd wms-angular-devtools-mcp-demo
npm installStep 2: Connect the two MCP servers
Good news: the repo already includes a .mcp.json file with both servers. If you're adding them to your own project instead, create a .mcp.json file in the project root:
{
"mcpServers": {
"angular-cli": {
"command": "npx",
"args": ["-y", "@angular/cli", "mcp"]
},
"chrome-devtools": {
"command": "npx",
"args": [
"-y",
"chrome-devtools-mcp@latest",
"--isolated",
"--performanceCrux=false",
"--usageStatistics=false"
]
}
}
}On Windows, use "command": "cmd" and add "/c", "npx" at the start of args. Without this, Windows can't start npx, and the servers never connect. The README has the full Windows version.
We'll explain the three -- options in the safety section.
Step 3: Approve and check
Start Claude Code in the project folder:
claudeIt will ask you to approve the two new servers. Select both and choose Enable selected. Then type /mcp. You should see both servers with a green tick: angular-cli with 9 tools and chrome-devtools with 33.
Step 4: A quick test
Before hunting bugs, make sure the browser connection works:
Use the chrome-devtools MCP tools to open https://example.com and take a screenshot.A new Chrome window should open with the message "Chrome is being controlled by automated test software." That's the AI's own browser, separate from yours.
Something not working? See Troubleshooting near the end of this post.
5. Bug 1: The slow page
What users see: The dashboard shows 10,000 stock items. Type in the search box, and the page freezes. Each letter shows up late.
No error. No wrong numbers. Just slow.
This is the hardest kind of bug to hand to AI. There's nothing to copy and paste. "It feels slow" isn't much to work with.
The prompt:
Users say the stock dashboard feels slow when typing in the search box. Use the angular-cli MCP tools to start the dev server if it isn't running, then use the chrome-devtools MCP tools to open the app. Wait until the table has loaded, then record a short performance trace while typing just the letter "z" in the search box, and stop the trace right after. Find out what is causing the slowness and explain it with the numbers you measured. Don't change any code yet.Tip: keep the traced action short. One keypress is enough. On a heavy page, a long recording can crash the browser tab.
What the AI did
It opened the app, waited for the table to load, started a performance trace, typed "z", and stopped the trace. Then it went through the trace to see where the time went.
Total time: under 3 minutes.
What it found
Typing a single letter blocked the page for 2.3 seconds. Chrome measures this as INP (Interaction to Next Paint): ours was 2,264 ms, well above the 500 ms line for "poor."
Here's where the time went:
| Work | Time |
|---|---|
| Removing about 8,800 rows from the page | 868 ms |
The zoneShare() calculation | 531 ms |
| Laying out the page | 228 ms |
| Painting the screen | about 220 ms |
| Angular cleaning up removed rows | 137 ms |
Two causes:
- A calculation that repeats itself. For every row,
zoneShare()loops through all 10,000 items. That's millions of steps on every update. There are only 4 zones, so the totals can be worked out once and reused. - Too many rows on screen. The page draws every match, with no limit. When a search goes from 10,000 rows to about 1,200, the browser removes about 8,800 rows at once. Paging or virtual scrolling fixes this.
Why the numbers matter
Reading the code, the zoneShare() loop looks like the obvious problem. But the trace shows that removing rows costs even more.
Without numbers, you'd probably fix the smaller problem first. With a real trace, you know exactly where to start.
6. Bug 2: The warehouse box that never loads
What users see: Under the dashboard title, there's a small grey box. It should show the warehouse name. Instead, it says "Loading warehouse info..." forever.
No crash. No error on screen. The rest of the page works fine. It just never finishes loading.
The prompt:
Users say the grey box under the dashboard title always shows "Loading warehouse info..." and never shows the warehouse details. Use the angular-cli MCP tools to start the dev server, then use the chrome-devtools MCP tools to open the app, check the console messages and network requests, and find out why. Explain the cause, but don't change any code yet.What the AI did
It started the dev server, opened the app in Chrome, and checked two places: the Network tab and the Console. The same two places a developer would check.
Total time: about 1 minute.
What it found
- Network: the request for
/data/warehouses.jsonreturned 404 Not Found. The stock data loaded fine, which is why the rest of the page worked. - Console: one error,
Failed to load resource: 404 (Not Found). No Angular error at all.
The cause was a single letter. The code asks for warehouses.json, but the file is called warehouse.json.
Why it said "Loading..." forever
The AI also identified why users never saw an error message:
- The request fails with a 404.
- The component only handles a successful response. The error is silently ignored.
- The warehouse data stays empty.
- The template shows "Loading..." whenever the data is empty.
So a failed request looks exactly like one that's still loading.
The fix it suggested: change the URL to /data/warehouse.json. As a bonus, it suggested showing an error message when loading fails, so users aren't left waiting.
Why this matters
Bugs like this are easy to miss. Nothing looks broken, and nothing shows up unless someone opens the Network tab. The AI checked the browser directly and found the cause in about a minute.
7. Bug 3: The full loop
What users see: The "Low stock" card says 1902. But when they tick "Show low stock only," the list shows only 981 items.
Nothing crashes. Every item in the list really is low on stock. But more than 900 items are missing.
This time, we asked the AI to do the whole job: find the bug, fix it, write a test, and check the browser again.
The prompt:
Users say the "Low stock" card shows 1902, but when they tick "Show low stock only" the list shows only 981 items. Use the angular-cli MCP tools to start the dev server if it isn't running, and use the chrome-devtools MCP tools to open the app and confirm the problem in the browser. Then find the cause, fix it with the smallest change, and add a unit test that would catch this problem. Run the tests with the angular-cli MCP tools. Finally, check in the browser again that the filtered list now matches the card. Only fix this problem; don't change anything else, even if you notice other issues.Step 1: Find and confirm
The AI read the code and spotted a likely cause. Then it opened the app in Chrome, ticked the checkbox, and confirmed the problem: 1902 on the card, 981 in the list.
Step 2: The cause
The same rule was written in two places, in two different ways:
- The card counts an item as low when available stock (on hand minus allocated) is below the reorder level.
- The filter only checked on hand, and forgot about allocated stock.
So items with plenty on the shelf, but most of it already promised to orders, were counted on the card but missing from the list.
Step 3: The fix
One line:
// Before
result = result.filter((item) => item.onHand < item.reorderLevel);
// After
result = result.filter((item) => item.onHand - item.allocated < item.reorderLevel);Step 4: A test that catches it
The AI added a new test file, stock-list.spec.ts. The test loads 3 items, including one with enough on hand but too little available. Then it ticks the checkbox and checks that the list matches the card.
Then it did something many developers skip. It ran the new test against the old code first, to make sure the test actually fails when the bug is there. It did. Then it put the fix back and ran all the tests again.
All 3 tests passed.
Step 5: Check the browser again
Finally, the AI went back to Chrome, ticked the checkbox again, and checked the numbers. 1902 on the card. 1902 in the list.
One more good sign: the AI noticed Bug 2 while working, but left it alone, just as the prompt asked. The change stayed small and focused.
Total time for the full loop: under 5 minutes.
8. Safety
Giving AI a real browser is powerful. It also means the AI can see whatever that browser can see. A few simple habits keep this safe.
Use a separate browser profile
The --isolated option makes Chrome DevTools MCP open a fresh Chrome window with a temporary profile. No saved passwords, no logged-in accounts, no open tabs. When the window closes, the profile is deleted.
Without it, the AI could end up working in a browser that's signed in to your email, your company tools, or your cloud console.
Point it at local or test environments only
The AI reads everything on the page: names, numbers, and customer details. Use localhost or a test server with fake data, as in our demo. Avoid production.
For extra control, Chrome DevTools MCP also has an --allowedUrlPattern option that limits which sites the browser can open, for example only localhost. It needs a recent Chrome version.
Decide what data leaves your machine
Two more options from our setup:
--performanceCrux=falsestops page URLs from being sent to Google's CrUX service during performance traces.--usageStatistics=falseturns off Google's usage statistics for the tool.
Neither is required, but for internal or client projects, it's a good idea to keep them off.
Treat page content as data, not instructions
The AI reads text from the page. If a page contains hidden text like "ignore your instructions and do X," a careless setup could follow it. This is called prompt injection. Another reason to stick to your own local apps.
Work on a branch and review every change
For Bug 3, the AI changed code, created a test, and ran Git commands. We gave it its own branch, fix/low-stock-filter, so main stayed untouched. Before committing, review the change yourself, just as you would a teammate's pull request.
Quick checklist
--isolatedis on- Only local or test URLs
- No real customer data
- Work on a separate branch
- Review before you commit
9. What worked well, and what didn't
What worked well
- It found all 3 bugs from symptoms alone. No file names, no hints.
- It measured instead of guessing. The trace pointed to a different main cause than the code did.
- It explained the "why." Not just the 404, but why users saw "Loading..." forever.
- It checked its own test. The new test failed on the old code before the AI trusted it.
- It stayed in scope. Asked to fix one bug, it left the others alone.
What to watch out for
- Very large pages slow the tools down. With 10,000 rows, one of the page-reading tools timed out. The AI found another way, but on huge pages, expect some steps to take longer.
- Performance traces use a lot of memory. Keep the traced action short, like one keypress or one click. On machines with less RAM, analyzing a big trace can be slow.
- Clear prompts get better results. Describe what the user sees, and say which tools to use. Naming both MCP servers in the prompt made the AI use the browser instead of guessing from code.
- You still review the change. The AI's fix was right, but it's still your code. Read the diff before you commit.
10. Troubleshooting
claude is not recognized after installing (Windows)
The install folder isn't on your PATH yet. Add it in Windows environment variables, then restart VS Code or your terminal.
The servers don't show up in /mcp
Check the file name. Windows sometimes saves it as .mcp.json.txt. Running claude mcp add --scope project ... creates the file correctly.
The servers don't start on Windows
Use "command": "cmd" and add "/c", "npx" at the start of args in .mcp.json.
The servers time out on first start
The first run downloads packages, which can be slow. Start Claude Code with a longer timeout:
# Windows (PowerShell)
$env:MCP_TIMEOUT=60000; claude# macOS / Linux
MCP_TIMEOUT=60000 claude11. Conclusion
AI assistants are good at reading code. But many frontend bugs only show up in the running app.
With Angular CLI MCP and Chrome DevTools MCP, the AI can finally see what users see. It can start the app, open it in Chrome, check the console, measure performance, fix the code, run the tests, and confirm the fix in the browser.
The AI doesn't replace your judgment. You still decide what to fix and review every change. But it removes the slow part: the copying, pasting, and guessing.
Try it today
The easiest way to start is our demo:
- Clone the GitHub repo.
- Run
npm install, then open Claude Code in the folder. - Approve the two MCP servers.
- Pick one of the 3 bugs and paste its prompt from the README.
You'll see the AI open Chrome and start investigating within seconds.
Once it works on the demo, try it on a slow page or a tricky bug in your own Angular project, on localhost and with test data.
12. FAQ
What is Chrome DevTools MCP?
An MCP server from the Chrome DevTools team. It lets AI coding assistants open and control a real Chrome browser, read console messages and network requests, record performance traces, and take screenshots.
Does the Angular CLI have an MCP server?
Yes. It's built into the Angular CLI and starts with npx @angular/cli mcp. It lets an AI assistant start the dev server, build the project, run tests, and search the Angular docs.
Which AI tools can use these MCP servers?
Any AI coding tool that supports MCP. We tested with Claude Code. Other tools such as Cursor, GitHub Copilot in VS Code, and Gemini CLI also support MCP servers.
Can AI find performance problems in an Angular app?
Yes. With Chrome DevTools MCP, the AI records a performance trace and reads the numbers. In our demo, it measured a 2,264 ms INP and showed exactly where the time went.
Is it safe to give an AI access to a browser?
It can be, with a few habits: use the --isolated option, point it only at local or test environments, use fake data, and review every change. See the Safety section for details.
Do I need to change my Angular project to use this?
No. You only add a .mcp.json file to the project root. Your Angular code stays the same.
Resources
Adding AI to your system, or building a new AI feature?
Most of the work sits in the data plumbing rather than the model. Send us the workflow you want to automate and we will tell you what is feasible on your current stack.



