Skip to main content
Glama
Wootz

Azure DevOps On-Prem MCP Server

by Wootz

Azure DevOps On-Premises MCP Server

npm version

A Model Context Protocol (MCP) server for Azure DevOps Server 2022 (on-premises deployment). It enables AI assistants to interact with your on-premises Azure DevOps Server through 30 tools.

Configuration

Add the following to your MCP-compatible client configuration file:

{
  "mcpServers": {
    "azure-devops-onprem": {
      "command": "npx",
      "args": ["-y", "@wootz/ado-onprem-mcp"],
      "env": {
        "ADO_SERVER_URL": "https://tfs.company.com/DefaultCollection",
        "ADO_PAT_TOKEN": "your-pat-token-here",
        "ADO_PROJECT": "MyProject", // 可選,設定後所有工具預設操作此專案
        "NODE_TLS_REJECT_UNAUTHORIZED": "0" // 使用自簽憑證
      }
    }
  }
}

Environment variable descriptions:

  • ADO_SERVER_URL: Required, the full collection path (e.g.: https://tfs.company.com/DefaultCollection)

  • ADO_PAT_TOKEN: Required, personal access token

  • ADO_PROJECT: Optional, default project name. When set, all tools automatically use this project when the project parameter is not specified; explicitly passing the same project name works normally, while passing a different project will be blocked. If a WIQL query does not include the [System.TeamProject] condition, this condition is automatically injected to prevent cross-project data retrieval

  • NODE_TLS_REJECT_UNAUTHORIZED: Required, set to "0" to support self-signed certificates (common in on-premises deployment environments)

⚠️ Security note: NODE_TLS_REJECT_UNAUTHORIZED=0 bypasses SSL certificate validation and is only suitable for on-premises deployment environments on internal networks. Do not use it in public network environments.

Generating a Personal Access Token (PAT)

  1. Go to your Azure DevOps Server: https://your-server/DefaultCollection

  2. Click the profile icon in the top-right corner → Security → Personal Access Tokens

  3. Create a new token and set the following scopes:

    • Code: Read & Write (for Pull Request and Git operations)

    • Work Items: Read & Write (for work item operations)

    • Project and Team: Read (for project and Sprint information)

    • Build: Read & Execute (for Build/Pipeline operations)

Related MCP server: Azure DevOps MCP Server

System Requirements

  • Node.js >= 20.0.0

  • Azure DevOps Server 2022 (on-premises version)

  • A valid Personal Access Token (PAT)

Available Tools

Core (1 tool)

  • mcp_ado_core_list_projects - List all projects

Work Items (11 tools)

  • mcp_ado_work_items_get - Get work item details

  • mcp_ado_work_items_create - Create a new work item

  • mcp_ado_work_items_update - Update a work item

  • mcp_ado_work_items_delete - Delete a work item

  • mcp_ado_work_items_query_by_wiql - Query work items (WIQL)

  • mcp_ado_work_items_add_comment - Add a comment

  • mcp_ado_work_items_get_comments - Get comments

  • mcp_ado_work_items_add_link - Add a work item link

  • mcp_ado_work_items_get_updates - Get revision history

  • mcp_ado_work_items_batch_get - Batch get work items

  • mcp_ado_work_items_batch_create - Batch create work items (supports parent-child hierarchy in the same batch)

Repositories (10 tools)

Pull Requests

  • mcp_ado_repos_list_pull_requests - List Pull Requests

  • mcp_ado_repos_get_pull_request - Get PR details

  • mcp_ado_repos_create_pull_request - Create a Pull Request

  • mcp_ado_repos_update_pull_request - Update a Pull Request (status, title)

  • mcp_ado_repos_get_pr_threads - Get PR review discussions

  • mcp_ado_repos_create_pr_thread - Add a review comment on a PR

Git

  • mcp_ado_repos_list_repositories - List all Repositories under a project

  • mcp_ado_repos_list_branches - List all Branches of a Repository

  • mcp_ado_repos_get_item - Get file content (supports specifying a Branch)

  • mcp_ado_repos_get_commits - Get Commit history (filterable by Branch / Path / Author)

Builds (5 tools)

  • mcp_ado_builds_list_definitions - List Build Definitions (Pipeline list)

  • mcp_ado_builds_list - List Builds (supports status / result / Branch filtering)

  • mcp_ado_builds_get - Get details of a specific Build

  • mcp_ado_builds_queue - Trigger (Queue) a new Build

  • mcp_ado_builds_get_logs - Get the Build Log list or the content of a specific Log

Work / Sprint (3 tools)

  • mcp_ado_work_list_iterations - List Sprints / Iterations (supports past / current / future filtering)

  • mcp_ado_work_get_iteration_work_items - Get all work items within a specified Sprint

  • mcp_ado_work_list_backlogs - List Backlog levels (Epics / Features / Stories)

Total: 30 tools

For the complete tool definitions and parameter descriptions, refer to the src/tools/ directory in the source code.

Usage Examples

You can interact with the AI assistant using natural language to perform various Azure DevOps operations:

Viewing Projects and Work Items

  • "List all projects"

  • "Show work item #1234"

  • "Query work items assigned to me in MyProject"

  • "List all bugs with status In Progress"

  • "Show work items modified in the last 7 days"

Creating and Updating Work Items

  • "Create a bug in MyProject titled 'Login page error'"

  • "Create a User Story titled 'Add logout feature' assigned to john@company.com"

  • "Update work item #5678, change the status to Done"

  • "Set the priority of work item #1234 to 1"

  • "Add a comment to work item #1234: Issue confirmed reproduced"

  • "Create a Task titled 'Add unit tests' with parent #5787"

  • "Create a Feature and 3 Tasks under it in one go"

  • "Link work item #100 to #200 with type Related"

  • "Attach work item #6320 under #5787"

  • "Show all comments on work item #1234"

  • "View the revision history of work item #5678"

  • "List all linked items of work item #999"

Repository and Git Operations

  • "List all repositories under MyProject"

  • "List all branches of MainRepo"

  • "Get the file content of src/app.ts on the main branch"

  • "Show the last 10 commits of MainRepo"

  • "List all active pull requests in MainRepo"

  • "Show details of pull request #123"

  • "Create a PR from feature/new-api to develop titled 'Add API endpoint'"

  • "Update PR #789, change the status to Completed"

  • "Get all review discussions of PR #456"

  • "Add a review comment on PR #123: Suggest using async/await instead"

Build / Pipeline Operations

  • "List all pipeline definitions of MyProject"

  • "Show the most recent failed build in MyProject"

  • "Get details of build #456"

  • "Trigger the build with definition ID 12 using the main branch"

  • "Show the log list of build #789"

Complete Workflow Examples

You can chain multiple operations to complete full workflows:

Report and Fix a Bug:

  1. "Create a bug in MyProject titled 'Login page fails to load'"

  2. "Assign this bug to developer@company.com"

  3. "Add a comment: Occurs in Chrome browser, works fine in Firefox"

  4. "Create a pull request from bugfix/login to main to fix this issue"

  5. "Add a description on the PR: Fixed the CSS loading order issue"

Track Feature Development:

  1. "Create a User Story: Implement user profile page"

  2. "Create a Task: Design the profile UI, linked to the User Story above"

  3. "Create another Task: Implement the profile API, also linked to the same User Story"

  4. "When done, update the status of all related work items to Done"

View Current Sprint Status:

  1. "List all work items in the current sprint of MyProject"

  2. "Show tasks that are not yet completed"

  3. "Show the iteration ID of the next sprint"

Development

Building the Project

pnpm install
pnpm run build

Watch Mode

pnpm run watch

Running Tests

pnpm test

Running the Linter

pnpm run lint

Project Structure

src/
├── index.ts             # CLI 入口點
├── auth.ts              # PAT 認證
├── server.ts            # MCP 伺服器設定
├── tools.ts             # 工具註冊
├── tools/
│   ├── core.ts          # 專案管理 (1 個工具)
│   ├── work-items.ts    # 工作項目 (11 個工具)
│   ├── repositories.ts  # Git 與 Pull Requests (10 個工具)
│   ├── builds.ts        # Build / Pipeline (5 個工具)
│   └── work.ts          # Sprint / Backlog (3 個工具)
├── utils.ts             # 回應輔助函式
├── logger.ts            # Winston 日誌
└── version.ts           # 版本資訊

Key Features

  • On-premises specific: Designed specifically for Azure DevOps Server 2022

  • Collection-style URL: Supports the https://{server}/{collection} format

  • PAT authentication: Uses only a personal access token, no Azure CLI required

  • Lightweight: Minimal dependencies, clean architecture

  • Full feature coverage: Covers work items, Pull Requests, Git, Build Pipelines, and Sprint planning

  • Hierarchy and batching: Supports parent-child relationships, can create an entire work item tree at once

  • Concise responses: Automatically trims verbose identity objects; use fields to specify the desired columns

License

MIT License

Related MCP Connectors

Related MCP Servers