Skip to main content
Glama
environment-detector.ts1.52 kB
/** * Environment Detection Service * Detects current working directory and maps to appropriate Azure DevOps configuration * @deprecated Use DirectoryDetector instead */ import { AzureDevOpsConfig, ProjectMapping } from '../types/index.js'; import { DirectoryDetector } from '../directory-detector.js'; export class EnvironmentDetector { private directoryDetector: DirectoryDetector; constructor(mappings: ProjectMapping[], defaultConfig?: AzureDevOpsConfig) { this.directoryDetector = new DirectoryDetector(mappings, defaultConfig); } /** * Detect Azure DevOps configuration based on current directory */ detectEnvironment(currentDirectory: string): AzureDevOpsConfig | null { return this.directoryDetector.detectConfiguration(currentDirectory); } /** * Add a new project mapping */ addMapping(mapping: ProjectMapping): void { this.directoryDetector.addMapping(mapping.directory, mapping.config); } /** * Get all configured mappings */ getMappings(): string[] { return this.directoryDetector.getConfiguredDirectories(); } /** * Get project context for directory */ getProjectContext(currentDirectory?: string): { projectName: string; organizationUrl: string } | null { return this.directoryDetector.getProjectContext(currentDirectory); } /** * Check if directory is configured */ isConfiguredDirectory(currentDirectory?: string): boolean { return this.directoryDetector.isConfiguredDirectory(currentDirectory); } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wangkanai/devops-enhanced-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server