azure-devops-mcp
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Azure DevOps MCP Integration
<a href="https://glama.ai/mcp/servers/z7mxfcinp8"> <img width="380" height="200" src="https://glama.ai/mcp/servers/z7mxfcinp8/badge" /> </a>A powerful integration for Azure DevOps that provides seamless access to work items, repositories, projects, boards, and sprints through the Model Context Protocol (MCP) server.
Overview
This server provides a convenient API for interacting with Azure DevOps services, enabling AI assistants and other tools to manage work items, code repositories, boards, sprints, and more. Built with the Model Context Protocol, it provides a standardized interface for communicating with Azure DevOps.
Features
The integration is organized into four main tool categories:
Work Item Tools
- List work items using WIQL queries
- Get work item details by ID
- Search for work items
- Get recently updated work items
- Get your assigned work items
- Create new work items
- Update existing work items
- Add comments to work items
- Update work item state
- Assign work items
- Create links between work items
- Bulk create/update work items
Boards & Sprints Tools
- Get team boards
- Get board columns
- Get board items
- Move cards on boards
- Get sprints
- Get the current sprint
- Get sprint work items
- Get sprint capacity
- Get team members
Project Tools
- List projects
- Get project details
- Create new projects
- Get areas
- Get iterations
- Create areas
- Create iterations
- Get process templates
- Get work item types
- Get work item type fields
Git Tools
- List repositories
- Get repository details
- Create repositories
- List branches
- Search code
- Browse repositories
- Get file content
- Get commit history
- List pull requests
- Create pull requests
- Get pull request details
- Get pull request comments
- Approve pull requests
- Merge pull requests
Installation
Installing via Smithery
To install azuredevops-mcp for Claude Desktop automatically via Smithery:
Prerequisites
- Node.js (v16 or later)
- TypeScript (v4 or later)
- An Azure DevOps account with a Personal Access Token (PAT)
Setup
- Clone the repository:Copy
- Install dependencies:Copy
- Configure environment variables (create a
.env
file or set them directly):Copy - Build the project:If you encounter TypeScript errors but want to proceed anyway:CopyCopy
- Start the server:Copy
Configuration
Personal Access Token (PAT)
You'll need to create a Personal Access Token with appropriate permissions:
- Go to your Azure DevOps organization
- Click on your profile icon in the top right
- Select "Personal access tokens"
- Click "New Token"
- Give it a name and select the appropriate scopes:
- Work Items: Read & Write
- Code: Read & Write
- Project and Team: Read & Write
- Build: Read
- Release: Read
Environment Variables
The server can be configured using the following environment variables:
Variable | Description | Required | Default |
---|---|---|---|
AZURE_DEVOPS_ORG_URL | URL of your Azure DevOps organization | Yes | - |
AZURE_DEVOPS_PERSONAL_ACCESS_TOKEN | Your personal access token | Yes | - |
AZURE_DEVOPS_PROJECT | Default project to use | Yes | - |
Usage
Once the server is running, you can interact with it using the MCP protocol. The server exposes several tools for different Azure DevOps functionalities.
Available Tools
Note: By default, only a subset of tools are registered in the
index.ts
file to keep the initial implementation simple. See the Tool Registration section for information on how to register additional tools.
Example: List Work Items
Example: Create a Work Item
Example: List Repositories
Example: Create a Pull Request
Architecture
The project is structured as follows:
src/
Interfaces/
: Type definitions for parameters and responsesServices/
: Service classes for interacting with Azure DevOps APIsTools/
: Tool implementations that expose functionality to clientsindex.ts
: Main entry point that registers tools and starts the serverconfig.ts
: Configuration handling
Service Layer
The service layer handles direct communication with the Azure DevOps API:
WorkItemService
: Work item operationsBoardsSprintsService
: Boards and sprints operationsProjectService
: Project management operationsGitService
: Git repository operations
Tools Layer
The tools layer wraps the services and provides a consistent interface for the MCP protocol:
WorkItemTools
: Tools for work item operationsBoardsSprintsTools
: Tools for boards and sprints operationsProjectTools
: Tools for project management operationsGitTools
: Tools for Git operations
Tool Registration
The MCP server requires tools to be explicitly registered in the index.ts
file. By default, only a subset of all possible tools are registered to keep the initial implementation manageable.
To register more tools:
- Open the
src/index.ts
file - Add new tool registrations following the pattern of existing tools
- Build and restart the server
A comprehensive guide to tool registration is available in the TOOL_REGISTRATION.md
file in the repository.
Note: When registering tools, be careful to use the correct parameter types, especially for enum values. The type definitions in the
Interfaces
directory define the expected types for each parameter. Using the wrong type (e.g., usingz.string()
instead ofz.enum()
for enumerated values) will result in TypeScript errors during build.
Example of registering a new tool:
Troubleshooting
Common Issues
Authentication Errors
- Ensure your Personal Access Token is valid and has the required permissions
- Check that the organization URL is correct
TypeScript Errors During Build
- Use
npm run build:ignore-errors
to bypass TypeScript errors - Check for missing or incorrect type definitions
Runtime Errors
- Verify that the Azure DevOps project specified exists and is accessible
Contributing
Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Please ensure your code passes linting and includes appropriate tests.
You must be authenticated.
This server provides a convenient API for interacting with Azure DevOps services, enabling AI assistants and other tools to manage work items, code repositories, boards, sprints, and more. Built with the Model Context Protocol, it provides a standardized interface for communicating with Azure DevOps