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

Function validateMcpServerUrl

apps/sim/lib/mcp/orchestration/server-lifecycle.ts:93–110  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

91 | { ok: false; result: PerformMcpServerResult }
92
93async function validateMcpServerUrl(url: string): Promise<ValidateMcpServerUrlResult> {
94 try {
95 validateMcpDomain(url)
96 const resolvedIP = await validateMcpServerSsrf(url)
97 return { ok: true, resolvedIP }
98 } catch (error) {
99 if (error instanceof McpDomainNotAllowedError || error instanceof McpSsrfError) {
100 return { ok: false, result: { success: false, error: error.message, errorCode: 'forbidden' } }
101 }
102 if (error instanceof McpDnsResolutionError) {
103 return {
104 ok: false,
105 result: { success: false, error: error.message, errorCode: 'bad_gateway' },
106 }
107 }
108 throw error
109 }
110}
111
112export async function performCreateMcpServer(
113 params: PerformCreateMcpServerParams

Callers 2

performCreateMcpServerFunction · 0.85
performUpdateMcpServerFunction · 0.85

Calls 2

validateMcpDomainFunction · 0.90
validateMcpServerSsrfFunction · 0.90

Tested by

no test coverage detected