A Model Context Protocol (MCP) server that provides comprehensive integration with Azure DevOps. This server enables AI assistants like Claude Desktop and development tools like VS Code to seamlessly interact with Azure DevOps through the MCP protocol using stdio transport.
We welcome contributions! Please see our Contributing Guide for details on how to get started.
- Projects: Browse Azure DevOps projects and team information
- Repositories: View repositories, files, commits, branches, and pull requests
- Work Items: Query and manage work items with optional write operations
- Performance Monitoring: Built-in performance tracking and optimization
- Production Ready: Comprehensive caching, error handling, and security features
- Safe Write Operations: Opt-in write capabilities with audit logging
The server exposes Azure DevOps functionality through specialized tool categories:
Read-Only Operations (Always Available):
list_projects
- Lists all projects in the Azure DevOps organizationlist_repositories
- Lists repositories in a specific projectlist_repository_items
- Lists files and folders in a repository pathget_file_content
- Gets the content of a specific file from a repositorylist_work_items
- Lists work items in a specific projectget_work_item
- Gets detailed information about a specific work item
Write Operations (Require Explicit Opt-In):
add_pull_request_comment
- Adds a comment to a pull request (requiresPullRequestComments
)create_draft_pull_request
- Creates a draft pull request (requiresCreateDraftPullRequest
)update_work_item_tags
- Adds or removes tags from work items (requiresUpdateWorkItemTags
)
High-Performance Bulk Operations:
batch_get_work_items
- Retrieves multiple work items efficiently in parallelbatch_get_repositories
- Gets multiple repository details in parallel
Test Management Operations:
get_test_plans
- Gets test plans for a specific Azure DevOps projectget_test_plan
- Gets detailed information about a specific test planget_test_suites
- Gets test suites for a specific test planget_test_runs
- Gets test runs for a specific Azure DevOps projectget_test_run
- Gets detailed information about a specific test runget_test_results
- Gets test results for a specific test run
System Management:
get_performance_metrics
- View operation timings, API call statistics, and cache performanceget_cache_statistics
- Detailed cache performance and hit rate statisticsclear_cache
- Clear all cached data to force fresh API calls
- .NET 9 SDK (for local development)
- Docker (for running the container)
- Azure DevOps account with appropriate permissions
Get started in seconds with a fully configured development environment:
VS Code:
- Install VS Code and the Dev Containers extension
- Clone this repository and open in VS Code
- Click "Reopen in Container" when prompted
- Start coding immediately with .NET 9, tools, and extensions pre-configured!
Having issues? See .devcontainer/README.md for troubleshooting
GitHub Codespaces:
- Click the "Code" button on this repository
- Select "Codespaces" → "Create codespace on main"
- Develop directly in your browser with zero setup
For traditional local development:
# Manual setup (any platform)
dotnet restore && dotnet build && dotnet test
- Sign in to your Azure DevOps organization (https://dev.azure.com/{your-organization})
- Click on your profile icon in the top right corner
- Select Personal access tokens from the dropdown menu
- Click + New Token
- Name your token (e.g., "MCP Server Access")
- Select the appropriate organization where you want to use the token
- For read-only access, select the following scopes:
- Code: Read
- Work Items: Read
- Project and Team: Read
- Test Management: Read (for test plan operations)
- Set an expiration date for your token
- Click Create
- Copy and securely store your token (you won't be able to see it again!)
# Build the Docker image
docker build -t azuredevops-mcp .
# Run the container with environment variables
docker run -it \
-e AzureDevOps__OrganizationUrl="https://dev.azure.com/your-organization" \
-e AzureDevOps__PersonalAccessToken="your-pat-goes-here" \
azuredevops-mcp
# Set environment variables
$env:AzureDevOps__OrganizationUrl="https://dev.azure.com/your-organization"
$env:AzureDevOps__PersonalAccessToken="your-pat-goes-here"
# Build and run
dotnet restore
dotnet build
dotnet run --project src/AzureDevOps.MCP
The server uses stdio transport, which means it communicates via standard input/output. This is the standard way MCP servers are integrated with tools like Claude Desktop, VS Code extensions, or other MCP clients.
For Claude Desktop, add this to your MCP configuration:
{
"mcpServers": {
"azure-devops": {
"command": "docker",
"args": [
"run", "-i",
"-e", "AzureDevOps__OrganizationUrl=https://dev.azure.com/your-organization",
"-e", "AzureDevOps__PersonalAccessToken=your-pat-goes-here",
"azuredevops-mcp"
]
}
}
}
The server supports comprehensive configuration through environment variables or appsettings.json
:
Setting | Description | Required |
---|---|---|
AzureDevOps__OrganizationUrl |
Your Azure DevOps organization URL (e.g., https://dev.azure.com/myorg ) |
Yes |
AzureDevOps__PersonalAccessToken |
Your Azure DevOps Personal Access Token | Yes |
Setting | Description | Default |
---|---|---|
AzureDevOps__EnabledWriteOperations |
Array of enabled write operations | [] |
AzureDevOps__RequireConfirmation |
Require explicit confirmation for write operations | true |
AzureDevOps__EnableAuditLogging |
Enable audit logging for all operations | true |
The server supports extensive production configuration options:
{
"AzureDevOps": {
"OrganizationUrl": "https://dev.azure.com/your-organization",
"PersonalAccessToken": "your-pat-goes-here",
"EnabledWriteOperations": ["PullRequestComments"],
"RequireConfirmation": true,
"EnableAuditLogging": true,
"Monitoring": {
"EnablePerformanceTracking": true,
"EnableErrorTracking": true,
"Sentry": {
"Dsn": "your-sentry-dsn"
}
}
},
"Caching": {
"EnableMemoryCache": true,
"MaxMemoryCacheSizeMB": 100,
"DefaultCacheDurationMinutes": 15
},
"Performance": {
"SlowOperationThresholdMs": 1000,
"EnableCircuitBreaker": true,
"EnableMonitoring": true
},
"Security": {
"EnableKeyVault": false,
"KeyVaultUrl": "https://your-keyvault.vault.azure.net/"
},
"RateLimiting": {
"EnableRateLimiting": true,
"RequestsPerMinute": 60,
"RequestsPerHour": 1000
}
}
Enable specific write operations by adding them to EnabledWriteOperations
:
PullRequestComments
- Add comments to pull requestsWorkItemComments
- Add comments to work itemsCreateDraftPullRequest
- Create draft pull requests (not published until ready)UpdateWorkItemTags
- Add or remove tags from work items
- Opt-In by Default: All write operations are disabled unless explicitly enabled
- Confirmation Required: Write operations require a
confirm: true
parameter (can be disabled) - Audit Logging: All write operations are logged with timestamp, operation type, and result
- Preview Mode: Operations show what will be changed before confirmation
This project implements a modern, production-ready architecture with .NET 9:
-
MCP Tools Layer (
Tools/
): Five specialized tool categories implementing MCP protocolAzureDevOpsTools
- Core read operationsSafeWriteTools
- Opt-in write operations with safety measuresBatchTools
- High-performance bulk operationsTestPlanTools
- Test plan and test management operationsPerformanceTools
- System monitoring and management
-
Services Layer (
Services/
):- Core Services (
Core/
): Domain-specific business logic (Projects, Repositories, WorkItems, Builds, Tests, Search) - Infrastructure Services (
Infrastructure/
): Cross-cutting concerns (Caching, Performance, Health, Connection Management) - Legacy Service:
AzureDevOpsService
for backward compatibility
- Core Services (
-
Configuration Layer (
Configuration/
): Modular configuration classesProductionConfiguration
- Complete production settingsCachingConfiguration
- Cache managementPerformanceConfiguration
- Performance tuningSecurityConfiguration
- Security settingsRateLimitingConfiguration
- API rate limiting
-
Security & Infrastructure:
- Authorization (
Authorization/
): Permission-based access control - Security (
Security/
): Secret management with Azure Key Vault support - Error Handling (
ErrorHandling/
): Resilient execution patterns
- Authorization (
- Performance Optimization: Built-in caching, connection pooling, and performance monitoring
- Reliability: Circuit breaker patterns, retry policies, and health checks
- Security: Comprehensive secret management, authorization, and audit logging
- Monitoring: Sentry integration, structured logging, and performance metrics
- Scalability: Rate limiting, memory management, and efficient batch operations
# Restore packages
dotnet restore
# Build the project
dotnet build
# Run the application
dotnet run --project src/AzureDevOps.MCP
- .NET 9: Latest framework with modern C# features
- ModelContextProtocol: MCP SDK for protocol implementation
- Azure DevOps Client Libraries: Official Microsoft libraries for Azure DevOps integration
- BenchmarkDotNet: Performance benchmarking and optimization
- Centralized Package Management: All package versions managed in Directory.Packages.props
The project includes comprehensive testing infrastructure:
# Run all tests (153 passing, 7 skipped, 160 total)
dotnet test
# Run tests with coverage
./scripts/test-coverage.ps1
# Run performance benchmarks
cd tests/AzureDevOps.MCP.Tests
dotnet run --configuration Release -- cache # Cache performance
dotnet run --configuration Release -- performance # Service performance
dotnet run --configuration Release -- config # Configuration benchmarks
dotnet run --configuration Release -- frozen # .NET 9 collections performance
./scripts/dev-setup.ps1
- Quick setup for new developers./scripts/test-coverage.ps1
- Run tests with coverage analysis./scripts/test-coverage.ps1 -OpenReport
- Generate and open coverage report
The Azure DevOps MCP server enables powerful workflows for test-driven development:
-
Get Test Plan Requirements
# Use MCP client to get test plan details get_test_plans projectName="MyProject" get_test_plan projectName="MyProject" planId=123 get_test_suites projectName="MyProject" planId=123
-
Get Repository Information
# Get repository details and clone URL list_repositories projectName="MyProject" list_repository_items projectName="MyProject" repositoryId="repo-guid" path="/"
-
Local Development (You handle these steps)
# Clone repository using information from MCP server git clone https://dev.azure.com/org/project/_git/repository cd repository # Create feature branch git checkout -b feature/implement-test-plan-123 # Generate unit tests and UI tests based on test plan requirements # (Use test plan details to understand what needs to be tested) # Commit your changes git add . git commit -m "Implement tests for test plan #123" git push origin feature/implement-test-plan-123
-
Create Pull Request
# Use MCP server to create draft PR create_draft_pull_request projectName="MyProject" repositoryId="repo-guid" \ sourceBranch="feature/implement-test-plan-123" \ targetBranch="main" \ title="Implement tests for test plan #123" \ description="Added unit tests and UI tests based on test plan requirements" \ confirm=true
This workflow demonstrates how the MCP server bridges the gap between Azure DevOps test management and local development, enabling seamless test-driven development processes.
- The PAT token should be kept secure and have minimal required permissions
- By default, the server only performs read operations on Azure DevOps
- Write operations must be explicitly enabled and are limited to safe operations
- All write operations are audited and logged
- Use environment variables for sensitive configuration
- Audit logs are stored locally in the
audit/
directory