Stop Copy-Pasting Error Screenshots: Let AI Open Chrome and Find the Bug Itself
The most tedious part of having AI write frontend code is often not the writing, but the debugging.
You open the page, click a button and nothing happens. You press F12, screenshot the console, then dig through the Network tab for that red request, copy the response, and paste everything back into the chat. AI reads it and says "maybe the API response format is wrong." You refresh, screenshot, paste again. Back and forth, you become its "human messenger."
The problem is that AI can't see the browser. So let it see for itself.
This is the first post in the MCP live-test series, where each post picks one MCP and runs it against a real project.
The checkout page used for testing (fictional "栖木商城"): desktop on the left, mobile on the right. The coupon stays on "Loading…", and clicking "Submit Order" does nothing.
What is MCP
MCP (Model Context Protocol) is a unified interface that lets AI call external tools. When you connect an MCP server to an AI, it gains a set of tools it can call on its own, such as opening a browser, checking documentation, or reading a database. You no longer need to copy and paste results to it; it goes and fetches them itself.
Chrome DevTools MCP: Hand F12 to the Agent
This time we use Chrome DevTools MCP, an MCP server made by Google's Chrome DevTools team. It launches or connects to a Chrome instance and exposes the most frequently used DevTools features as tools for the Agent: reading console, inspecting network requests, recording performance traces, taking screenshots, emulating mobile and slow networks, and even running Lighthouse directly.
It requires no API key; a single npx -y chrome-devtools-mcp@latest starts it. I tested version 1.14.0, which exposes 33 tools by default.
Playwright MCP also opens browsers, but the two have different roles: Playwright is more like a hand, good at clicking, filling forms, and running flows; DevTools MCP is more like an eye, good at telling you where a page is broken and why it's slow. When hunting bugs, I want the latter.
To make the process clear, I built a checkout page in the style of a typical e-commerce site: top navigation with search and cart, then breadcrumbs, a promotional hero image, shipping info, three products, a coupon, an order summary, and a footer. The store is fictional, called "栖木商城," and the page states it's a demo. I planted several traps, some mentioned in the prompts and some deliberately left unmentioned, to see if it could dig them out on its own.
All three live tests run in DSH, with the model being DeepSeek-V4.1-Flash. The prompts are everyday language, without specifying which tool to use, and each test starts a fresh conversation.
Test 1: The coupon keeps spinning — what went wrong
I told DSH:
Take a look at http://localhost:8765 — the coupon keeps failing to load. Find the cause and give a fix suggestion.
It took 2 minutes 4 seconds and 36 steps. First it read the source code, used curl to test the interface, got a 500 and a 0.30-second response time; then it opened the browser and matched evidence from the network panel and console: the same 500 plus a TypeError: Cannot read properties of undefined (reading '0'), while the coupon on the page stayed on "Loading…". For the specific tools it called, see the trace diagram below.
DSH trace page: Agent's Chrome DevTools tool calls (filtered to only show mcp__chrome-devtools calls)
It broke the cause into four links: the server-side fetch_coupons() sleeps 0.3 seconds and then always throws a timeout, which is mapped to a 500; the response body is still valid JSON, but the frontend doesn't check r.ok and reads d.list[0].amount, throwing the TypeError; .catch only writes to the console and doesn't change the UI, so the user only sees an eternal "Loading…". One comment in the conclusion hit the point: the request did fail, but the failure path has no user-visible feedback, so the fault manifests as "always loading."
DSH conversation page: conclusion, on-site evidence, and cause chain
It also actively ruled out two distracting factors: the 1.8-second delay on the hero image does not block the coupon request, and the favicon.ico 404 is unrelated to this issue. It also pointed out three other problems on the same page: clicking "Submit Order" always errors (reads undefined window.__CART__); even if you get a coupon, the "Discount" and "Total" on the right won't update; and the coupon list crashes a second time when empty.
DSH conversation page: fix suggestions (code for both frontend and backend)
The fix suggestions split into frontend and backend: the server gets a success branch, returns 503 on timeout and keeps the list field stable; the frontend checks res.ok first, adds a fallback for empty lists, and shows "Load failed, click to retry" on error. It ran the patch in a temporary copy: normally coupon discount -¥30.00 and total ¥369.00; with the timeout switch on, a retry prompt appeared. Finally it asked whether I wanted it to apply the changes to the workspace, without touching anything on its own.
There was a small episode worth mentioning: to verify, it first changed the port on a copy, but because cd didn't take effect, sed landed on the workspace's server.py. It noticed this itself and changed it back immediately, then verified the port, app.js, and API behavior, and honestly told me about the mistake at the end. I later diffed the file contents and confirmed they matched the original.
Test 2: Why is the page slow
I asked a different question:
This page http://localhost:8765 opens a bit slowly. Find out where the slowness is and how to optimize.
This took 3 minutes 54 seconds and 39 steps. It first checked response headers, then opened the page and injected a script to collect LCP and CLS. The first attempt got no data; it admitted the script hadn't run, then switched to reading the browser's performance entries directly. After that it switched to Fast 4G, refreshed, and measured cold cache and repeat visits. This time it didn't record a Trace; the performance data was all gathered via scripts it wrote itself.
DSH trace page: Agent's Chrome DevTools tool calls (filtered)
The conclusion was blunt: the image is the bottleneck, not the page itself. The page skeleton painted in 108 milliseconds; the full page loaded in 1.82 seconds, of which 1.8 seconds went to the hero image above the fold. The image is 4000×2600, about 358 KB, and displayed at about 587×260; the response header is no-store, so every visit re-downloads it. In the waterfall, the hero request alone took 1,807 ms; the remaining CSS, scripts, and thumbnails all returned within 7 ms.
DSH conversation page: measured data and what it changed
This time it didn't ask; it went ahead and changed things. Because I gave it "modify within workspace" permission, it recompressed the hero image (358 KB to 40 KB, dimensions 1344×594), shrunk three product images from 640×640 to 144×144, added width/height and fetchpriority to the hero, inlined the favicon; rewrote the coupon request (timeout, status code check, null guard, failure hint), fixed the submit-order error; server.py switched to HTTP/1.1 keep-alive and added tiered cache headers. It also backed up every original file into .backup/ and started a patched copy on another port for comparison: under Fast 4G, cold-cache LCP dropped from 2.40 s to 2.04 s, repeat visit from 2.34 s to 0.18 s, and total download from 448 KB to 60 KB.
One judgment of mine it echoed: it didn't remove the 1.8-second hero delay, reasoning that this simulated CDN latency — frontend optimization can only save bandwidth, not these 1.8 seconds; solving that requires work on the CDN side. It also reminded me that the service on port 8765 was invisible to it, so cache headers would only take effect after I restarted the process.
DSH conversation page: further optimization suggestions and the list of changed files
Test 3: What does it look like on mobile
Last one, I said:
Open http://localhost:8765 at phone dimensions and a slow network (like Slow 4G), check the effect, then run Lighthouse and tell me what needs changing.
It took 1 minute 45 seconds and 18 steps. The trace shows its order: first switch to phone dimensions (390×844, DPR 3, touch screen) and Slow 4G, reload ignoring cache; take a full-page screenshot and check for horizontal overflow; run Lighthouse; record a Trace and go item by item over images, render-blocking, LCP discovery, and caching; finally click "Submit Order" itself.
DSH trace page: ordering of device emulation, Lighthouse, and performance trace calls (filtered)
It judged the mobile layout fine: single column, no horizontal scroll, sticky navigation, legible font sizes. The slow-network numbers: FCP 1.31 s, LCP 4.54 s, CLS 0, total transfer 455 KB, of which the hero image is 366 KB, 80%. LCP breaks down as TTFB 2 ms, queuing 584 ms, download 3,840 ms, render 118 ms. This run used Slow 4G, no CPU throttling, and I didn't ask for it.
Lighthouse gave Accessibility 97, Best Practices 96, SEO 91, and Agentic Browsing 100, matching what I ran myself. It also noted that this MCP's Lighthouse doesn't output a performance score, so it filled in performance with Trace. Only three failures: the console has a 500 and JS error; the coupon line's gray text (#999) has a contrast ratio of 2.71 versus the required 4.5; and the page lacks a meta description.
DSH conversation page: mobile effect, slow-network measured data, and Lighthouse results
Then came a priority-ordered list of fixes: first fix the coupon and submit-order main paths, then address hero image size, render-blocking CSS, and caching; accessibility and mobile experience last. Several points I hadn't thought of: breadcrumb and footer links have touch targets smaller than 44 pixels; the mobile version hides the product quantity; the submit-order button requires scrolling two screens to see, with a suggestion to make it a fixed bottom bar. This time it only gave suggestions, asking at the end whether I wanted it to change things directly.
DSH conversation page: priority-ordered fix list
Pitfalls I hit
- Screenshots can't save to the workspace: In all three tests, the Agent tried to save a screenshot or Lighthouse report to the workspace but was denied, with
Access denied: path ... is not within any of the configured workspace roots. It then switched to saving to/tmpor omitted the path and succeeded. To save to a specific directory, add--filesystem-rootto the startup parameters; I verified that flag in the client but didn't try it again in DSH. - It can read source code, and it may change it directly: The page is inside the workspace, so the Agent first reads the README and server code; that's why the conclusion includes line numbers like
server.py:13–16. That's a good thing, but under "modify within workspace" permission, in Test 2 it compressed images and changed four or five files without waiting for my consent. It backed up the originals and explained everything, but if you only want a diagnosis, add "analyze only, don't change files" to the prompt, or put the project in Git first. - It can also slip: In Test 1 it wrote the validation port change into the workspace's
server.py; it caught itself and changed it back. Before letting it touch anything, make sure the workspace is clean and review the diff afterward. - Emulation settings persist: After setting Fast 4G or Slow 4G, every subsequent step carries "Emulating network conditions". To disable throttling, the
networkConditionsoptions don't includeOff; in Test 2 its first attempt passingOffwas rejected, and it later reset by omitting that parameter. After testing, be sure to have it clear the settings before checking behavior on a normal network.
A word on security
On startup it reminds you: anything in the browser is exposed to the MCP client; the performance tools by default send page URLs to Google's CrUX endpoint to query real-user data; and it also collects usage statistics by default. Network request details also show request headers like cookies.
My habits are these:
- Add
--isolatedto use a temporary browser profile each time, clearing it when closed. Without it, it uses a persistent separate profile directory. - When working on company or intranet projects, add
--no-performance-cruxand--no-usage-statistics. - Don't casually connect it to the Chrome where you're logged into all your accounts.
npx -y chrome-devtools-mcp@latest --isolated --no-performance-crux --no-usage-statistics
How to install
Manual config is easy: add a stdio server in DSH's MCP manager, set the command to npx, and fill the parameters according to the line above. Other MCP-compatible clients follow the same idea: put the command and parameters into their MCP config.
If you want convenience, DSH has a community plugin dsh-market-pro (called "Plugin Market Pro" after installation) where you can pick MCPs directly. I walked through it: open MCP → "Featured," pick category "Web & Browser," Chrome DevTools is at the top, with the card marked npx and no "needs key" tag.
Playwright and Chrome DevTools in the "Web & Browser" category
Clicking "Add" brings up a confirmation dialog showing the command to run, npx -y chrome-devtools-mcp@latest, then click "Add" again to install and connect.
Added successfully: 33 tools ready
After install it shows 33 tools connected; to add the security parameters above, click "Edit," paste them in, and before saving it lists the full command, requiring you to check "I confirm this command is trusted" to save. You can also type /market-pro in the chat and let the Agent pick a plugin based on your needs, waiting for your confirmation before installing.
Series navigation
Next time a page has a weird problem, don't rush to screenshot. Just tell DSH, "open it and look."
The next post tests Context7: let AI check the latest docs on its own. Want a specific MCP tested? Tell me in the comments.
Projects mentioned
Features in this post follow the public docs of each project as of late November 2026; Chrome DevTools MCP tested at version 1.14.0. Screenshots from the three tests come from actual DSH runs; the page is the author's own fictional demo (栖木商城). The agent's wording, steps, and numbers may differ each time; the numbers in the post are based on the screenshots. A few test notes: the page sits in DSH's workspace as a normal project with "modify within workspace" permission, so the agent can read source and has permission to change files; before each test, I restarted the Chrome DevTools MCP server and opened a fresh conversation, so the browser didn't carry over previous state; trace screenshots come from DSH's trace page, filtered to show only Chrome DevTools calls — the agent also runs curl and reads files on its own, and its internal monologue in the trace is in English, unedited; conversation screenshots are raw captures of the conclusion sections. The plugin market UI is a real screenshot from November 2026.