Teach Content share links to discover MCP access - #5021
Conversation
|
Here's a visual recap of what changed: Open the full interactive recap |
There was a problem hiding this comment.
Builder reviewed your changes — looks good ✅
Review Details
Incremental Code Review Summary
I reviewed the latest PR #5021 head and compared it with the prior clean review. The Content share route still adds only nonvisual MCP discovery metadata and the context endpoint still returns scoped recovery guidance for denied private documents. The private path exposes the requested document ID and stable MCP instructions, but not private title/body data or rejected credentials. Public and token-authorized reads remain on the existing access-controlled paths, and the /content base-path handling is consistent across the alternate link, structured discovery payload, and denial JSON.
This remains a high-risk review because it changes private-document access behavior and an agent-facing API contract. Two independent code-review passes found no new confirmed actionable issues. Supplemental live HTTP/raw-HTML checks passed for public/private rendering, discovery fields, token handling, no-leak denial responses, XSS escaping, and 400/404 behavior. Interactive browser verification was attempted twice, but Chrome tools were unavailable across all executor batches; visual/accessibility, mobile, and CSR editor checks remain environment-blocked.
🧪 Browser testing: Attempted after this review — Chrome tools were unavailable; HTTP/raw-HTML checks passed, but interactive visual verification remains environment-blocked.

Problem
When someone pasted a private Content share URL into an external agent, an ordinary page fetch ended at the browser access notice. The page did not tell the agent that an authenticated Content MCP connection could read the same document, so the agent could incorrectly ask the user to paste the document or conclude that access was impossible.
The existing share page must keep working unchanged for people. Public content, private access notices, social metadata, and authentication behavior should not gain agent-oriented UI.
Approach
Make the share response self-describing for agents while preserving the human surface. Both readable and private share pages now advertise a structured agent-context endpoint and include server-rendered MCP guidance that CSS removes from layout, focus, and the accessibility tree. Anonymous private context requests remain failures, but their JSON response explains the exact authenticated
get-documentcall and same-instance connection path.The guidance contains only the document ID already present in the URL. It does not expose a private title, body, owner, credential, or rejected token.
What changed
/mcpendpoint,/mcp/connectsetup path, and exactget-document { id }action shape.application/agent-native+jsonalternate link and hidden server-rendered guidance to public and private share-page branches.Verification
innerText.get-document, and read the authorized fixture. A separate fresh fetch-first run recovered through the denied JSON guidance and MCP.resourceIdandid; it was corrected and covered by a regression assertion. No other findings remained.i18n-ignorereason;guard:i18n-changed-copyreports no affected copy surfaces.Review focus
get-document { id }shape stable for supported hosts?