# Podcast MCP integration: agent handoff Implement a public, read-only podcast MCP endpoint and connect the existing episode page to SupaKnock. Read https://supaknock.com/developers/mcp and the full contract at https://supaknock.com/guides/mcp-tools.md first. Example definitions and results: https://supaknock.com/guides/podcast-mcp-examples.json. ## Inspect before changing Locate the episode API, public-visibility rules, transcript storage, player, routing and existing chat widget. Identify time units and stable transcript revision/segment identifiers. Check that the installed SupaKnock server supports Connected AI tools; documentation publication alone does not install it. Preserve existing support chat and use one widget controller. ## Backend - Implement MCP 2025-11-25 Streamable HTTP on a dedicated public HTTPS endpoint without redirects. Support initialize, notifications/initialized, tools/list and tools/call. Keep JSON responses small; SSE is optional. - Expose exactly get_episode, search_transcript and get_transcript_window with the documented inputs. Use closed input objects and the supported schema subset. - Use a dedicated least-privilege service token if authentication is needed. Keep it on the backend and in SupaKnock's encrypted connection. Never expose a broader admin token to this integration. - Recheck public visibility and service-token scope on every call, including aliases. Missing and private episodes both return unavailable. No subscriber-only data, writes, transcription jobs or user delegation. - Return contract_version 1, stable canonical IDs, immutable transcript revisions and stable revision-scoped segment IDs. Supply requested_episode_id for canonical aliases. Convert milliseconds to seconds when needed. - Return exact transcript excerpts, honest coverage and timing_kind, and canonical HTTPS timestamp URLs. Limit search to six results, query to 1,000 characters and windows to 120 seconds; honor all byte limits in the contract. - Use revision_changed when a requested snapshot is no longer current. Do not pass a generated summary off as transcript evidence. If text and structuredContent are both present, serialize the same object into text. ## Website - Mount the widget once. Supply version 1 podcast_episode context with an opaque episode ID. Use setContextProvider for current route/player state; include position_seconds only if the player is playing that episode. - Clear context on non-episode routes. Keep support and episode entry points in one conversation via open({intent: 'support'}) and open({intent: 'episode'}). - Optionally implement onSourceActivate. Validate source kind, canonical episode identity and finite bounded seconds before seeking; return true only when handled. Do not autoplay. Otherwise return false for the canonical URL fallback. - Do not put secrets, user IDs, permission claims, arbitrary instructions or URLs in browser context. ## SupaKnock administrator setup Add the connection and exact permitted citation origins; enable availability, discover and review tools, and run a public read-only test. In the project, select the connection, Episode on the visitor's page, the three tools and the source mode. Choose tools-only for episode data alone or combined for indexed support knowledge too. Verify exact generation keys/model for tool access, then explicitly enable AI. Configure the widget's allowed website origins through existing project chat settings. ## Acceptance checks - A specific episode question returns supported excerpts with working timestamp sources. - Metadata works without a transcript; absent transcripts and no search matches are described honestly. - Alias IDs resolve correctly; private/missing episodes reveal no private metadata. - Route or player changes do not retarget an in-flight message; retries preserve the original context. - Revision changes cannot mix transcript snapshots; approximate/unavailable timing is labelled accurately. - Timeouts, oversized results, invalid schemas, invalid redirects and authentication failures produce an unavailable state, never fabricated answers. - Topic restrictions and human takeover still prevent inappropriate or late tool work. Support chat remains usable. - Review the widget on desktop and mobile and test source links without a player callback. Deliver changed files, setup instructions, tests/evidence and remaining limitations. Do not deploy services or enable production tools without the owner's authorization. No full example application is needed.