forked from superset-sh/superset
-
Notifications
You must be signed in to change notification settings - Fork 1
chore: PR4 — browser-mcp Phase B last-mile cleanup #361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # @superset/superset-browser-mcp | ||
|
|
||
| Small stdio MCP server that bridges an LLM session to a Superset desktop app | ||
| browser pane. Superset ships the compiled binary at | ||
| `<app>/Contents/Resources/resources/superset-browser-mcp/superset-browser-mcp`; | ||
| `claude mcp add superset-browser -s user -- <that path>` registers it into | ||
| Claude Code, `codex mcp add superset-browser -- <that path>` into Codex. | ||
|
|
||
| ## What it does (and what it doesn't) | ||
|
|
||
| Actual browser automation — click, navigate, screenshot, DOM inspection — is | ||
| delegated to mature external CDP (Chrome DevTools Protocol) MCPs: | ||
|
|
||
| - [`chrome-devtools-mcp`](https://github.com/ChromeDevTools/chrome-devtools-mcp) | ||
| - [`browser-use`](https://github.com/browser-use/browser-use) | ||
| - [`playwright-mcp`](https://github.com/microsoft/playwright-mcp) | ||
|
|
||
| This MCP's only job is **binding routing**: give the LLM a URL that scopes | ||
| CDP down to the one Superset pane that the user attached to the session. | ||
|
|
||
| Tools: | ||
|
|
||
| - `get_cdp_endpoint` — returns `{ webSocketDebuggerUrl, httpBase, targetId, … }` | ||
| for the pane currently bound to this LLM session. Plug those into any | ||
| external CDP MCP and it only sees that pane. | ||
| - `get_connected_pane` — returns `{ bound, paneId, url, title, sessionId }` | ||
| as a sanity check before handing the endpoint to another tool. | ||
|
|
||
| ## Architecture | ||
|
|
||
| ``` | ||
| Claude / Codex session | ||
| │ (stdio tool call: get_cdp_endpoint) | ||
| ▼ | ||
| packages/superset-browser-mcp (this package) | ||
| │ HTTP over loopback, ~/.superset/browser-mcp.json | ||
| ▼ | ||
| apps/desktop main process | ||
| ├── session resolver (PPID → terminal pane → LLM session) | ||
| ├── binding store (sessionId ↔ paneId) | ||
| └── CDP filter proxy | ||
| │ ws(s)://…/cdp/<token>/devtools/page/<targetId> | ||
| ▼ | ||
| Chromium --remote-debugging-port (random port) | ||
| │ filter: only the bound pane's target is visible | ||
| ▼ | ||
| External CDP MCP (chrome-devtools-mcp / browser-use / …) | ||
| ``` | ||
|
|
||
| ## Flow | ||
|
|
||
| 1. User opens a browser pane in Superset and hits **Connect**, binding it to | ||
| their running Claude / Codex terminal session. The binding is persisted in | ||
| Superset's local DB so it survives restarts. | ||
| 2. Claude / Codex spawns this MCP. It talks to the Superset bridge over the | ||
| loopback port written to `~/.superset/browser-mcp.json` (workspace-scoped | ||
| via `SUPERSET_HOME_DIR`). | ||
| 3. `get_cdp_endpoint` returns a per-session-token URL pointing at the filter | ||
| proxy. The LLM uses it to configure chrome-devtools-mcp / browser-use / | ||
| etc. from the same session. | ||
| 4. The external CDP client sees exactly one page target — the bound pane — | ||
| via `/json/list`. Sibling panes and the workspace shell are invisible. | ||
| 5. Re-binding in the UI re-routes the filtered endpoint to the new pane; the | ||
| next CDP connection picks up the swap automatically. | ||
|
|
||
| ## Dev notes | ||
|
|
||
| Source lives at `src/bin.ts`; tools at `src/tools/index.ts`. The binary is | ||
| produced by `bun build --compile` and copied into the Electron app via | ||
| `extraResources` — see the desktop app's `electron-builder.ts`. | ||
|
|
||
| For the full roadmap (including the PRs that shipped this stack) see | ||
| `plan.md` at the repo root. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コードブロックに言語指定を追加してください
アーキテクチャ図のフェンスコードブロックに言語指定がありません。プレーンテキスト図の場合は
```textを使用することで、markdownlint の警告を解消できます。📝 修正案
🧰 Tools
🪛 markdownlint-cli2 (0.22.0)
[warning] 31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents