MCP HubMCP Hub
Tiberriver256

azure-devops-mcp

by: Tiberriver256

An MCP server for Azure DevOps

82created 28/02/2025
Visit
Azure
DevOps

📌Overview

Purpose: Implement a Model Context Protocol (MCP) server for Azure DevOps to facilitate interaction between AI assistants and Azure DevOps APIs through a standardized protocol.

Overview: The Azure DevOps MCP Server acts as an intermediary that allows AI models to access and manage Azure DevOps resources securely and conveniently. By leveraging the MCP, it simplifies various operations including project management, work item handling, and executing DevOps workflows through natural language commands.

Key Features:

  • Standardized API Interaction: Enables seamless integration with Azure DevOps APIs for project, repository, and work item management.

  • Natural Language Processing: Allows AI assistants to execute common DevOps workflows through intuitive natural language commands, increasing efficiency and user-friendliness.


Azure DevOps MCP Server

A Model Context Protocol (MCP) server implementation for Azure DevOps, allowing AI assistants to interact with Azure DevOps APIs through a standardized protocol.

Overview

This server implements the Model Context Protocol (MCP) for Azure DevOps, enabling AI assistants like Claude to interact with Azure DevOps resources securely. The server acts as a bridge between AI models and Azure DevOps APIs, providing a standardized way to:

  • Access and manage projects, work items, repositories, and more
  • Create and update work items, branches, and pull requests
  • Execute common DevOps workflows through natural language
  • Access repository content via standardized resource URIs
  • Safely authenticate and interact with Azure DevOps resources

Server Structure

The server is structured around the Model Context Protocol (MCP) for communicating with AI assistants. It provides tools for interacting with Azure DevOps resources including:

  • Projects
  • Work Items
  • Repositories
  • Pull Requests
  • Branches
  • Pipelines

Core Components

  • AzureDevOpsServer: Main server class that initializes the MCP server and registers tools
  • Tool Handlers: Modular functions for each Azure DevOps operation
  • Configuration: Environment-based configuration for organization URL, PAT, etc.

Getting Started

Prerequisites

  • Node.js (v16+)
  • npm or yarn
  • Azure DevOps account with appropriate access
  • Authentication credentials (see Authentication Guide for details):
    • Personal Access Token (PAT), or
    • Azure Identity credentials, or
    • Azure CLI login

Usage with Claude Desktop/Cursor AI

To integrate with Claude Desktop or Cursor AI, add one of the following configurations to your configuration file.

Azure Identity Authentication

Be sure you are logged in to Azure CLI with az login then add the following:

{
  "mcpServers": {
    "azureDevOps": {
      "command": "npx",
      "args": ["-y", "@tiberriver256/mcp-server-azure-devops"],
      "env": {
        "AZURE_DEVOPS_ORG_URL": "https://dev.azure.com/your-organization",
        "AZURE_DEVOPS_AUTH_METHOD": "azure-identity",
        "AZURE_DEVOPS_DEFAULT_PROJECT": "your-project-name"
      }
    }
  }
}

Personal Access Token (PAT) Authentication

{
  "mcpServers": {
    "azureDevOps": {
      "command": "npx",
      "args": ["-y", "@tiberriver256/mcp-server-azure-devops"],
      "env": {
        "AZURE_DEVOPS_ORG_URL": "https://dev.azure.com/your-organization",
        "AZURE_DEVOPS_AUTH_METHOD": "pat",
        "AZURE_DEVOPS_PAT": "<YOUR_PAT>",
        "AZURE_DEVOPS_DEFAULT_PROJECT": "your-project-name"
      }
    }
  }
}

For detailed configuration instructions and more authentication options, see the Authentication Guide.

Authentication Methods

This server supports multiple authentication methods for connecting to Azure DevOps APIs. For detailed setup instructions, configuration examples, and troubleshooting tips, see the Authentication Guide.

Supported Authentication Methods

  1. Personal Access Token (PAT) - Simple token-based authentication
  2. Azure Identity (DefaultAzureCredential) - Flexible authentication using the Azure Identity SDK
  3. Azure CLI - Authentication using your Azure CLI login

Example configuration files for each authentication method are available in the examples directory.

Environment Variables

For a complete list of environment variables and their descriptions, see the Authentication Guide.

Key environment variables include:

VariableDescriptionRequiredDefault
AZURE_DEVOPS_AUTH_METHODAuthentication method (pat, azure-identity, or azure-cli) - case-insensitiveNoazure-identity
AZURE_DEVOPS_ORG_URLFull URL to your Azure DevOps organizationYes-
AZURE_DEVOPS_PATPersonal Access Token (for PAT auth)Only with PAT auth-
AZURE_DEVOPS_DEFAULT_PROJECTDefault project if none specifiedNo-
AZURE_DEVOPS_API_VERSIONAPI version to useNoLatest
AZURE_TENANT_IDAzure AD tenant ID (for service principals)Only with service principals-
AZURE_CLIENT_IDAzure AD application ID (for service principals)Only with service principals-
AZURE_CLIENT_SECRETAzure AD client secret (for service principals)Only with service principals-
LOG_LEVELLogging level (debug, info, warn, error)Noinfo

Troubleshooting Authentication

Common issues include:

  • Invalid or expired credentials
  • Insufficient permissions
  • Network connectivity problems
  • Configuration errors

See the Authentication Guide for detailed troubleshooting information.

Available Tools

The Azure DevOps MCP server provides a variety of tools for interacting with Azure DevOps resources:

User Tools

  • get_me: Get details of the authenticated user (id, displayName, email)

Organization Tools

  • list_organizations: List all accessible organizations

Project Tools

  • list_projects: List all projects in an organization
  • get_project: Get details of a specific project
  • get_project_details: Get comprehensive details of a project including process, work item types, and teams

Repository Tools

  • list_repositories: List all repositories in a project
  • get_repository: Get details of a specific repository
  • get_repository_details: Get detailed information about a repository including statistics and refs
  • get_file_content: Get content of a file or directory from a repository

Work Item Tools

  • get_work_item: Retrieve a work item by ID
  • create_work_item: Create a new work item
  • update_work_item: Update an existing work item
  • list_work_items: List work items in a project
  • manage_work_item_link: Add, remove, or update links between work items

Search Tools

  • search_code: Search for code across repositories in a project
  • search_wiki: Search for content across wiki pages in a project
  • search_work_items: Search for work items across projects in Azure DevOps

Pipelines Tools

  • list_pipelines: List pipelines in a project
  • get_pipeline: Get details of a specific pipeline
  • trigger_pipeline: Trigger a pipeline run with customizable parameters

Wiki Tools

  • get_wikis: List all wikis in a project
  • get_wiki_page: Get content of a specific wiki page as plain text

For comprehensive documentation on all tools, see the Tools Documentation.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for contribution guidelines.

License

MIT