@@ -30,8 +30,34 @@ export const OPTIONS: APIRoute = async () => {
3030 } ) ;
3131} ;
3232
33- export const GET : APIRoute = async ( { locals } ) => {
33+ export const GET : APIRoute = async ( { request , locals } ) => {
3434 const origin = locals . siteUrl . origin ;
35+ const accept = request . headers . get ( "accept" ) || "" ;
36+
37+ // If client requests SSE stream (legacy MCP HTTP+SSE transport)
38+ if ( accept . includes ( "text/event-stream" ) ) {
39+ const encoder = new TextEncoder ( ) ;
40+ const stream = new ReadableStream ( {
41+ start ( controller ) {
42+ controller . enqueue (
43+ encoder . encode ( `event: endpoint\ndata: ${ origin } /mcp\n\n` ) ,
44+ ) ;
45+ } ,
46+ } ) ;
47+
48+ return new Response ( stream , {
49+ headers : {
50+ "content-type" : "text/event-stream; charset=utf-8" ,
51+ "cache-control" : "no-cache, no-transform" ,
52+ connection : "keep-alive" ,
53+ "access-control-allow-origin" : "*" ,
54+ "access-control-allow-methods" : "GET, POST, OPTIONS" ,
55+ "access-control-allow-headers" :
56+ "Content-Type, Authorization, Mcp-Session-Id, Mcp-Protocol-Version" ,
57+ } ,
58+ } ) ;
59+ }
60+
3561 return new Response (
3662 JSON . stringify (
3763 {
@@ -41,6 +67,7 @@ export const GET: APIRoute = async ({ locals }) => {
4167 protocolVersion : "2024-11-05" ,
4268 supportedVersions : [ "2026-07-28" , "2024-11-05" ] ,
4369 transport : "streamable-http" ,
70+ endpoint : `${ origin } /mcp` ,
4471 serverCard : `${ origin } /.well-known/mcp/server-card.json` ,
4572 capabilities : {
4673 tools : { listChanged : false } ,
@@ -185,7 +212,7 @@ export const POST: APIRoute = async ({ request, locals }) => {
185212 } ,
186213 type : {
187214 type : "string" ,
188- enum : [ "all" , "post" , "podcast" ] ,
215+ enum : [ "all" , "post" , "podcast" , "author" , "guest" ] ,
189216 description :
190217 "Optional filter for content type (default: all)" ,
191218 } ,
@@ -214,6 +241,20 @@ export const POST: APIRoute = async ({ request, locals }) => {
214241 ) ;
215242 }
216243
244+ // 6b. Resource templates list
245+ if ( method === "resources/templates/list" ) {
246+ return new Response (
247+ JSON . stringify ( {
248+ jsonrpc : "2.0" ,
249+ id,
250+ result : {
251+ resourceTemplates : [ ] ,
252+ } ,
253+ } ) ,
254+ { headers : MCP_HEADERS } ,
255+ ) ;
256+ }
257+
217258 // 7. Prompts list
218259 if ( method === "prompts/list" ) {
219260 return new Response (
0 commit comments