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:
- Install dependencies:
- Configure environment variables:Edit the
.env
file with your Azure DevOps credentials. It's highly recommended to setDEFAULT_USER
if you plan to query your own work items: - Run the server:
Configuration
Required Environment Variables
Variable | Description | Example |
---|---|---|
ORGANIZATION | Azure DevOps organization name | mycompany |
PROJECT | Azure DevOps project name | MyProject |
AZURE_DEVOPS_PAT | Personal Access Token | your-pat-token |
Optional Configuration
Variable | Default | Description |
---|---|---|
DEFAULT_TEAM | - | Default team name for backlog queries |
DEFAULT_USER | - | Default user for work item queries (recommended for querying your own work items) |
DEFAULT_WORK_ITEM_TYPES | Bug,Task,User Story,Product Backlog Item | Default work item types |
DEFAULT_MAX_RESULTS | 100 | Maximum number of results to return |
EXCLUDE_CLOSED | true | Exclude closed work items by default |
EXCLUDE_REMOVED | true | Exclude removed work items by default |
DEFAULT_ITERATION_PATH | - | Default iteration path for queries |
DEFAULT_AREA_PATH | - | Default area path for queries |
DEFAULT_ACTIVE_STATES | Active,New,In Progress,To Do,Doing | Default active states |
DEFAULT_COMPLETED_STATES | Closed,Done,Resolved | Default completed states |
DEFAULT_REVIEW_STATES | Code Review,Testing,Approved | 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 Pydantic - Client Layer (
azure_devops_client.py
): Handles Azure DevOps REST API communication - Server Layer (
server.py
): Implements MCP tools and request handling - Entry Point (
main.py
): Starts the FastMCP server
Development
Adding New Tools
- Define request models in
server.py
- Implement the tool function with
@mcp.tool()
decorator - Add 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 -964343TypeScriptMIT 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 -151,436277TypeScriptMIT 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 -7TypeScript
- 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 -971PythonMIT License