fix: register all MCP tools via registerSurface so /mcp/connector stays compliant - #186
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThe server now delegates tool and resource registration to ChangesMCP surface registration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant index as src/index.ts
participant surface as registerSurface
participant server as MCP server
index->>surface: server, config, analytics
surface->>server: register compliance-selected tools
surface->>server: register browserless_profiles in full mode
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/tools/compliance-mode.spec.ts`:
- Around line 115-141: Update the forbidden registrar list in the test named
“index.ts registers the surface only via registerSurface (no direct tool calls)”
to include registerScrapeUrlPrompt( and registerExtractContentPrompt(. Keep the
existing registerSurface assertion and direct-registration checks unchanged.
🪄 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: 5397c990-3ab4-4b93-b731-87cffdd893b9
📒 Files selected for processing (3)
src/index.tssrc/tools/register.tstest/tools/compliance-mode.spec.ts
💤 Files with no reviewable changes (1)
- src/index.ts
🤖 I have created a release *beep* *boop* --- ## [1.14.0](v1.13.0...v1.14.0) (2026-07-17) ### Features * add source tracking for analytics ([#184](#184)) ([d4ebc83](d4ebc83)) ### Bug Fixes * register all MCP tools via registerSurface so /mcp/connector stays compliant ([#186](#186)) ([78417cc](78417cc)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: browserless-actions-bot[bot] <186328842+browserless-actions-bot[bot]@users.noreply.github.com>
Problem
/mcp/connector(the compliant, reduced surface for the OpenAI/Anthropic app directories) was serving the full tool surface — includingbrowserless_smartscraper,function,map,crawl, and the newbrowserless_profiles. Those are exactly the tools the compliant surface exists to hide, and this surfaced mid-resubmission after v1.0.0 was rejected for data-collection concerns.Root cause
At #166
src/index.tsregistered tools only throughregisterSurface, which is the compliance gate — each tool declaresbothorfull, andfulltools are skipped whenMCP_COMPLIANCE_MODE=true.#179 (get browserless profiles) re-introduced the old block of direct
register*()calls inindex.tsabove theregisterSurfacecall. Those direct calls register every tool unconditionally, bypassing the gate entirely, so compliance mode no longer reduced anything.browserless_profilesalso had no gating of its own.The existing compliance tests drive
registerSurfacedirectly, so they could not see registrations added straight toindex.ts— the regression slipped through.Fix
src/index.ts;registerSurfaceis again the sole registration path.browserless_profilesto theregister.tssurface table asfull, so it is exposed on the full surface and hidden on the compliant one.Tests
browserless_profiles.browserless_profilesis full-only, absent from the compliant surface.index.tsmust register only viaregisterSurface— it fails if any tool registrar is called directly inindex.ts, catching this exact regression class that theregisterSurface-driven tests cannot.Verification
Full suite: 533 passing. Compliant surface now registers exactly 5 tools; full registers 10.
Summary by CodeRabbit
New Features
browserless_profilestool to full-mode users.Bug Fixes
browserless_profilesis not available in compliant mode, and kept the active tool surface consistent at startup.Tests