Skip to content

saktheeswar/Azure_Devops_MCP_Server

Repository files navigation

πŸš€ Azure DevOps MCP Server

A custom Model Context Protocol (MCP) server built with NestJS, enabling AI agents (like Claude Desktop) to securely query Azure DevOps data such as work items, projects, and ticket statistics.


πŸ“Œ Overview

This project exposes Azure DevOps data through a standards-based MCP server, allowing any MCP-compatible AI agent to perform real-time queries such as:

  • πŸ” List all projects in the organization
  • πŸ“ Get count of created / active / closed work items
  • 🧩 Fetch ticket details
  • πŸ“Š Query backlog items or sprints
  • πŸ—οΈ Extend Azure DevOps automation through AI

It supports two modes:

1️⃣ STDIO MCP Server

Tested locally using the MCP Inspector (not using a direct Claude Desktop STDIO client).

2️⃣ HTTP MCP Server

Allows remote access using MCP-over-HTTP.


πŸ—οΈ Architecture

NestJS Application
β”‚
β”œβ”€β”€ MCP Module
β”‚   β”œβ”€β”€ Tool Definitions
β”‚   β”œβ”€β”€ STDIO Transport
β”‚   └── HTTP Transport
β”‚
β”œβ”€β”€ Azure DevOps Service
β”‚   └── Work Item API
β”‚   └── Project API
β”‚
└── Utilities
    β”œβ”€β”€ MCP Message Handlers
    └── Logger

✨ Features

βœ”οΈ Custom Tools for Azure DevOps

Tools exposed to MCP clients:

Tool Name Description
list_projects Returns all Azure DevOps projects
count_tickets Returns summary of created/active/resolved tickets
get_workitem Fetch details of a single work item
search_workitems Query work items based on filters

βœ”οΈ STDIO Transport (MCP Inspector)

This project was tested locally using the MCP Inspector, which acts as an MCP client that connects over STDIO to your server.

Run the server so the inspector can connect over STDIO:

node dist/main.js

Start the inspector with:

npx @modelcontextprotocol/inspector

When prompted in the inspector, choose the STDIO connection and point it at the running process (the inspector will spawn or attach to the process as configured).


βœ”οΈ HTTP MCP Support

Start server:

npm run start:prod

You can POST MCP-style requests:

POST http://localhost:3000/mcp

πŸ”§ Installation

git clone https://github.com/saktheeswar/Azure_Devops_MCP_Server.git
cd azure-devops-mcp
npm install
npm run build

πŸ”‘ Environment Variables

Create .env:

BASE_URL=url
AUSER_NAME=your-personal-access-token
ADO_PAT=your-default-project

▢️ Running the Server

Run in STDIO mode (for MCP Inspector)

node dist/main.js

Run in HTTP mode

npm run start:prod

πŸ§ͺ Testing with MCP Inspector

(You will explain this with screenshots in your blog.)

npx @modelcontextprotocol/inspector

Then connect using STDIO:

node dist/main.js

πŸ’» Code Walkthrough

πŸ“ MCP Server Setup

const server = new Server({
  name: "azure-devops-mcp",
  version: "1.0.0",
  tools: {
    list_projects: { ... },
    count_tickets: { ... }
  }
});

πŸ“ Azure DevOps API Integration

async getProjects() {
  const url = `${this.baseUrl}/projects?api-version=7.0`;
  return this.http.get(url, this.headers);
}

πŸ“ STDIO Bootstrap

bootstrapStdio(server);

πŸ“ HTTP Controller

@Post('/mcp')
handleMcp(@Body() body) {
  return this.mcpHttpService.process(body);
}

πŸ“š Example MCP Tool Call

{
  "method": "tools/list_projects",
  "params": {}
}

Response:

{
  "projects": [
    { "name": "Frontend" },
    { "name": "Backend" },
    { "name": "Infrastructure" }
  ]
}

🧩 Use Cases

For Developers

  • Query Azure DevOps without opening the UI
  • Get ticket summaries instantly
  • Automate repetitive DevOps activities

For AI Assistants

  • Smart sprint planning
  • Ticket prioritization
  • Automated status reporting

For Teams

  • Faster decision making
  • AI-powered insights

πŸ”₯ Future Enhancements

  • Create/Update work items using AI
  • Integration with Release Pipelines
  • Sprint burndown insights
  • PR and Repository analytics

πŸ“Ž Screenshots (Add your own)

  • Claude Desktop working
  • MCP Inspector connected
  • Tool response logs

πŸ§‘β€πŸ’» Author

Saktheeswaran M AI Engineer & Full-Stack Developer

πŸ”— Source Code

πŸ‘‰ GitHub Repository: (https://github.com/saktheeswar/Azure_Devops_MCP_Server)

About

Custom MCP Server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published