MCPcopy
hub / github.com/codeaashu/claude-code / getLoggingSafeMcpBaseUrl

Function getLoggingSafeMcpBaseUrl

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

Source from the content-addressed store, hash-verified

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

Callers 4

mcpBaseUrlAnalyticsFunction · 0.85
performMCPOAuthFlowFunction · 0.85
_doRefreshMethod · 0.85

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected