Skip to content

chore: PR4 — browser-mcp Phase B last-mile cleanup#361

Merged
MocA-Love merged 1 commit intomainfrom
chore/browser-mcp-pr4-cleanup
Apr 20, 2026
Merged

chore: PR4 — browser-mcp Phase B last-mile cleanup#361
MocA-Love merged 1 commit intomainfrom
chore/browser-mcp-pr4-cleanup

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

@MocA-Love MocA-Love commented Apr 20, 2026

Summary

plan.md の PR4 (Phase B 完了 PR)。コードと文書を Phase B 後の最終形に揃える。

追加

  • `packages/superset-browser-mcp/README.md`
    • アーキテクチャ図と "バインディングルーター" 設計の説明
    • chrome-devtools-mcp / browser-use / playwright-mcp への委譲方針
    • binding 解決フローの紹介
    • dev 環境向けノート

クリーンアップ

  • `src/tools/index.ts` の "endpoint itself ships in follow-up PRs" コメントを削除し、現行 (get_cdp_endpoint + get_connected_pane の 2 ツール体制) の責務を明文化
  • `browser-mcp-bridge/server.ts`: 過去の body-taking エンドポイント (PR2/3 で削除済) のためだけに残っていた dead code (`MAX_JSON_BODY_BYTES` / `PayloadTooLargeError` / `_readJson` / 413 catch 分岐) を削除
  • `plan.md`: Status 追記、PR1〜3 を shipped マーク、PR4 として本 PR をラベル

Phase B 完了

これでプラン上の PR1〜PR4 すべて完了。今後 browser 自動化は外部 CDP MCP に依存し、本パッケージは binding ルーターとして最小に保つ。

Test plan

  • dev で起動 → MCP の `get_cdp_endpoint` / `get_connected_pane` が引き続き動作
  • /mcp/binding / /mcp/cdp-endpoint / /mcp/register / /cdp//* の HTTP ルートが従来通り
  • README が GitHub 上で正しく表示される (`packages/superset-browser-mcp/README.md`)

Summary by CodeRabbit

リリースノート

  • ドキュメンテーション

    • ブラウザMCPパッケージの包括的なREADMEを追加し、ルーティング/バインディングレイヤーとしての役割を説明しました。
    • ツール機能のドキュメントを更新し、外部CDPクライアントへの委譲アーキテクチャを反映しました。
    • ロードマップを更新し、フェーズB完了ステータスを記載しました。
  • リファクター

    • リクエスト処理ロジックを簡素化しました。

plan.md の PR4 (Phase B 完了 PR):

- packages/superset-browser-mcp に README.md を追加。アーキテクチャ図、
  外部 CDP MCP との関係 (chrome-devtools-mcp / browser-use /
  playwright-mcp に委譲する方針)、binding 解決フロー、dev 注意点を
  まとめる。
- src/tools/index.ts の "endpoint itself ships in follow-up PRs"
  コメントを削除。get_cdp_endpoint と get_connected_pane の役割を
  明示的に書く。
- browser-mcp-bridge/server.ts から、PR2/3 で消した body-taking
  endpoint 用に残っていた dead code を整理:
  - `MAX_JSON_BODY_BYTES` / `PayloadTooLargeError` / `_readJson`
    を削除 (現状すべてのエンドポイントが GET / POST 空ボディ)
  - 413 ハンドリングも対応する catch 分岐を削除
- plan.md に Phase B Status を追記、PR1〜3 を shipped マーク、PR4 を
  本 PR としてラベル付け。
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

📝 Walkthrough

Walkthrough

JSON リクエストボディサイズ制限ロジックとペイロードエラー処理を削除し、ブラウザ MCP ブリッジサーバーを簡素化。同時にパッケージドキュメント、ツール説明、ロードマップを更新して Phase B の完了を反映。

Changes

コホート / ファイル 概要
ブラウザ MCP ブリッジサーバーの簡素化
apps/desktop/src/main/lib/browser-mcp-bridge/server.ts
JSON ボディサイズ制限(MAX_JSON_BODY_BYTES)、PayloadTooLargeError クラス、_readJson ヘルパー関数、および 413 エラーハンドリング分岐を削除。リクエストボディ解析の代替実装はこの差分に含まれない。
ドキュメント・パッケージ説明の追加と更新
packages/superset-browser-mcp/README.md, packages/superset-browser-mcp/src/tools/index.ts, plan.md
新しい README を追加し、MCP サーバーの架橋層としての役割、get_cdp_endpointget_connected_pane ツール、アーキテクチャ図を文書化。ツール説明を更新して、自動化機能は外部 CDP 対応 MCP に委譲される責任モデルに反映。Phase B ロードマップにステータス注記を追加。

推定コード レビュー工数

🎯 2 (Simple) | ⏱️ ~12分

関連する可能性のある PR

Poem

🐰✨ サイズチェック消えて軽やかに
ドキュメント輝く新しい道
Phase B 完成、前へ進もう
責任は外へ優雅に委譲
兎の足音、速くなったよ 🐇🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning 説明テンプレートの必須セクションが不足している。Description、Related Issues、Type of Change などが記入されていない。 テンプレートに従い、説明、関連 Issue、変更タイプ、テスト内容を構造化して記入してください。
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed タイトルは PR4 による Phase B の最終クリーンアップという、このプルリクエストの主要な目的を明確に示している。
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/browser-mcp-pr4-cleanup

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
Copy Markdown

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/superset-browser-mcp/README.md`:
- Around line 31-48: The fenced code block in the README architecture diagram
lacks a language tag which triggers markdownlint warnings; update the opening
fence from ``` to ```text (and keep the closing ```), e.g. change the block
starting with "Claude / Codex session" to begin with "```text" so the diagram is
explicitly marked as plain text and the lint warning is resolved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e5f5f35e-9662-4cf0-9b29-eb6cbdb59a50

📥 Commits

Reviewing files that changed from the base of the PR and between 5ec7b52 and fb79310.

📒 Files selected for processing (4)
  • apps/desktop/src/main/lib/browser-mcp-bridge/server.ts
  • packages/superset-browser-mcp/README.md
  • packages/superset-browser-mcp/src/tools/index.ts
  • plan.md
💤 Files with no reviewable changes (1)
  • apps/desktop/src/main/lib/browser-mcp-bridge/server.ts

Comment on lines +31 to +48
```
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 / …)
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

コードブロックに言語指定を追加してください

アーキテクチャ図のフェンスコードブロックに言語指定がありません。プレーンテキスト図の場合は ```text を使用することで、markdownlint の警告を解消できます。

📝 修正案
-```
+```text
 Claude / Codex session
         │  (stdio tool call: get_cdp_endpoint)
         ▼
🧰 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
Verify each finding against the current code and only fix it if needed.

In `@packages/superset-browser-mcp/README.md` around lines 31 - 48, The fenced
code block in the README architecture diagram lacks a language tag which
triggers markdownlint warnings; update the opening fence from ``` to ```text
(and keep the closing ```), e.g. change the block starting with "Claude / Codex
session" to begin with "```text" so the diagram is explicitly marked as plain
text and the lint warning is resolved.

@MocA-Love MocA-Love merged commit 2c353f2 into main Apr 20, 2026
14 checks passed
@MocA-Love MocA-Love deleted the chore/browser-mcp-pr4-cleanup branch April 20, 2026 19:43
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.

1 participant