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

Function validateMcpDomain

apps/sim/lib/mcp/domain-check.ts:87–99  ·  view source on GitHub ↗
(url: string | undefined)

Source from the content-addressed store, hash-verified

85 * validated after resolution at execution time.
86 */
87export function validateMcpDomain(url: string | undefined): void {
88 if (!url) {
89 if (getAllowedMcpDomainsFromEnv() !== null) {
90 throw new McpDomainNotAllowedError('(empty)')
91 }
92 return
93 }
94 if (hasEnvVarInHostname(url)) return
95 const rejected = checkMcpDomain(url)
96 if (rejected !== null) {
97 throw new McpDomainNotAllowedError(rejected)
98 }
99}
100
101/**
102 * Returns true if the IP is a loopback address (full 127.0.0.0/8 range, or ::1).

Callers 4

resolveConfigEnvVarsMethod · 0.90
validateMcpServerUrlFunction · 0.90
route.tsFile · 0.90

Calls 3

checkMcpDomainFunction · 0.85
hasEnvVarInHostnameFunction · 0.70

Tested by

no test coverage detected