Skip to content

docs(mcp): fix page-bridge examples to match the real API - #351

Merged
vamgan merged 1 commit into
mainfrom
claude/fix-mcp-pagebridge-docs
Jun 28, 2026
Merged

vamgan merged 1 commit into
mainfrom
claude/fix-mcp-pagebridge-docs

Conversation

@vamgan

@vamgan vamgan commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

The MCP guide's page-bridge examples document an API that does not exist:

// ❌ what the guide showed
const bridge = createAskableMcpPageBridge(ctx, { resourceUri: 'askable://current', name: '…' });
bridge.destroy();
bridge.promptContext();
bridge.contextPacket();

The real API (verified against packages/mcp/src/index.ts) takes a single options object with a provider and returns { dispose() } — there is no resourceUri/name option and no destroy()/promptContext()/contextPacket() method.

Fix

// ✅ corrected
const bridge = createAskableMcpPageBridge({
  provider: createAskableMcpContextProvider(ctx),
});
bridge.dispose();
  • Fixed both the Browser-local page bridge example and the React example with page bridge.
  • Replaced the bogus "prompt-ready vs structured" bridge.promptContext()/contextPacket() snippet with an accurate table of how the companion selects output via the request type (get_current_context / format_context_for_prompt / read_current_resource).
  • Mentioned the requireRedacted option.

Docs-only; no code changes.

Test plan

  • vitepress build clean (no dead links)
  • swept site/docs/ — no remaining references to the non-existent API in source
  • CI preview/build green

🤖 Generated with Claude Code


Generated by Claude Code

The MCP guide documented a createAskableMcpPageBridge(ctx, { resourceUri, name })
signature with bridge.destroy()/promptContext()/contextPacket() — none of which
exist. The real API is createAskableMcpPageBridge({ provider }) returning
{ dispose() }. Corrects both the page-bridge and React examples to pass a
provider (via createAskableMcpContextProvider) and replaces the bogus
prompt-vs-structured methods with the actual request-type response table.
@vercel

vercel Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
askable Ready Ready Preview, Comment Jun 28, 2026 6:38pm

@vamgan
vamgan merged commit 0cfdf1b into main Jun 28, 2026
3 checks passed
@vamgan
vamgan deleted the claude/fix-mcp-pagebridge-docs branch June 28, 2026 18:38

This branch was successfully deployed

1 active deployment
Preview — 1553447a Deployed Jun 28, 2026 by vercel[bot]
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