Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions apps/sim/lib/mcp/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,6 @@ describe('McpClient notification handler', () => {
{
authProvider,
requestInit: { headers: { 'X-Sim-Via': 'workflow' } },
// The transport fetch is always wrapped for diagnostics (a no-op passthrough
// under test); it defaults to globalThis.fetch when the server isn't pinned.
fetch: expect.any(Function),
}
)
})
Expand Down
5 changes: 1 addition & 4 deletions apps/sim/lib/mcp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { createLogger } from '@sim/logger'
import { getErrorMessage } from '@sim/utils/errors'
import { getMaxExecutionTimeout } from '@/lib/core/execution-limits'
import { getMcpSafeErrorDiagnostics } from '@/lib/mcp/error-diagnostics'
import { withMcpHttpDiagnostics } from '@/lib/mcp/http-diagnostics'
import { McpOauthRedirectRequired } from '@/lib/mcp/oauth'
import { createPinnedMcpFetch } from '@/lib/mcp/pinned-fetch'
import {
Expand Down Expand Up @@ -102,9 +101,7 @@ export class McpClient {
this.transport = new StreamableHTTPClientTransport(new URL(this.config.url), {
authProvider: useOauth ? this.authProvider : undefined,
requestInit: { headers: this.config.headers },
// Wrap whether pinned or not (SDK's default is globalThis.fetch, so passing it is
// behavior-neutral) so the diagnostic also covers unpinned/allowlisted servers.
fetch: withMcpHttpDiagnostics(pinned?.fetch ?? globalThis.fetch, 'transport'),
...(pinned ? { fetch: pinned.fetch } : {}),
})

this.client = new Client(
Expand Down
176 changes: 0 additions & 176 deletions apps/sim/lib/mcp/http-diagnostics.ts

This file was deleted.

3 changes: 1 addition & 2 deletions apps/sim/lib/mcp/oauth/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { auth, type OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js'
import { withMcpHttpDiagnostics } from '@/lib/mcp/http-diagnostics'
import { createSsrfGuardedMcpFetch } from '@/lib/mcp/pinned-fetch'

type McpAuthOptions = Parameters<typeof auth>[1]
Expand All @@ -18,6 +17,6 @@ export function mcpAuthGuarded(
): ReturnType<typeof auth> {
return auth(provider, {
...options,
fetchFn: withMcpHttpDiagnostics(options.fetchFn ?? createSsrfGuardedMcpFetch(), 'oauth'),
fetchFn: options.fetchFn ?? createSsrfGuardedMcpFetch(),
})
}
Loading