ameitg/az-devops-mcp-server
If you are the rightful owner of az-devops-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Azure DevOps MCP Server is a Model Context Protocol server that integrates with Azure DevOps services using Server-Sent Events (SSE) transport, enabling AI assistants to manage projects, builds, repositories, and work items.
Azure DevOps MCP Server
A Model Context Protocol (MCP) server that provides integration with Azure DevOps services using stdio transport. This server allows AI assistants to interact with Azure DevOps organizations to manage projects, builds, repositories, and work items.
š Features
- Azure DevOps Integration: Full access to Azure DevOps APIs
- MCP Protocol: Implements Model Context Protocol for Cursor integration
- Stdio Transport: Standard input/output transport for local Cursor integration
- Project Management: List and explore Azure DevOps projects
- Build Management: View build definitions and build details
- Repository Management: List Git repositories and get repository information
- Work Item Management: Query, view, and create work items using WIQL
- Secure Authentication: Uses Personal Access Tokens for secure API access
- Environment Configuration: Simple configuration via environment variables
š Prerequisites
- Node.js 16 or higher
- Azure DevOps organization with a Personal Access Token
- Cursor IDE (for MCP integration)
- TypeScript (for development)
š ļø Installation & Setup
- Clone the repository:
git clone <repository-url>
cd az-devops-mcp-server
- Install dependencies:
npm install
- Build the project:
npm run build
-
Configure Azure DevOps credentials:
Option A: Environment Variables (Recommended) Create a
.env
file in your project root:AZURE_DEVOPS_ORG_URL=https://dev.azure.com/yourorgname AZURE_DEVOPS_PAT=your-personal-access-token AZURE_DEVOPS_PROJECT=your-project-name (optional)
Option B: Cursor MCP Configuration Update
.cursor/mcp.json
with your credentials (see Configuration section below)
š§ Configuration
Azure DevOps Personal Access Token
- Go to your Azure DevOps organization
- Click on your profile picture ā Personal Access Tokens
- Click "New Token"
- Set the appropriate scopes (typically "Full Access" for development)
- Copy the generated token
Cursor MCP Configuration
Create or update .cursor/mcp.json
in your project:
{
"mcpServers": {
"azure-devops": {
"transport": "stdio",
"command": "node",
"args": ["dist/index.js"],
"env": {
"AZURE_DEVOPS_ORG_URL": "https://dev.azure.com/YOUR_ORG_NAME",
"AZURE_DEVOPS_PAT": "YOUR_PERSONAL_ACCESS_TOKEN",
"AZURE_DEVOPS_PROJECT": "YOUR_PROJECT_NAME"
}
}
}
}
š Usage
Starting the Server
Direct Mode (if you have .env file)
# Build and start
npm run build
npm start
Development Mode
npm run dev
Using in Cursor
Once the server is built and configured:
- Restart Cursor to load the MCP configuration
- Ask Cursor directly to use your Azure DevOps tools:
- "List all work items in eazypetition"
- "Create a new task for user authentication"
- "Show me the status of the petitioner dashboard task"
- "List all projects in my Azure DevOps organization"
Available Tools
The MCP server provides the following tools:
1. list_projects
List all projects in the Azure DevOps organization.
Parameters: None
2. list_work_items
List work items using a WIQL query.
Parameters:
project
: Project name or IDquery
: WIQL query string (optional)
3. create_work_item
Create a new work item.
Parameters:
project
: Project name or IDtype
: Work item type (e.g., Bug, Task, User Story)title
: Work item titledescription
: Work item description (optional)
4. list_builds
List builds for a specific project.
Parameters:
project
: Project name or ID
5. list_repositories
List Git repositories for a specific project.
Parameters:
project
: Project name or ID
š Example Usage
Using in Cursor (Recommended)
Simply ask Cursor to perform Azure DevOps operations:
- "List all work items in eazypetition"
- "Create a new task called 'user authentication'"
- "Show me the status of the petitioner dashboard task"
- "List all projects in my Azure DevOps organization"
- "Create a bug report for the login issue"
Direct Tool Calls (Advanced)
If you need to call tools directly:
-
List Projects:
list_projects()
-
List Work Items:
list_work_items(project: "eazypetition")
-
Create a Work Item:
create_work_item(project: "eazypetition", type: "Task", title: "New Task", description: "Task description")
WIQL Query Examples
-
All active bugs:
SELECT [System.Id] FROM WorkItems WHERE [System.WorkItemType] = 'Bug' AND [System.State] <> 'Closed'
-
My assigned work items:
SELECT [System.Id] FROM WorkItems WHERE [System.AssignedTo] = @me
-
Work items in current sprint:
SELECT [System.Id] FROM WorkItems WHERE [System.IterationPath] = 'MyProject\Sprint 1'
š ļø Development
Project Structure
az-devops-mcp-server/
āāā .cursor/
ā āāā mcp.json # Cursor MCP configuration
āāā src/
ā āāā index.ts # Main entry point
ā āāā server.ts # Azure DevOps MCP server implementation
āāā dist/ # Compiled JavaScript output
āāā package.json # Project dependencies and scripts
āāā tsconfig.json # TypeScript configuration
āāā .env # Environment variables (create from config.env.example)
āāā config.env.example # Example environment configuration
Building
npm run build
Development Mode
npm run dev
Clean Build
npm run clean
npm run build
Available Scripts
npm start # Start the compiled server
npm run dev # Development mode with hot reload
npm run build # Build the project
npm run clean # Clean build artifacts
š Troubleshooting
Common Issues
-
Authentication Failed:
- Verify your Personal Access Token is valid
- Check that the token has the necessary permissions
- Ensure the organization URL is correct
-
Project Not Found:
- Verify the project name/ID is correct
- Ensure you have access to the project
-
Build API Errors:
- Check that the project has build definitions
- Verify build permissions
-
Server Won't Start:
- Verify all dependencies are installed
- Check Node.js version (16+ required)
- Ensure environment variables are set correctly
-
Cursor Can't Connect:
- Verify MCP configuration syntax
- Ensure Cursor is restarted after configuration
- Check that the server command path is correct
Debug Mode
For debugging, you can run the server with additional logging:
DEBUG=* npm run dev
Testing the Connection
To verify your MCP server is working correctly:
-
Build the project:
npm run build
-
Start the server:
npm start
-
In Cursor, ask:
- "List all work items in eazypetition"
- "Show me my Azure DevOps projects"
š Security Considerations
- Never commit Personal Access Tokens to version control
- Use environment variables for sensitive configuration
- Regularly rotate your Personal Access Tokens
- Grant minimal necessary permissions to tokens
- The server runs locally and communicates via stdio
š¤ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
š License
MIT License - see LICENSE file for details.
š Support
For issues and questions:
- Check the troubleshooting section
- Review Azure DevOps API documentation
- Open an issue in the repository