Skip to content

Commit c45e164

Browse files
waleedlatif1claude
andcommitted
chore(mcp): final audit pass — strip restated TSDoc and narration comments
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 4fd9cf3 commit c45e164

4 files changed

Lines changed: 2 additions & 21 deletions

File tree

apps/sim/app/workspace/[workspaceId]/settings/components/mcp/mcp.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ interface MCPProps {
152152
initialServerId?: string | null
153153
}
154154

155-
/**
156-
* MCP Settings component for managing Model Context Protocol servers.
157-
* Handles server CRUD operations, connection testing, and environment variable integration.
158-
*/
159155
export function MCP({ initialServerId }: MCPProps) {
160156
const params = useParams()
161157
const workspaceId = params.workspaceId as string

apps/sim/lib/mcp/oauth/probe.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ const logger = createLogger('McpOauthProbe')
66

77
const PROBE_TIMEOUT_MS = 5000
88

9-
/**
10-
* Lightweight unauthenticated probe to determine the auth mode required by
11-
* a remote MCP server.
12-
*
13-
* - 200/2xx → server accepts unauthenticated requests; treat as `none`.
14-
* - 401 with `WWW-Authenticate: Bearer resource_metadata=...` → `oauth`.
15-
* - anything else → fall back to `headers` (caller can let the user paste a token).
16-
*/
179
export async function detectMcpAuthType(url: string): Promise<McpAuthType> {
1810
const controller = new AbortController()
1911
const timer = setTimeout(() => controller.abort(), PROBE_TIMEOUT_MS)

apps/sim/lib/mcp/oauth/provider.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,6 @@ export class SimMcpOauthProvider implements OAuthClientProvider {
148148
}
149149
}
150150

151-
/**
152-
* Load workspace-shared pre-registered OAuth credentials for a server, if any.
153-
* Decrypts the stored client_secret. Returns undefined when DCR should be used.
154-
*/
155151
export async function loadPreregisteredClient(
156152
serverId: string
157153
): Promise<PreregisteredClient | undefined> {

apps/sim/lib/mcp/service.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ class McpService {
162162
}
163163

164164
/**
165-
* Create and connect to an MCP client.
166-
*
167165
* For `authType === 'oauth'` configs, a per-user `SimMcpOauthProvider` is
168166
* built and attached so the SDK can drive the standard MCP OAuth flow.
169167
*/
@@ -412,9 +410,8 @@ class McpService {
412410
result.reason instanceof McpOauthAuthorizationRequiredError ||
413411
result.reason instanceof UnauthorizedError
414412
) {
415-
// Pending user authorization or expired refresh — not a hard failure.
416-
// Force the row back to 'disconnected' so the settings UI surfaces the
417-
// "Connect with OAuth" button instead of leaving stale 'connected' state.
413+
// Force 'disconnected' so the settings UI surfaces the re-auth button
414+
// instead of a stale 'connected' state when refresh has expired.
418415
logger.info(`[${requestId}] Skipping server ${server.name}: OAuth authorization pending`)
419416
statusUpdates.push(
420417
db

0 commit comments

Comments
 (0)