fix(mcp): detect non-standard OAuth errors from servers returning HTTP 400

This commit is contained in:
Jan Lüdemann 2026-02-26 12:25:43 +01:00
parent 59bd27b4f4
commit 7175ee0e1d
2 changed files with 8 additions and 0 deletions

View file

@ -455,6 +455,10 @@ export class MCPConnectionFactory {
if (message.includes('authentication required') || message.includes('unauthorized')) {
return true;
}
// Check for missing authorization values (e.g., Amazon Ads MCP returns HTTP 400 with this)
if (message.includes('no authorization')) {
return true;
}
}
return false;

View file

@ -1131,6 +1131,10 @@ export class MCPConnection extends EventEmitter {
if (message.includes('authentication required') || message.includes('unauthorized')) {
return true;
}
// Check for missing authorization values (e.g., Amazon Ads MCP returns HTTP 400 with this)
if (message.includes('no authorization')) {
return true;
}
}
return false;