MCPcopy Index your code
hub / github.com/simstudioai/sim / createSsrfGuardedMcpFetch

Function createSsrfGuardedMcpFetch

apps/sim/lib/mcp/pinned-fetch.ts:24–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22 * @throws McpSsrfError if a request URL resolves to a blocked IP address
23 */
24export function createSsrfGuardedMcpFetch(): FetchLike {
25 return (async (url, init) => {
26 const target = typeof url === 'string' ? url : url.href
27 const resolvedIP = await validateMcpServerSsrf(target)
28 const pinnedFetch: FetchLike = resolvedIP ? createPinnedFetch(resolvedIP) : globalThis.fetch
29 return pinnedFetch(url, init)
30 }) satisfies FetchLike
31}

Callers 3

revokeMcpOauthTokensFunction · 0.90
detectMcpAuthTypeFunction · 0.90

Calls 2

validateMcpServerSsrfFunction · 0.90
createPinnedFetchFunction · 0.90

Tested by

no test coverage detected