MCP server for Azure DevOps provides a framework to manage and interact with Azure DevOps projects using the Model Context Protocol. This tool helps in abstracting and simplifying complex Azure DevOps operations through a standardized interface.
You can install the Azure DevOps MCP server using npm:
npm install azure-devops-mcp-server
Alternatively, you can clone the repository and install it locally:
git clone https://github.com/username/azure-devops-mcp-server.git
cd azure-devops-mcp-server
npm install
Before using the MCP server, you need to configure your Azure DevOps credentials:
{
"organization": "your-azure-devops-org",
"project": "your-project-name",
"personalAccessToken": "your-pat-token"
}
config.json
in your project root or specify a custom path when initializing the server.To start the MCP server:
const MCPServer = require('azure-devops-mcp-server');
const server = new MCPServer({
configPath: './config.json',
port: 3000 // Optional, defaults to 3000
});
server.start()
.then(() => console.log('MCP Server started successfully'))
.catch(err => console.error('Failed to start MCP Server:', err));
The MCP server exposes several endpoints:
# Get project information
curl -X GET http://localhost:3000/api/projects/current
# List work items
curl -X GET http://localhost:3000/api/workitems?type=Bug&status=Active
# Create a new work item
curl -X POST http://localhost:3000/api/workitems \
-H "Content-Type: application/json" \
-d '{"type": "User Story", "title": "Implement login feature", "description": "Users should be able to login with their credentials"}'
For more complex interactions, you can use the included client library:
const { MCPClient } = require('azure-devops-mcp-server');
const client = new MCPClient({
serverUrl: 'http://localhost:3000'
});
// Get all bugs
client.getWorkItems({ type: 'Bug' })
.then(bugs => console.log('Found bugs:', bugs))
.catch(err => console.error('Error fetching bugs:', err));
// Create a new work item
client.createWorkItem({
type: 'Task',
title: 'Update documentation',
assignedTo: '[email protected]',
storyPoints: 3
})
.then(newItem => console.log('Created task:', newItem.id))
.catch(err => console.error('Error creating task:', err));
You can extend the MCP server functionality with plugins:
const customPlugin = {
name: 'custom-reports',
initialize: (server) => {
server.registerEndpoint('GET', '/api/reports/burndown', (req, res) => {
// Custom implementation
res.json({ data: 'Your burndown report data' });
});
}
};
const server = new MCPServer({
configPath: './config.json',
plugins: [customPlugin]
});
Instead of using a config file, you can use environment variables:
export AZURE_DEVOPS_ORG=your-organization
export AZURE_DEVOPS_PROJECT=your-project
export AZURE_DEVOPS_TOKEN=your-pat-token
Then initialize the server without a config path:
const server = new MCPServer({
useEnvironmentVars: true
});
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "azure-devops" '{"command":"npx","args":["-y","azure-devops-mcp-server"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"azure-devops": {
"command": "npx",
"args": [
"-y",
"azure-devops-mcp-server"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"azure-devops": {
"command": "npx",
"args": [
"-y",
"azure-devops-mcp-server"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect