fix(httpapi): preserve mcp oauth error parity (#24706)

This commit is contained in:
Kit Langton
2026-04-27 22:33:21 -04:00
committed by GitHub
parent 4d74849c1a
commit 796b652d2b
4 changed files with 122 additions and 12 deletions
@@ -8,6 +8,21 @@ import { lazy } from "@/util/lazy"
import { Effect } from "effect"
import { jsonRequest, runRequest } from "./trace"
const UnsupportedOAuthError = z
.object({
error: z.string(),
})
.meta({ ref: "McpUnsupportedOAuthError" })
const unsupportedOAuthErrorResponse = {
description: "MCP server does not support OAuth",
content: {
"application/json": {
schema: resolver(UnsupportedOAuthError),
},
},
}
export const McpRoutes = lazy(() =>
new Hono()
.get(
@@ -85,7 +100,8 @@ export const McpRoutes = lazy(() =>
},
},
},
...errors(400, 404),
400: unsupportedOAuthErrorResponse,
...errors(404),
},
}),
async (c) => {
@@ -157,7 +173,8 @@ export const McpRoutes = lazy(() =>
},
},
},
...errors(400, 404),
400: unsupportedOAuthErrorResponse,
...errors(404),
},
}),
async (c) => {