Commit 37da441
fix(mcp): make OAuth probe work via JSON add modal and preserve HTTP status
Two changes that together let spec-compliant OAuth servers (Semrush,
Linear, Notion, Atlassian) connect via either modal path:
1. client.ts: when the SDK throws StreamableHTTPError, prefix the
wrapped error message with `HTTP <code>:` so the status code survives
McpConnectionError wrapping. Without this the 401 status is invisible
downstream — the message read just "Streamable HTTP error: Error
POSTing to endpoint:" with no body for empty 401s.
2. form modal: extract isAuthRequiredError helper and apply it to BOTH
handleSubmitForm AND handleSubmitJson. Previously only the form path
swallowed auth-shaped test-connection failures and proceeded to the
create flow (where the probe runs and the OAuth dance starts). The
JSON path treated any failure as fatal, blocking Semrush et al.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 9fbbbff commit 37da441
2 files changed
Lines changed: 31 additions & 16 deletions
File tree
- apps/sim
- app/workspace/[workspaceId]/settings/components/mcp/components/mcp-server-form-modal
- lib/mcp
Lines changed: 22 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
70 | 86 | | |
71 | 87 | | |
72 | 88 | | |
| |||
517 | 533 | | |
518 | 534 | | |
519 | 535 | | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
533 | 541 | | |
534 | 542 | | |
535 | 543 | | |
| |||
587 | 595 | | |
588 | 596 | | |
589 | 597 | | |
590 | | - | |
| 598 | + | |
591 | 599 | | |
592 | 600 | | |
593 | 601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
130 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
131 | 138 | | |
132 | 139 | | |
133 | 140 | | |
| |||
0 commit comments