Skip to main content
Glama

Azure DevOps MCP Server

feature.spec.int.ts2.76 kB
import { WebApi } from 'azure-devops-node-api'; import { getPipeline } from './feature'; import { listPipelines } from '../list-pipelines/feature'; import { getTestConnection, shouldSkipIntegrationTest, } from '../../../shared/test/test-helpers'; describe('getPipeline integration', () => { let connection: WebApi | null = null; let projectId: string; let existingPipelineId: number | null = null; beforeAll(async () => { // Get a real connection using environment variables connection = await getTestConnection(); // Get the project ID from environment variables, fallback to default projectId = process.env.AZURE_DEVOPS_DEFAULT_PROJECT || 'DefaultProject'; // Skip if no connection or project is available if (shouldSkipIntegrationTest() || !connection || !projectId) { return; } // Try to get an existing pipeline ID for testing try { const pipelines = await listPipelines(connection, { projectId }); if (pipelines.length > 0) { existingPipelineId = pipelines[0].id ?? null; } } catch (error) { console.log('Could not find existing pipelines for testing:', error); } }); test('should get a pipeline by ID', async () => { // Skip if no connection, project, or pipeline ID is available if ( shouldSkipIntegrationTest() || !connection || !projectId || !existingPipelineId ) { console.log( 'Skipping getPipeline integration test - no connection, project or existing pipeline available', ); return; } // Act - make an API call to Azure DevOps const pipeline = await getPipeline(connection, { projectId, pipelineId: existingPipelineId, }); // Assert expect(pipeline).toBeDefined(); expect(pipeline.id).toBe(existingPipelineId); expect(pipeline.name).toBeDefined(); expect(typeof pipeline.name).toBe('string'); expect(pipeline.folder).toBeDefined(); expect(pipeline.revision).toBeDefined(); expect(pipeline.url).toBeDefined(); expect(pipeline.url).toContain('_apis/pipelines'); }); test('should throw ResourceNotFoundError for non-existent pipeline', async () => { // Skip if no connection or project is available if (shouldSkipIntegrationTest() || !connection || !projectId) { console.log( 'Skipping getPipeline error test - no connection or project available', ); return; } // Use a very high ID that is unlikely to exist const nonExistentPipelineId = 999999; // Act & Assert - should throw a not found error await expect( getPipeline(connection, { projectId, pipelineId: nonExistentPipelineId, }), ).rejects.toThrow(/not found/); }); });

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/Tiberriver256/mcp-server-azure-devops'

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