Skip to content

Commit fe7118d

Browse files
waleedlatif1claude
andcommitted
fix(mcp): trigger OAuth auto-detection probe for empty headers object
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 87504d7 commit fe7118d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/sim/app/api/mcp/servers/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ export const POST = withRouteHandler(
113113
const serverId = body.url ? generateMcpServerId(workspaceId, body.url) : generateId()
114114

115115
let resolvedAuthType: 'none' | 'headers' | 'oauth' = body.authType ?? 'headers'
116-
if (!body.authType && body.url && !body.headers) {
116+
const hasHeaders = body.headers && Object.keys(body.headers).length > 0
117+
if (!body.authType && body.url && !hasHeaders) {
117118
try {
118119
resolvedAuthType = await detectMcpAuthType(body.url)
119120
logger.info(`[${requestId}] Probed ${body.url}: authType=${resolvedAuthType}`)

0 commit comments

Comments
 (0)