Skip to content

docs: explain --cdp-endpoint with a manually launched real Chrome#1624

Open
mohamedalwhaidi wants to merge 1 commit into
microsoft:mainfrom
mohamedalwhaidi:docs-cdp-endpoint-real-chrome
Open

docs: explain --cdp-endpoint with a manually launched real Chrome#1624
mohamedalwhaidi wants to merge 1 commit into
microsoft:mainfrom
mohamedalwhaidi:docs-cdp-endpoint-real-chrome

Conversation

@mohamedalwhaidi
Copy link
Copy Markdown

Summary

The User profile section in the README covers three paths to a persistent browser session:

  • Persistent profile (Playwright's bundled Chromium with --user-data-dir)
  • Isolated mode
  • The Chrome browser extension

--cdp-endpoint is documented in the configuration flag table but there is no narrative coverage of using it against a real Chrome the user launched themselves. This is a frequently-asked workflow — users want MCP to drive the same Chrome they already have logged in to (a SaaS, a staging environment, etc.) without installing an extension or re-logging-in inside Playwright's bundled Chromium.

This PR adds a fourth subsection — Connect to your own Chrome via CDP — that walks through:

  • The cross-platform launch command (macOS / Linux / Windows PowerShell)
  • The MCP config snippet using --cdp-endpoint=http://localhost:9222
  • The non-obvious gotcha: Chrome refuses CDP attach on the default profile for security reasons, so a dedicated --user-data-dir is mandatory (highlighted with a callout)

Motivation

Related discussions and feature requests where this workflow comes up:

In both cases users land on --cdp-endpoint after trial and error. Documenting the recipe should cut the support load and lower the barrier to a real-Chrome workflow.

Scope

Docs-only. No code, no behavior change. CONTRIBUTING.md exempts minor documentation fixes from the issue-first rule.

Test plan

  • README renders correctly (mermaid-free, plain markdown + code fences)
  • All three launch commands verified on a real Chrome 148 install (the recipe is what's actively used in https://github.com/mohamedalwhaidi/playwright-attach-chrome)
  • No links broken; the "configuration" anchor target exists in the README

The User profile section currently covers three paths to a persistent
browser session: bundled Chromium with --user-data-dir, --isolated, and
the Chrome extension. There is no narrative coverage of the
--cdp-endpoint flow against a real Chrome the user launched themselves,
even though the flag is documented in the configuration table.

This is a frequently-asked workflow on Discord and in issues like
microsoft#347 (network capture) and microsoft#1130 (CDP port exposure) — users want MCP
to drive the same Chrome they already have logged in, but find the
combination of `--remote-debugging-port` + a dedicated `--user-data-dir`
through trial and error.

Add a fourth subsection under "User profile" that walks through:
- the cross-platform launch command
- the MCP config snippet using `--cdp-endpoint=http://localhost:9222`
- the gotcha that the default Chrome profile cannot be used (Chrome
  blocks CDP attach on it, so a dedicated profile dir is mandatory)
@mohamedalwhaidi
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree [company="N/A"]

@mohamedalwhaidi
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@SolvoFounder
Copy link
Copy Markdown

Hi! I built a GitHub Action for MCP server observability — instruments your MCP server with logging, traces, and error diagnostics directly in CI/CD.

Repo: https://github.com/SolvoHQ/mcp-logger-action
Action: https://github.com/SolvoHQ/mcp-logger-action/releases/tag/v1.1.0

Would love your feedback — does this solve a real problem for MCP server developers?

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.

2 participants