MCP Apps Kit - v0.5.0
    Preparing search index...

    Function getMcpServerBaseUrl

    • Get the server base URL from injected config.

      Convenience function that extracts just the base URL from the config. Falls back to window.location.origin if available, or the provided default.

      Parameters

      • defaultUrl: string = ""

        Fallback URL if not configured and window.location unavailable

      Returns string

      The server base URL

      // Uses injected config, then window.location.origin, then the fallback
      const baseUrl = getMcpServerBaseUrl("http://localhost:3000");

      // Configure debug logger with dynamic base URL
      clientDebugLogger.configure({
      transport: "api",
      apiEndpoint: `${getMcpServerBaseUrl()}/api/logs`,
      });