From cfcfaaac0f3a1c584068bb4088a92dd17e5c3ca0 Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Thu, 16 Apr 2026 23:27:38 +0000 Subject: [PATCH] fix: another resource url issue (#859) --- apps/mcp/src/index.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/mcp/src/index.ts b/apps/mcp/src/index.ts index 6c9f241e..30119f55 100644 --- a/apps/mcp/src/index.ts +++ b/apps/mcp/src/index.ts @@ -59,9 +59,16 @@ app.get("/", (c) => { // MCP clients use this to discover the authorization server app.get("/.well-known/oauth-protected-resource", (c) => { const apiUrl = c.env.API_URL || DEFAULT_API_URL - const host = c.req.header("x-forwarded-host") || c.req.header("host") - const proto = c.req.header("x-forwarded-proto") || "https" - const resourceUrl = host ? `${proto}://${host}` : "https://mcp.supermemory.ai" + + // TODO: commented out because this might be issue with auth as well + //const host = c.req.header("x-forwarded-host") || c.req.header("host") + //const proto = c.req.header("x-forwarded-proto") || "https" + //const resourceUrl = host ? `${proto}://${host}` : "https://mcp.supermemory.ai" + + const resourceUrl = + c.env.API_URL === "http://localhost:8787" + ? "http://localhost:8788" + : "https://mcp.supermemory.ai" return c.json({ resource: resourceUrl,