fix(mcp): preserve headers during auth and debug (#31802)

This commit is contained in:
Aiden Cline
2026-06-10 23:12:02 -05:00
committed by GitHub
parent 51b10b128e
commit bf05e8a122
3 changed files with 15 additions and 5 deletions
+2
View File
@@ -744,6 +744,7 @@ export const McpDebugCommand = effectCmd({
const response = await fetch(serverConfig.url, {
method: "POST",
headers: {
...serverConfig.headers,
"Content-Type": "application/json",
Accept: "application/json, text/event-stream",
},
@@ -792,6 +793,7 @@ export const McpDebugCommand = effectCmd({
// Try creating transport with auth provider to trigger discovery
const transport = new StreamableHTTPClientTransport(new URL(serverConfig.url), {
authProvider,
requestInit: serverConfig.headers ? { headers: serverConfig.headers } : undefined,
})
try {