A simple web app that connects to an org, retrieves metadata and generates a package.xml file.
Execute anonymous apex code:
System.debug('OrgId: '+ UserInfo.getOrganizationId());
System.debug('BaseUrl: '+ Url.getOrgDomainUrl() + '/');
System.debug('SessionId: '+ (UserInfo.getSessionId()).substring(1));