A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/wangkanai/devops-mcp below:

wangkanai/devops-mcp: Dynamic Azure DevOps MCP Server with directory-based authentication switching for RiverSync and Mula projects

A dynamic Azure DevOps MCP (Model Context Protocol) server that automatically switches authentication context based on the current working directory. This enables seamless integration with multiple Azure DevOps organizations and projects from a single MCP server.

Each repository should contain a .azure-devops.json configuration file:

Configuration File Structure
{
  "organizationUrl": "https://dev.azure.com/your-org",
  "project": "YourProject",
  "pat": "your-pat-token-here",
  "description": "Azure DevOps configuration for this repository",
  "settings": {
    "timeout": 30000,
    "retries": 3,
    "apiVersion": "7.1"
  },
  "tools": {
    "workItems": true,
    "repositories": true,
    "builds": true,
    "pullRequests": true,
    "pipelines": true
  },
  "meta": {
    "configVersion": "1.0",
    "lastUpdated": "2025-07-21",
    "createdBy": "devops-mcp"
  }
}

Important: Add .azure-devops.json to your .gitignore file:

# Azure DevOps MCP local configuration (contains PAT tokens)
.azure-devops.json
Claude Code Installation (Recommended)
# Install and add to Claude Code MCP
claude mcp add devops-mcp -- -y @wangkanai/devops-mcp

Note: The -y flag automatically accepts the package installation prompt, ensuring smooth non-interactive execution for MCP servers.

Claude Desktop Installation

For Claude Desktop users, add this configuration to your MCP settings:

{
  "mcpServers": {
    "devops-mcp": {
      "command": "npx",
      "args": ["-y", "@wangkanai/devops-mcp"]
    }
  }
}

Claude Desktop MCP Settings Location:

Alternative Installation Methods
# Install globally
npm install -g @wangkanai/devops-mcp

# Add to Claude Code MCP
claude mcp add devops-mcp -- devops-mcp
# Clone repository
git clone https://github.com/wangkanai/devops-mcp.git
cd devops-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start
# Development mode with auto-reload
npm run dev

# Type checking
npm run type-check

# Clean build artifacts
npm run clean

📋 For comprehensive command documentation with detailed examples, see MCP-COMMANDS.md

Repositories & Pull Requests
{
  "name": "get-current-context",
  "arguments": {
    "directory": "/Users/wangkanai/Sources/riversync"
  }
}
{
  "name": "get-work-items",
  "arguments": {
    "wiql": "SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.State] = 'Active'"
  }
}
{
  "name": "create-work-item",
  "arguments": {
    "type": "Task",
    "title": "Implement new feature",
    "description": "Add authentication system",
    "assignedTo": "user@example.com"
  }
}
{
  "name": "get-repositories",
  "arguments": {
    "includeLinks": true
  }
}
Directory Detection Logic

The server uses intelligent directory detection:

  1. Exact Match: Direct match of configured directory paths
  2. Nested Directory Support: Detects parent project directories
  3. Longest Match Priority: Most specific directory match takes precedence
  4. Parent Directory Search: Searches up the directory tree for matches
  5. Fallback Configuration: Uses default configuration when no match found

Each repository should contain a .azure-devops.json configuration file:

Configuration File Structure
{
  "organizationUrl": "https://dev.azure.com/your-org",
  "project": "YourProject",
  "pat": "your-pat-token-here",
  "description": "Azure DevOps configuration for this repository",
  "settings": {
    "timeout": 30000,
    "retries": 3,
    "apiVersion": "7.1"
  },
  "tools": {
    "workItems": true,
    "repositories": true,
    "builds": true,
    "pullRequests": true,
    "pipelines": true
  },
  "meta": {
    "configVersion": "1.0",
    "lastUpdated": "2025-07-21",
    "createdBy": "devops-mcp"
  }
}

Important: Add .azure-devops.json to your .gitignore file:

# Azure DevOps MCP local configuration (contains PAT tokens)
.azure-devops.json

The server uses Personal Access Tokens (PAT) for Azure DevOps authentication. PAT tokens are configured per project in local .azure-devops.json configuration files within each repository.

PAT tokens should have the following scopes:

The server includes comprehensive error handling:

Enhanced Validation System (Recommended)

The enhanced validation system includes MCP server startup, connection verification, and readiness checks:

# Prepare MCP servers for validation
./warmup-mcp.sh

# Use custom configuration file
./warmup-mcp.sh custom-config.json
2. Enhanced Comprehensive Validation
# Full validation with MCP server initialization
./validate-enhanced.sh

# Skip interactive Claude tests (faster)
./validate-enhanced.sh --skip-interactive

# Extended warmup for slow systems
./validate-enhanced.sh --warmup 20

# Test only specific repositories
./validate-enhanced.sh --repos "RiverSync,Mula"

# Use custom configuration file
./validate-enhanced.sh --config custom-config.json

# Show all options
./validate-enhanced.sh --help
# Build and test the server manually
npm run build
node test-server.js

The generic validation system uses validation-config.json:

{
  "proxyPath": "/Users/wangkanai/Sources/devops-mcp",
  "repositories": [
    {
      "name": "RiverSync",
      "path": "/Users/wangkanai/Sources/riversync",
      "expectedOrganization": "riversync",
      "organizationUrl": "https://dev.azure.com/riversync",
      "project": "RiverSync",
      "enabled": true
    }
  ],
  "testSettings": {
    "timeoutSeconds": 30,
    "skipInteractive": false,
    "mcpServerName": "devops-mcp",
    "configFileName": ".azure-devops.json"
  },
  "expectedTools": ["workItems", "repositories", "builds", "pullRequests", "pipelines"]
}
Enhanced Validation Features

The enhanced validation system includes:

🔍 Comprehensive Testing Coverage

Full Validation Results:

Legacy Environment Configuration (Deprecated)

The server previously supported a global config/environments.json file for environment mapping. This approach has been deprecated in favor of local .azure-devops.json configuration files for better security and project isolation.

If you need to migrate from the old environment-based configuration, convert your settings to local configuration files in each repository.

  1. Tool Call Received: MCP client sends tool call request
  2. Context Detection: Directory detector identifies current project context
  3. Configuration Switch: Server switches to appropriate Azure DevOps configuration
  4. API Request: Tool handler makes authenticated API request to Azure DevOps
  5. Response Processing: Response is formatted and returned to MCP client
Integration with Claude Code

This MCP server is designed to work seamlessly with Claude Code for Azure DevOps operations:

  1. Automatic Context Switching: When working in RiverSync or Mula project directories
  2. Transparent Authentication: No manual configuration required
  3. Rich Tool Set: Comprehensive Azure DevOps functionality
  4. Error Recovery: Graceful handling of authentication and network issues
1. Installation Command Issues (Issue #14 Resolution)

Problem: Incorrect installation commands that fail to start the server

Root Cause: Outdated documentation showing incorrect command syntax

Solution: Use the correct installation command:

# ✅ Correct (RECOMMENDED)
claude mcp add devops-mcp -- -y @wangkanai/devops-mcp

# ❌ Incorrect (will fail)

Alternative working commands:

# Global installation method
npm install -g @wangkanai/devops-mcp
claude mcp add devops-mcp -- devops-mcp
  1. Configuration Not Found: Ensure .azure-devops.json exists in your project directory
  2. Authentication Errors: Verify PAT token permissions and expiration in your local configuration
  3. Directory Detection: Check that your project has a valid .azure-devops.json file
  4. API Errors: Verify Azure DevOps organization and project names in your local configuration
3. Installation Verification

Test your installation with these commands:

# Test server startup (build and run directly)
npm run build && node dist/index.js

# Verify MCP integration
mcp__devops-mcp__get-current-context

# Test work item creation
mcp__devops-mcp__create-work-item --type "Task" --title "Test Item"

Enable debug logging by setting environment variable:

export DEBUG=devops-mcp
npm start
NPM Package Technical Details

MIT License - see LICENSE file for details.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4