Check All Projects Health
check_all_projectsAssess both MCP server health and Azure DevOps pipeline status for all registered projects, identifying issues to ensure system uptime.
Instructions
Check both MCP server health and Azure DevOps pipeline status across all registered projects.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout_ms | No |
Implementation Reference
- src/app.ts:538-632 (handler)The main handler function for the 'check_all_projects' tool. It lists all MCP servers and Azure pipeline groups, then concurrently checks health for each. Returns a summary with up/down counts.
async (input: CheckAllProjectsInput) => { const servers = listServers({}); const pipelineGroups = listAzurePipelineGroups(); const [mcpResults, pipelineResults] = await Promise.all([ Promise.allSettled( servers.map(async (listedServer) => { const serverConfig = getServer(listedServer.name); if (!serverConfig) { return { name: listedServer.name, type: 'mcp_server', ...buildErrorResult(new Error(`Server not found: ${listedServer.name}`)) }; } const result = await checkServer(serverConfig, input.timeout_ms); recordHealthCheck(listedServer.name, result); return { name: listedServer.name, type: 'mcp_server', ...result }; }) ), Promise.allSettled( pipelineGroups.map(async (groupName) => { const groupRows = listAzurePipelines(groupName); const pipelines = await Promise.all( groupRows.map(async (row) => { if (!row.pipeline_id) { return { pipeline: row.pipeline_name, status: 'unknown' }; } const run = await getLatestRun( row.organization, row.project, row.pipeline_id, decodePatToken(row.pat_token_encrypted) ); if (!run) { return { pipeline: row.pipeline_name, status: 'unknown' }; } recordPipelineRun(row.group_name, row.pipeline_name, run); return { pipeline: row.pipeline_name, ...run }; }) ); return { group: groupName, type: 'azure_pipeline', pipelines }; }) ) ]); const mcp = mcpResults.map((result) => result.status === 'fulfilled' ? result.value : { error: String(result.reason) } ); const pipelines = pipelineResults.map((result) => result.status === 'fulfilled' ? result.value : { error: String(result.reason) } ); const mcpDown = mcp.filter( (result) => typeof result === 'object' && result !== null && 'status' in result && result.status !== 'up' ).length; const pipelineFailed = pipelines .flatMap((group) => typeof group === 'object' && group !== null && 'pipelines' in group ? ((group.pipelines as Array<Record<string, unknown>>) ?? []) : [] ) .filter((pipeline) => pipeline.status === 'failed').length; return formatResponse({ summary: `MCP: ${mcp.length - mcpDown}/${mcp.length} up | Pipelines: ${pipelineFailed} failed`, mcp_servers: mcp, azure_pipelines: pipelines }); } - src/types.ts:116-118 (schema)Zod schema defining the input for check_all_projects: timeout_ms (1000-30000, default 5000).
export const CheckAllProjectsSchema = z.object({ timeout_ms: z.number().int().min(1000).max(30000).default(5000) }); - src/app.ts:525-633 (registration)Registers the 'check_all_projects' tool with metadata (title, description, inputSchema, annotations) on the MCP server.
server.registerTool( 'check_all_projects', { title: 'Check All Projects Health', description: 'Check both MCP server health and Azure DevOps pipeline status across all registered projects.', inputSchema: CheckAllProjectsSchema, annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true } }, async (input: CheckAllProjectsInput) => { const servers = listServers({}); const pipelineGroups = listAzurePipelineGroups(); const [mcpResults, pipelineResults] = await Promise.all([ Promise.allSettled( servers.map(async (listedServer) => { const serverConfig = getServer(listedServer.name); if (!serverConfig) { return { name: listedServer.name, type: 'mcp_server', ...buildErrorResult(new Error(`Server not found: ${listedServer.name}`)) }; } const result = await checkServer(serverConfig, input.timeout_ms); recordHealthCheck(listedServer.name, result); return { name: listedServer.name, type: 'mcp_server', ...result }; }) ), Promise.allSettled( pipelineGroups.map(async (groupName) => { const groupRows = listAzurePipelines(groupName); const pipelines = await Promise.all( groupRows.map(async (row) => { if (!row.pipeline_id) { return { pipeline: row.pipeline_name, status: 'unknown' }; } const run = await getLatestRun( row.organization, row.project, row.pipeline_id, decodePatToken(row.pat_token_encrypted) ); if (!run) { return { pipeline: row.pipeline_name, status: 'unknown' }; } recordPipelineRun(row.group_name, row.pipeline_name, run); return { pipeline: row.pipeline_name, ...run }; }) ); return { group: groupName, type: 'azure_pipeline', pipelines }; }) ) ]); const mcp = mcpResults.map((result) => result.status === 'fulfilled' ? result.value : { error: String(result.reason) } ); const pipelines = pipelineResults.map((result) => result.status === 'fulfilled' ? result.value : { error: String(result.reason) } ); const mcpDown = mcp.filter( (result) => typeof result === 'object' && result !== null && 'status' in result && result.status !== 'up' ).length; const pipelineFailed = pipelines .flatMap((group) => typeof group === 'object' && group !== null && 'pipelines' in group ? ((group.pipelines as Array<Record<string, unknown>>) ?? []) : [] ) .filter((pipeline) => pipeline.status === 'failed').length; return formatResponse({ summary: `MCP: ${mcp.length - mcpDown}/${mcp.length} up | Pipelines: ${pipelineFailed} failed`, mcp_servers: mcp, azure_pipelines: pipelines }); } ); - src/app.ts:81-90 (helper)Helper function formatResponse that wraps the result payload into a ToolResponse with JSON text content.
function formatResponse(payload: unknown): ToolResponse { return { content: [ { type: 'text', text: JSON.stringify(payload, null, 2) } ] }; } - src/app.ts:103-111 (helper)Helper function buildErrorResult used in the handler to create error result objects for failed server checks.
function buildErrorResult(error: unknown): CheckResult { return { status: 'error', response_time_ms: null, tool_count: null, error_message: error instanceof Error ? error.message : 'Unknown error', tools: null }; }