Azure DevOps MCP Server
MCP server that provides tools to interact with Azure DevOps, including querying work items, repositories, pull requests, builds, commits, and creating work items via a standardized interface.
README
Azure DevOps MCP Server
This is a Model Context Protocol (MCP) server that provides access to Azure DevOps resources and tools through a standardized interface.
Features
The server provides the following Azure DevOps tools:
- get_workitems - Retrieve work items using WIQL queries
- get_repositories - List Git repositories
- get_pullrequests - Get pull requests from repositories
- get_builds - Retrieve build pipeline information
- get_commits - Get Git commits from repositories
- create_workitem - Create new work items (bugs, features, tasks, etc.)
Prerequisites
- Azure DevOps Account: You need access to an Azure DevOps organization
- Personal Access Token: Generate a PAT with the following scopes:
- Work Items (Read & Write)
- Code (Read)
- Build (Read)
- Release (Read)
Setup Instructions
1. Configure Environment Variables
Edit the .env file in the project root and replace the placeholder values:
# Your Azure DevOps organization name (e.g., "mycompany" for dev.azure.com/mycompany)
AZURE_DEVOPS_ORG=your-actual-organization
# Your Azure DevOps project name
AZURE_DEVOPS_PROJECT=your-actual-project
# Your Azure DevOps Personal Access Token
AZURE_DEVOPS_TOKEN=your-actual-personal-access-token
2. Generate Personal Access Token
- Go to your Azure DevOps organization:
https://dev.azure.com/{your-org}/_usersSettings/tokens - Click "New Token"
- Set the following scopes:
- Work Items: Read & Write
- Code: Read
- Build: Read
- Release: Read
- Copy the generated token and add it to your
.envfile
3. Test the Server
Run the server to test your configuration:
# Activate virtual environment
source azure-mcp-venv/bin/activate
# Run the server
python main.py
If successful, you should see: 🚀 Azure DevOps MCP Server running...
Running the MCP Server
Option 1: Terminal Interactive Client (Recommended for VPN environments)
If you're behind a VPN or can't connect through VS Code, you can use the interactive MCP client directly from the terminal:
# Navigate to the project directory
cd /Users/kshitijijari/Desktop/MySpace/MCP/azure-devops-mcp-server
# Activate the virtual environment
source azure-mcp-venv/bin/activate
# Run the interactive MCP client
python mcp_client.py
This will start an interactive menu with the following options:
- List available tools - See all Azure DevOps tools available
- Get work items - Run custom WIQL queries
- Get repositories - List Git repositories
- Get builds - View build pipeline information
- Get pull requests - View PRs from repositories
- Get commits - View Git commits
- Create work item - Create new work items
- Exit
Option 2: Direct MCP Server
Run the MCP server directly (for use with MCP clients):
# Navigate to the project directory
cd /Users/kshitijijari/Desktop/MySpace/MCP/azure-devops-mcp-server
# Activate the virtual environment
source azure-mcp-venv/bin/activate
# Run the MCP server
python main.py
Option 3: Using the startup script
# Make the script executable
chmod +x start_mcp_server.sh
# Run the startup script
./start_mcp_server.sh
Adding to MCP Client (VS Code/Cursor)
Option 1: Using the provided configuration
Copy the mcp_config.json file to your MCP client configuration directory and update the environment variables:
{
"mcpServers": {
"azure-devops": {
"command": "python",
"args": [
"/Users/kshitijijari/Desktop/MySpace/MCP/azure-devops-mcp-server/main.py"
],
"env": {
"AZURE_DEVOPS_ORG": "your-actual-organization",
"AZURE_DEVOPS_PROJECT": "your-actual-project",
"AZURE_DEVOPS_TOKEN": "your-actual-personal-access-token"
}
}
}
}
Option 2: Manual configuration
Add this to your MCP client configuration:
{
"mcpServers": {
"azure-devops": {
"command": "python",
"args": ["/absolute/path/to/your/azure-devops-mcp-server/main.py"],
"env": {
"AZURE_DEVOPS_ORG": "your-organization",
"AZURE_DEVOPS_PROJECT": "your-project",
"AZURE_DEVOPS_TOKEN": "your-personal-access-token"
}
}
}
}
Option 3: Using the startup script
You can also use the provided startup script:
{
"mcpServers": {
"azure-devops": {
"command": "/Users/kshitijijari/Desktop/MySpace/MCP/azure-devops-mcp-server/start_mcp_server.sh",
"env": {
"AZURE_DEVOPS_ORG": "your-organization",
"AZURE_DEVOPS_PROJECT": "your-project",
"AZURE_DEVOPS_TOKEN": "your-personal-access-token"
}
}
}
}
Usage Examples
Terminal Interactive Client Examples
When using the interactive MCP client (python mcp_client.py), you can:
Get work items with custom queries:
- Enter a WIQL query like:
SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.AssignedTo] = 'John Doe' - Or use the default query for recent work items
Get repositories:
- Optionally filter by repository name
- View all available Git repositories
Get builds:
- Filter by build definition ID
- Filter by status (inProgress, completed, all)
- Set custom limits
Create work items:
- Choose work item type (Bug, Feature, Task, User Story, Epic)
- Set title, description, assignee, area path, and iteration path
MCP Client Integration Examples
Once configured, you can use the Azure DevOps tools in your MCP client:
Get Work Items
{
"name": "get_workitems",
"arguments": {
"query": "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.TeamProject] = @project",
"limit": 10
}
}
Get Repositories
{
"name": "get_repositories",
"arguments": {}
}
Create Work Item
{
"name": "create_workitem",
"arguments": {
"work_item_type": "Bug",
"title": "New bug report",
"description": "Description of the bug",
"assigned_to": "user@example.com"
}
}
Troubleshooting
Common Issues
- Authentication Error: Verify your Personal Access Token is correct and has the required scopes
- Organization/Project Not Found: Check that your organization and project names are spelled correctly
- Permission Denied: Ensure your PAT has the necessary permissions for the operations you're trying to perform
Debug Mode
To enable debug logging, modify the logging level in main.py:
logging.basicConfig(level=logging.DEBUG)
Security Notes
- Never commit your
.envfile or Personal Access Token to version control - Use environment variables or secure configuration management in production
- Regularly rotate your Personal Access Tokens
- Use the principle of least privilege when setting token scopes
Support
For issues or questions:
- Check the Azure DevOps API documentation
- Verify your token permissions
- Test your connection using the Azure DevOps REST API directly
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。