We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dynatrace-oss/dynatrace-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
environment-detection.ts•876 B
/**
* Utility functions for detecting and handling different runtime environments
*/
/**
* Detects if the application is running in GitHub Codespaces
* @returns true if running in Codespaces, false otherwise
*/
export function isRunningInCodespaces(): boolean {
return !!(process.env.CODESPACE_NAME && process.env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN);
}
/**
* Gets the forwarded URL for OAuth redirect in GitHub Codespaces
* @param port The port number to use in the forwarded URL
* @returns The forwarded URL if in Codespaces, null otherwise
*/
export function getCodespacesForwardedUrl(port: number): string | null {
if (!isRunningInCodespaces()) {
return null;
}
const codespaceName = process.env.CODESPACE_NAME!;
const domain = process.env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN!;
return `https://${codespaceName}-${port}.${domain}`;
}