feat(httpapi): bridge mcp oauth endpoints (#24405)

This commit is contained in:
Kit Langton
2026-04-25 19:27:11 -04:00
committed by GitHub
parent 3e35c974a4
commit 450128f9be
4 changed files with 121 additions and 9 deletions

View File

@@ -83,4 +83,28 @@ describe("mcp HttpApi", () => {
expect(disconnected.status).toBe(200)
expect(await disconnected.json()).toBe(true)
})
test("serves deterministic OAuth endpoints", async () => {
await using tmp = await tmpdir({
config: {
mcp: {
demo: {
type: "local",
command: ["echo", "demo"],
enabled: false,
},
},
},
})
const start = await request("/mcp/demo/auth", tmp.path, { method: "POST" })
expect(start.status).toBe(400)
const authenticate = await request("/mcp/demo/auth/authenticate", tmp.path, { method: "POST" })
expect(authenticate.status).toBe(400)
const removed = await request("/mcp/demo/auth", tmp.path, { method: "DELETE" })
expect(removed.status).toBe(200)
expect(await removed.json()).toEqual({ success: true })
})
})