How to Manage Multiple Azure DevOps Boards with AI Agents in VS Code
Turn your IDE into a command center for multiple projects using Docker, MCP, and VS Code Profiles.
If you are a DevOps engineer or developer juggling multiple projects, you know the pain of context switching. You're coding in one repo, but you need to check a ticket in a different Azure DevOps project.
The Model Context Protocol (MCP) has changed the game. It allows AI agents (like GitHub Copilot or Cline) to read and edit your Azure Boards directly. But what if you have multipleboards?
In this guide, I’ll show you a clean, containerized way to connect your AI agent to specific Azure Boards using Docker and VS Code Profiles.
Turn your IDE into a command center for multiple projects using Docker, MCP, and VS Code Profiles.
If you are a DevOps engineer or developer juggling multiple projects, you know the pain of context switching. You're coding in one repo, but you need to check a ticket in a different Azure DevOps project.
The Model Context Protocol (MCP) has changed the game. It allows AI agents (like GitHub Copilot or Cline) to read and edit your Azure Boards directly. But what if you have multipleboards?
In this guide, I’ll show you a clean, containerized way to connect your AI agent to specific Azure Boards using Docker and VS Code Profiles.
Why This Architecture?
We are using VS Code Profiles to solve the "Tool Collision" problem.
The Problem: If you connect one AI agent to 5 different boards, it gets confused. It might try to find a "Data Pipeline" bug in your "Frontend" board.
The Solution: We create a dedicated "Persona" (Profile) for each project. When you switch profiles, VS Code automatically swaps the AI's "brain" to focus only on that project's board.
Security: We use Docker to run the MCP server. This keeps your host machine clean and ensures no dependencies conflict.
Part 1: Prepare the Docker Image
First, we need a container that knows how to talk to Azure DevOps. We will build a simple image wrapping the standard azuredevops-mcp-server.
Create a folder named
ado-mcp-dockerand add aDockerfile:text# Dockerfile FROM node:18-alpine # Install the server globally RUN npm install -g @ryancardin/azuredevops-mcp-server # Set the entrypoint ENTRYPOINT ["azuredevops-mcp-server"]Build the image:
bashdocker build -t local/ado-mcp-server .
Part 2: Set Up VS Code Profiles
Now we will create a dedicated environment for your first project (e.g., "Frontend Shop").
Open Profiles: Click the Gear Icon (bottom left) > Profiles > Create Profile...
Name It:
ADO-Frontend(or your project name).Customize: You can give it a specific icon or color (e.g., Blue for Frontend) to visually distinguish it.
Repeat this step for your second project (e.g., ADO-DataEngineers), giving it a different name and color.
Part 3: Configure the MCP Server
This is where the magic happens. We will tell the specific profile to run our Docker container with specific project credentials.
Switch to your new profile (
ADO-Frontend).Open the Command Palette (
Ctrl+Shift+P) and type:MCP: Open User Configuration
(This opens themcp.jsonfile unique to THIS profile).Paste the following configuration:
json{ "mcpServers": { "azure-board": { "command": "docker", "args": [ "run", "-i", // Interactive mode is REQUIRED "--rm", // Delete container after use "-e", "AZURE_DEVOPS_ORG_URL=https://dev.azure.com/YourOrg", "-e", "AZURE_DEVOPS_PROJECT=ShopFrontend", // <--- PROJECT A "-e", "AZURE_DEVOPS_AUTH_TYPE=pat", "-e", "AZURE_DEVOPS_PERSONAL_ACCESS_TOKEN=YOUR_PAT_TOKEN", "local/ado-mcp-server" ] } } }
Repeat for Profile B: Switch to your second profile (
ADO-DataEngineers), open itsmcp.json, and change theAZURE_DEVOPS_PROJECTvariable toDataCore(or your second project's name).
Part 4: Testing Your AI Agent
Now, let's see it in action.
Open your AI Chat (Copilot, Cline, or similar).
Type: "What are the active bugs in this sprint?"
Watch:
The agent will spin up the Docker container.
It will query only the board defined in your current profile.
It will return the tickets for that specific project.
Switch Profiles: Change to your other profile, ask the same question, and you will get completely different tickets from the other board.
Troubleshooting Tips
"Connection Refused": If using Docker on Windows/Mac, ensure the Docker Desktop app is running.
"Authentication Failed": Double-check that your Personal Access Token (PAT) has Work Items (Read & Write) permissions.
Slow Response: The first request might take 2-3 seconds as the container starts. Subsequent requests will be faster if the session stays open.
Avoid hardcoding your PAT in the JSON file. Instead, pass it as an environment variable from your host system:
Change the args line to:"-e", "AZURE_DEVOPS_PERSONAL_ACCESS_TOKEN=${env:MY_ADO_PAT}"
And set MY_ADO_PAT in your system's environment variables.
No comments:
Post a Comment