Skip to content

feat(readme): add chrome devtool MCP test protocol#2938

Merged
hoangdat merged 1 commit intomainfrom
feat/add-devtool-mcp-guide
Mar 23, 2026
Merged

feat(readme): add chrome devtool MCP test protocol#2938
hoangdat merged 1 commit intomainfrom
feat/add-devtool-mcp-guide

Conversation

@9clg6
Copy link
Collaborator

@9clg6 9clg6 commented Mar 18, 2026

Ticket

N/A — Documentation improvement

Root cause

N/A — Not a bug

Solution

Add a "Performance Profiling" section to the README under Development, covering:

Why Chrome DevTools must be used instead of Flutter DevTools for Flutter Web profiling (Dart compiles to JS, Flutter DevTools cannot profile the browser rendering pipeline)
Why manual analysis is impractical (traces exceed 350K lines of JSON, flame charts are unreadable at that scale)
How to set up the Chrome DevTools MCP server with an AI coding assistant
The prompt to give the AI to automate: app launch, CPU throttling, trace recording, navigation, analysis, and before/after comparison
A reference table of key metrics to monitor (sync XHR, animation frame avg, jank %, long tasks, JS heap)
Impact description

No code change. Adds documentation for the automated performance profiling workflow used to measure and validate UI performance optimizations on Flutter Web. This enables any team member to reproduce the profiling process and compare branches objectively.

Test recommendations

Verify the README renders correctly on GitHub (markdown tables, code blocks, blockquote)
Optionally follow the documented steps to confirm the MCP setup and profiling workflow work end-to-end

Pre-merge

No

Resolved

N/A — Documentation only, no visual changes

Web: N/A
Android: N/A
iOS: N/A

Summary by CodeRabbit

  • Documentation
    • README formatting refined for visual consistency (single-line header badges, reduced blank lines).
    • Minor punctuation and emphasis adjustments throughout.
    • New "Performance Profiling" section added with metrics and guidance.
    • Updated command and example blocks (spacing and presentation) including container examples.
    • Standardized note/reference styling and unified "Special thanks" formatting.

@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

Walkthrough

The README.md is updated for formatting and content. Header badges and contributor/issues badges are consolidated to single-line format and vertical spacing around the header image is reduced. A new "Performance Profiling" section is added with subsections on Chrome DevTools usage, profiling analysis approaches, and a metrics table. Emphasis styling is standardized to use underscores, several code and docker run examples are reformatted for consistency, and special thanks entries are aligned to a consistent italicized style. Lines changed: +81/-21.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title mentions 'chrome devtool MCP test protocol' which is directly related to the main addition of a Performance Profiling section documenting Chrome DevTools MCP server setup, making it relevant to the changeset.
Description check ✅ Passed The description comprehensively covers all required template sections (Ticket, Root cause, Solution, Impact, Test recommendations, Pre-merge, Resolved) with detailed content about the Performance Profiling documentation additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-devtool-mcp-guide
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
README.md (1)

251-251: Consider more formal phrasing.

Static analysis suggests that "Every now and then" could be replaced with more formal wording for technical documentation, such as "Periodically" or "Occasionally".

📝 Suggested rewording
-Every now and then, manually scroll through the app using your mouse to make sure that the programmatic scrolling isn't skewing the data.
+Periodically, manually scroll through the app using your mouse to ensure that programmatic scrolling isn't skewing the data.

As per coding guidelines: LanguageTool style hint (EVERY_NOW_AND_THEN).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 251, Replace the informal phrase "Every now and then" in
the README sentence "Every now and then, manually scroll through the app using
your mouse to make sure that the programmatic scrolling isn't skewing the data."
with a more formal alternative such as "Periodically" or "Occasionally" so the
sentence reads e.g. "Periodically, manually scroll through the app using your
mouse to make sure that the programmatic scrolling isn't skewing the data."
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Line 320: The README contains the contributor line that uses the Portuguese
spelling "Brasil"; update the text that mentions "<a
href=\"https://github.com/fabiyamada\">Fabiyamada</a> is a graphics designer
from Brasil..." to use the English spelling "Brazil" instead of "Brasil" so it
reads "...is a graphics designer from Brazil and has made the fluffychat logo
and the banner." Ensure only the country name is changed and spacing/punctuation
remain unchanged.
- Around line 215-273: The README references a non-existent GitHub URL
"https://github.com/nichochar/chrome-devtools-mcp" under the "Chrome DevTools
MCP" section; verify the correct repository URL (or confirm there is no public
repo) and update the README to use the valid URL or remove the broken link, and
clarify that installation via the npm package name "chrome-devtools-mcp@latest"
works independently if no repo exists; update the displayed link text and any
mentions of "Chrome DevTools MCP" in this section accordingly so users are not
led to a 404.

---

Nitpick comments:
In `@README.md`:
- Line 251: Replace the informal phrase "Every now and then" in the README
sentence "Every now and then, manually scroll through the app using your mouse
to make sure that the programmatic scrolling isn't skewing the data." with a
more formal alternative such as "Periodically" or "Occasionally" so the sentence
reads e.g. "Periodically, manually scroll through the app using your mouse to
make sure that the programmatic scrolling isn't skewing the data."

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 211b2520-a913-4d0a-91dd-3bfecf056058

📥 Commits

Reviewing files that changed from the base of the PR and between 304e72b and 46f69f6.

📒 Files selected for processing (1)
  • README.md

@github-actions
Copy link
Contributor

This PR has been deployed to https://linagora.github.io/twake-on-matrix/2938

Copy link
Member

@chibenwa chibenwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's awesome!

@hoangdat @dab246 @tddang-linagora please take the time to do the setup and have a try on it on Twake Mail as well, I am interested by the results.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
README.md (3)

308-308: Rephrase unclear sentence in sample run instructions.

Line 308 (“with my port is 6868”) is grammatically unclear. Suggest “using port 6868”.

✏️ Suggested wording
-- Run the image using the following command with my port is `6868`:
+- Run the image using the following command with port `6868`:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 308, Replace the unclear phrase "Run the image using the
following command with my port is `6868`" in the README (the sample run
instructions) with a clearer wording such as "Run the image using the following
command using port `6868`" (or "Run the image using the following command with
port `6868`") to fix the grammatical issue and clarify the intent.

219-219: Avoid implying desktop support in this repository docs.

Line 219 says “native (iOS/Android/Desktop) profiling,” which can be read as this project supporting desktop targets. Consider removing “Desktop” here to stay consistent with repository platform scope.

Based on learnings: The Twake on Matrix Flutter app (fluffychat) only supports web and mobile platforms. Desktop platforms (macOS, Linux, Windows) are not supported.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 219, Update the README sentence that currently reads
“native (iOS/Android/Desktop) profiling” to remove “Desktop” so it reads “native
(iOS/Android) profiling” (edit the string in the README where that sentence
appears) to avoid implying desktop platform support.

136-136: Fix broken Markdown link rendering in note.

Line 136 wraps the Markdown link in backticks, so it renders as code instead of a clickable link.

✏️ Suggested fix
-_This can be automated thanks to: `[nix-direnv](https://github.com/nix-community/nix-direnv/)`_
+_This can be automated thanks to [nix-direnv](https://github.com/nix-community/nix-direnv/)._
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 136, The Markdown note currently wraps the link
`[nix-direnv](https://github.com/nix-community/nix-direnv/)` in backticks so it
renders as inline code; remove the backticks around the link in the README note
so the link is plain Markdown (i.e.,
[nix-direnv](https://github.com/nix-community/nix-direnv/)) and becomes
clickable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@README.md`:
- Line 308: Replace the unclear phrase "Run the image using the following
command with my port is `6868`" in the README (the sample run instructions) with
a clearer wording such as "Run the image using the following command using port
`6868`" (or "Run the image using the following command with port `6868`") to fix
the grammatical issue and clarify the intent.
- Line 219: Update the README sentence that currently reads “native
(iOS/Android/Desktop) profiling” to remove “Desktop” so it reads “native
(iOS/Android) profiling” (edit the string in the README where that sentence
appears) to avoid implying desktop platform support.
- Line 136: The Markdown note currently wraps the link
`[nix-direnv](https://github.com/nix-community/nix-direnv/)` in backticks so it
renders as inline code; remove the backticks around the link in the README note
so the link is plain Markdown (i.e.,
[nix-direnv](https://github.com/nix-community/nix-direnv/)) and becomes
clickable.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4cb4bba9-aa87-4a04-8dd6-700d77269177

📥 Commits

Reviewing files that changed from the base of the PR and between 46f69f6 and e8773dd.

📒 Files selected for processing (1)
  • README.md

@9clg6
Copy link
Collaborator Author

9clg6 commented Mar 18, 2026

That's awesome!

@hoangdat @dab246 @tddang-linagora please take the time to do the setup and have a try on it on Twake Mail as well, I am interested by the results.

Thanks 🙏

I suggested this change because I used this method on Twake Chat to measure and identify the source of performance issues. The changes I implemented resulted in significant performance gains.
The metrics are available in my PRs:

@dab246
Copy link
Member

dab246 commented Mar 19, 2026

What about other browsers? Do we need to implement MCP like Chrome does?

@9clg6
Copy link
Collaborator Author

9clg6 commented Mar 19, 2026

What about other browsers? Do we need to implement MCP like Chrome does?

No need -- most browsers (Edge, Brave, Opera, Arc...) are Chromium-based, so they all expose the same DevTools Protocol. The Chrome DevTools MCP server works with any of them out of the box, not just Chrome.

@hoangdat
Copy link
Member

I also run for the app in v2.20.6 in profile mode.
I also combine the step into script to ensure all team can test also.

Twake Chat — Web Performance Report

Date: 20/03/2026, 17:21:06 | URL: http://localhost:2026 | Type: authenticated-cold-start


Summary

Area Value Status
FCP 1,484ms 🟢
TTFB 1ms 🟢
DOM Complete 1,458ms 🟢
First Matrix /sync 212ms 🟢
Long tasks 0 🟢
Desktop animation FPS 59.99 🟢
Desktop scroll FPS 58.62 🟢
Desktop idle jank % 0% 🟢
Interactive FPS 44.34 🔴
Interactive long tasks 104 (max 686ms) 🔴
Desktop 4× CPU FPS 60.02 🟢
Desktop 4× CPU jank % 0% 🟢
Memory leak OK 🟢
Cache hit rate 12% 🔴
Failed requests 12 🔴
Service Worker active No 🟡

1. Cold Start

Metric Value Benchmark Status
TTFB 1ms < 200ms 🟢
DOM Interactive 1,436ms < 3500ms 🟢
DOM Complete 1,458ms < 3500ms 🟢
Load Event 1,464ms < 3500ms 🟢
First Paint 1,484ms < 1800ms 🟢
FCP 1,484ms < 1800ms 🟢
Long tasks 0 0 preferred 🟢
Long task total 0ms 0ms 🟢
First Matrix /sync 212ms < 1000ms 🟢
Transfer on load 15 KB
Landed on #/rooms

2. Animations & Jank

Desktop (native CPU)

Metric Idle Scroll
FPS 59.99 🟢 58.62 🟢
Avg frame 16.67ms 17.06ms
Jank % 0% 🟢 0.67% 🟢
p95 frame 17.7ms 17.6ms
p99 frame 17.8ms 17.8ms
Max frame 18.1ms 116.7ms

Desktop + 4× CPU Throttle

Metric Idle Scroll
FPS 60.02 🟢 60 🟢
Avg frame 16.66ms 16.67ms
Jank % 0% 🟢 0% 🟢
p95 frame 17.5ms 17.5ms
p99 frame 17.6ms 17.6ms
Max frame 17.7ms 17.6ms

Heap under throttle: 185.4 MB / 189.9 MB


3. Interactive Session

Frame Performance During Interaction

Metric Value Status
FPS 44.34 🔴
Avg frame 22.55ms
Jank % 4.76% 🟡
p95 frame 33.2ms
p99 frame 333.3ms
Max frame 700ms 🔴
Frames sampled 4,177

Main Thread — Long Tasks

Metric Value Status
Long task count 104 🔴
Total blocked time 22,759ms 🔴
Max long task 686ms 🔴

Long task samples:

Start Duration
38,726ms 73ms
38,800ms 66ms
38,866ms 57ms
39,360ms 60ms
40,239ms 51ms
40,842ms 85ms
40,927ms 54ms
41,889ms 88ms
43,925ms 380ms
44,305ms 60ms

Network During Interaction

Metric Value
New requests triggered 628
Matrix requests 611
Failed requests 12 🔴

Slowest new requests:

URL Duration
https://matrix.stg.lin-saas.com/_matrix/client/v3/sync?filter=0&since=s78847_226… 30,664ms
https://matrix.stg.lin-saas.com/_matrix/client/v3/sync?filter=0&since=s78847_226… 23,742ms
https://matrix.stg.lin-saas.com/_matrix/client/v3/sync?filter=0&since=s78847_226… 16,566ms
https://matrix.stg.lin-saas.com/_matrix/media/v3/preview_url?url=https%3A%2F%2Ft… 6,154ms
https://matrix.stg.lin-saas.com/_matrix/client/v1/media/download/stg.lin-saas.co… 3,282ms

Memory During Interaction

Checkpoint Used Total
Before interaction 106.92 MB 109.14 MB
After interaction 482.41 MB 551.69 MB

Heap growth during session: 375.49 MB 🔴 High

Navigation Trace

  • http://localhost:2026/#/rooms
  • http://localhost:2026/#/rooms/!iMBJTLDYXqDxmWZcbY:linagora.com
  • http://localhost:2026/#/rooms/!tdijZyQoSQLiSvBcFY:linagora.com
  • http://localhost:2026/#/rooms/!zqTwZakbsmuihDlMVH:stg.lin-saas.com

4. Memory

Checkpoint Used Total DOM Nodes
Rooms loaded + 5s 184.71 MB 205.93 MB 75
After GC 186.17 MB 195.75 MB 75
After scroll + 8s sync 191.49 MB 221.48 MB 75
After GC (post-sync) 184.51 MB 188.29 MB 75
  • Memory growth: -0.2 MB — 🟢 No leak

5. Network

Metric Value
Total requests 722
Failed requests 12 🔴
Cache hit rate 12% (90 cached)
Total transfer 110.9 MB
Matrix requests 629 of 722
First /sync 212ms (1 KB)
WebSocket connections 0

Slowest requests:

URL Duration
https://matrix.stg.lin-saas.com/_matrix/client/v3/sync?filter=0&since=s78847_226… 30,664ms
https://matrix.stg.lin-saas.com/_matrix/client/v3/sync?filter=0&since=s78847_226… 30,556ms
https://matrix.stg.lin-saas.com/_matrix/client/v3/sync?filter=0&since=s78847_226… 30,464ms
https://matrix.stg.lin-saas.com/_matrix/client/v3/sync?filter=0&since=s78847_226… 23,742ms
https://matrix.stg.lin-saas.com/_matrix/client/v3/sync?filter=0&since=s78847_226… 16,566ms

6. Rendering

Metric Value
Long tasks 0 🟢
FCP 1,484ms
TTFB 1ms
Resources loaded 250
Transfer size 38.2 MB
DOM nodes 75
Max DOM depth 4
Renderer HTML

7. PWA & Accessibility

Check Result Status
Service Worker registered Yes 🟢
Service Worker active No 🟡
Web Manifest Yes 🟢
Meta viewport Yes 🟢
Meta description Yes 🟢
Render-blocking scripts 4 🔴
Buttons without label 0 / 2 🟢
Inputs without label 3 🔴
Images without alt 0 🟢

8. App Snapshot

  • URL: #/rooms
  • Renderer: HTML
  • DOM nodes: 61 (max depth: 4)
  • Heap: 106.9 MB used / 109.14 MB total

Generated on 20/03/2026, 17:21:06

@dab246
Copy link
Member

dab246 commented Mar 20, 2026

What about other browsers? Do we need to implement MCP like Chrome does?

No need -- most browsers (Edge, Brave, Opera, Arc...) are Chromium-based, so they all expose the same DevTools Protocol. The Chrome DevTools MCP server works with any of them out of the box, not just Chrome.

What's about Safari?

@hoangdat hoangdat merged commit 617c645 into main Mar 23, 2026
9 checks passed
@hoangdat hoangdat deleted the feat/add-devtool-mcp-guide branch March 23, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants