File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11import { cors } from "hono/cors"
2- import { Hono } from "hono"
2+ import { Hono , type Context } from "hono"
33import { SupermemoryMCP } from "./server"
44import { isApiKey , validateApiKey , validateOAuthToken } from "./auth"
55import { initPosthog } from "./posthog"
@@ -109,7 +109,7 @@ const mcpHandler = SupermemoryMCP.serve("/mcp", {
109109 } ,
110110} )
111111
112- app . all ( "/mcp/*" , async ( c ) => {
112+ const handleMcpRequest = async ( c : Context < { Bindings : Bindings } > ) => {
113113 const authHeader = c . req . header ( "Authorization" )
114114 const token = authHeader ?. replace ( / ^ B e a r e r \s + / i, "" )
115115 const containerTag = c . req . header ( "x-sm-project" )
@@ -186,7 +186,10 @@ app.all("/mcp/*", async (c) => {
186186 } as ExecutionContext & { props : Props }
187187
188188 return mcpHandler . fetch ( c . req . raw , c . env , ctx )
189- } )
189+ }
190+
191+ app . all ( "/mcp" , handleMcpRequest )
192+ app . all ( "/mcp/*" , handleMcpRequest )
190193
191194// Export the Durable Object class for Cloudflare Workers
192195export { SupermemoryMCP }
You can’t perform that action at this time.
0 commit comments