MCPcopy Create free account
hub / github.com/Noumena-Network/code / getLoggingSafeMcpBaseUrl

Function getLoggingSafeMcpBaseUrl

src/services/mcp/utils.ts:562–576  ·  view source on GitHub ↗
(
  config: McpServerConfig,
)

Source from the content-addressed store, hash-verified

560 * Returns undefined for stdio/sdk servers or if URL parsing fails.
561 */
562export function getLoggingSafeMcpBaseUrl(
563 config: McpServerConfig,
564): string | undefined {
565 if (!('url' in config) || typeof config.url !== 'string') {
566 return undefined
567 }
568
569 try {
570 const url = new URL(config.url)
571 url.search = ''
572 return url.toString().replace(/\/$/, '')
573 } catch {
574 return undefined
575 }
576}

Callers 4

mcpBaseUrlAnalyticsFunction · 0.85
performMCPOAuthFlowFunction · 0.85
_doRefreshMethod · 0.85

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected