feat: add WebMCP client tool registration - #1302
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughAdds ChangesWebMCP registrar
Framework lifecycle wrappers
Documentation and release metadata
End-to-end coverage
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The PR adds explicit WebMCP tool registration with lifecycle cleanup and reports passing focused and full validation for the change; no actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant BrowserAgent
participant WebMCPRoute
participant useWebMCPTools
participant document.modelContext
participant find_guitar
BrowserAgent->>WebMCPRoute: open WebMCP tools page
WebMCPRoute->>useWebMCPTools: register find_guitar
useWebMCPTools->>document.modelContext: registerTool descriptor
BrowserAgent->>document.modelContext: execute find_guitar
document.modelContext->>find_guitar: pass query and execution signal
find_guitar-->>document.modelContext: return Found guitar
document.modelContext-->>BrowserAgent: return serialized result
WebMCPRoute->>useWebMCPTools: unmount ToolOwner
useWebMCPTools->>document.modelContext: remove registration
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 27.59% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 29 functions across 33 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
View your CI Pipeline Execution ↗ for commit ce94090
☁️ Nx Cloud last updated this comment at |
@tanstack/ai
@tanstack/ai-acp
@tanstack/ai-angular
@tanstack/ai-anthropic
@tanstack/ai-bedrock
@tanstack/ai-byteplus
@tanstack/ai-claude-code
@tanstack/ai-client
@tanstack/ai-code-mode
@tanstack/ai-code-mode-snippets
@tanstack/ai-codex
@tanstack/ai-cohere
@tanstack/ai-compaction
@tanstack/ai-devtools-core
@tanstack/ai-durable-stream
@tanstack/ai-elevenlabs
@tanstack/ai-event-client
@tanstack/ai-fal
@tanstack/ai-gemini
@tanstack/ai-grok
@tanstack/ai-grok-build
@tanstack/ai-groq
@tanstack/ai-isolate-cloudflare
@tanstack/ai-isolate-daytona
@tanstack/ai-isolate-node
@tanstack/ai-isolate-quickjs
@tanstack/ai-isolate-quickjs-bun
@tanstack/ai-llmgateway
@tanstack/ai-lovable
@tanstack/ai-mcp
@tanstack/ai-memory
@tanstack/ai-mistral
@tanstack/ai-octane
@tanstack/ai-ollama
@tanstack/ai-openai
@tanstack/ai-opencode
@tanstack/ai-openrouter
@tanstack/ai-perplexity
@tanstack/ai-persistence
@tanstack/ai-preact
@tanstack/ai-react
@tanstack/ai-react-ui
@tanstack/ai-remix
@tanstack/ai-sandbox
@tanstack/ai-sandbox-cloudflare
@tanstack/ai-sandbox-daytona
@tanstack/ai-sandbox-docker
@tanstack/ai-sandbox-local-process
@tanstack/ai-sandbox-sprites
@tanstack/ai-sandbox-upstash-box
@tanstack/ai-sandbox-vercel
@tanstack/ai-skills
@tanstack/ai-solid
@tanstack/ai-solid-ui
@tanstack/ai-svelte
@tanstack/ai-utils
@tanstack/ai-vercel-gateway
@tanstack/ai-vertex
@tanstack/ai-vue
@tanstack/ai-vue-ui
@tanstack/openai-base
@tanstack/preact-ai-devtools
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
@tanstack/svelte-ai-devtools
commit: |
Browser agents can now discover and execute TanStack AI client tools through the experimental WebMCP API. Framework wrappers connect each registration to lifecycle cleanup.
🎯 Changes
registerWebMCPToolsto@tanstack/ai-clientwith schema validation, cancellation, runtime context, and safe rollback.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.docs/for this change, or this change is not user-facing.pnpm changeset), or this PR does not change a published package.🚀 Release Impact
Testing
Commands run
pnpm test:prpassed all 45 affected tasks in a clean worktree after the Kiira fix.pnpm run testpassed all 88 project targets and declaration checks in a clean worktree.pnpm --filter @tanstack/ai-e2e test:e2e -- --grep WebMCPpassed.generic-middleware-interrupts.spec.tsfailure.pnpm test:kiirapassed 1204 snippets, andpnpm exec changeset statuspassed.The Angular sample uses Kiira's
ignoremarker because@tanstack/ai-angularresolves only from builtdistfiles. This matches the existing Angular documentation policy.Manual test
pnpm --filter @tanstack/ai-e2e dev.http://localhost:3010/web-mcp-tools.Found guitar.How this PR makes testing easy
The branch includes focused package tests and a deterministic browser E2E route. Run the focused WebMCP command to cover discovery, execution, and cleanup.
Risk / rollback
Risk is limited to explicit WebMCP registration. Unsupported environments do not register tools. Revert this PR to remove the new APIs.
Public API change
Before
After
Summary by CodeRabbit
New Features
Documentation