Enables configuration of the MCP server through environment variables stored in a .env file, supporting essential settings like Azure DevOps credentials and optional configuration parameters.
Used in the configuration layer to manage environment variables and default settings with type validation and schema enforcement.
Provides the runtime environment for the MCP server, requiring version 3.11 or higher for execution of the Azure DevOps integration.
Azure DevOps MCP Server
A Model Context Protocol (MCP) server that provides seamless integration with Azure DevOps, allowing you to read backlogs, work items, and perform various queries through a standardized interface.
Features
Comprehensive Work Item Management: Query work items by ID, type, state, assignee, and more
Backlog Integration: Access team backlogs and sprint planning items
Flexible State Filtering: Filter work items by specific states or state categories (active, completed, review)
WIQL Query Support: Execute custom Work Item Query Language queries
Smart Defaults: Configurable default search parameters for streamlined workflows
Advanced Filtering: Support for iteration paths, area paths, and complex multi-condition queries
Installation
Prerequisites
Python 3.11 or higher
Azure DevOps Personal Access Token (PAT)
Access to an Azure DevOps organization and project
Setup
Clone the repository:
git clone https://github.com/jhlia0/azure-devops-mcp.git cd mcp-server-azure-devopsInstall dependencies:
uv syncConfigure environment variables:
cp .env.example .envEdit the
.env
file with your Azure DevOps credentials. It's highly recommended to setDEFAULT_USER
if you plan to query your own work items:ORGANIZATION=your-organization PROJECT=your-project AZURE_DEVOPS_PAT=your-personal-access-token DEFAULT_USER=your-email@example.com # (Optional) Recommended for personal work item queriesRun the server:
python main.py
Configuration
Required Environment Variables
Variable | Description | Example |
| Azure DevOps organization name |
|
| Azure DevOps project name |
|
| Personal Access Token |
|
Optional Configuration
Variable | Default | Description |
| - | Default team name for backlog queries |
| - | Default user for work item queries (recommended for querying your own work items) |
|
| Default work item types |
|
| Maximum number of results to return |
|
| Exclude closed work items by default |
|
| Exclude removed work items by default |
| - | Default iteration path for queries |
| - | Default area path for queries |
|
| Default active states |
|
| Default completed states |
|
| Default review states |
Available MCP Tools
Core Work Item Tools
get_work_items
- Get work items by their IDsget_work_items_by_query
- Execute custom WIQL queries with optional project filteringget_work_items_by_type
- Get work items by type (Bug, Task, etc.) with optional state and project filteringget_work_items_by_state
- Get work items by specific state with additional filters and optional project filteringget_work_items_with_filters
- Advanced filtering with multiple criteria and optional project filtering
User-Focused Tools
get_my_work_items
- Get work items assigned to a specific user with state and optional project filteringget_active_work_items
- Get all active work items using default filters and optional project filtering
Backlog Tools
get_backlog_items
- Get backlog items for a team with optional project filteringget_default_backlog
- Get backlog items using default team settings with optional project filtering
State Management Tools
get_work_items_by_state_category
- Get work items by state category (active, completed, review) with optional project filteringget_closed_work_items
- Get closed work items with optional filters and project filteringget_available_states
- Get list of common work item states
Work Item Modification Tools
update_work_item_title
- Update the title of a work itemupdate_work_item_description
- Update the description of a work itemadd_work_item_comment
- Add a comment to a work itemcreate_work_item
- Create a new work item
Utility Tools
get_default_work_items
- Get work items using all default search settings with optional project filteringget_project_info
- Get project configuration and default settings
Usage Examples
Basic Queries
State-Based Queries
Advanced Filtering
Custom WIQL Queries
Work Item Modification
Authentication
The server uses Azure DevOps Personal Access Tokens (PAT) for authentication. To create a PAT:
Go to
https://dev.azure.com/{organization}/_usersSettings/tokens
Click "New Token"
Configure the token with appropriate permissions:
Work Items: Read
Project and Team: Read
Copy the generated token and add it to your
.env
file
Architecture
Key Components
Configuration Layer (
config.py
): Manages environment variables and default settings using PydanticClient Layer (
azure_devops_client.py
): Handles Azure DevOps REST API communicationServer Layer (
server.py
): Implements MCP tools and request handlingEntry Point (
main.py
): Starts the FastMCP server
Development
Adding New Tools
Define request models in
server.py
Implement the tool function with
@mcp.tool()
decoratorAdd appropriate error handling and response formatting
Update this README with the new tool documentation
Testing
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
Troubleshooting
Common Issues
Authentication Errors: Verify your PAT has the correct permissions and hasn't expired
Project Not Found: Check that the organization and project names are correct
Network Issues: Ensure you can access Azure DevOps from your network
State Filtering: Different projects may use different state names - check your project's work item states
Debugging
Enable debug logging by setting the environment variable:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues and questions:
Check the troubleshooting section above
Review Azure DevOps REST API documentation
Open an issue in the project repository
Related Projects
FastMCP - The MCP framework used by this server
Azure DevOps REST API - Official API documentation
This server cannot be installed
A Model Context Protocol server that integrates with Azure DevOps, enabling users to query work items, access backlogs, and perform various Azure DevOps operations through a standardized interface.
Related MCP Servers
- AsecurityAlicenseAqualityThis 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 DevOpsLast updated -4147MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants to interact with Azure DevOps resources including projects, work items, repositories, pull requests, branches, and pipelines through a standardized protocol.Last updated -15652295MIT License
- -securityFlicense-qualityA reference server implementation for the Model Context Protocol that enables AI assistants to interact with Azure DevOps resources and perform operations such as project management, work item tracking, repository operations, and code search programmatically.Last updated -7
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants to interact with Azure DevOps services, allowing users to query work items with plans to support creating/updating items, managing pipelines, handling pull requests, and administering sprints and branch policies.Last updated -2174MIT License