@@ -145,9 +145,9 @@ Hosted Web MCP is the server-side path. For local browser workflows, a page
145145cannot expose MCP directly to Claude or ChatGPT by itself. It needs a trusted
146146browser extension or local companion process. ` createAskableMcpPageBridge() `
147147adds the page-side handoff: the page listens for approved bridge requests and
148- returns the current packet or prompt-ready text through ` window.postMessage() ` .
149- The extension or companion can then expose that data through its own local MCP
150- server.
148+ returns the current packet, prompt-ready text, or a resource-shaped
149+ ` askable://current ` payload through ` window.postMessage() ` . The extension or
150+ companion can then expose that data through its own local MCP server.
151151
152152``` ts
153153import { createAskableMcpContextProvider , createAskableMcpPageBridge } from ' @askable-ui/mcp' ;
@@ -181,6 +181,29 @@ window.postMessage({
181181```
182182
183183Use ` type: 'format_context_for_prompt' ` when the bridge needs prompt-ready text
184- instead of the structured packet. Keep user consent and installation trust in
184+ instead of the structured packet.
185+
186+ Use ` type: 'read_current_resource' ` when the extension or companion wants a
187+ resource-shaped response that can map directly to MCP ` resources/read ` output:
188+
189+ ``` ts
190+ window .postMessage ({
191+ protocol: ' askable.mcp.page_bridge' ,
192+ version: ' 0.1' ,
193+ channel: ' askable:mcp' ,
194+ type: ' read_current_resource' ,
195+ requestId: crypto .randomUUID (),
196+ options: {
197+ sources: [' accounts' ],
198+ resource: {
199+ uri: ' askable://current' ,
200+ format: ' packet' ,
201+ },
202+ },
203+ }, window .location .origin );
204+ ```
205+
206+ Set ` resource.format ` to ` prompt ` to receive ` text/plain ` prompt context at a
207+ URI such as ` askable://current.txt ` . Keep user consent and installation trust in
185208the extension or companion, and enable the page bridge only when the app wants
186209to participate in local browser MCP workflows.
0 commit comments