Azure DevOps MCP Server with Directory-Based Authentication
Manage Azure DevOps with an MCP server that supports directory-based auth switching, work items, repositories, builds, pipelines and multi-project local conf...
npx -y @wangkanai/devops-mcpOverview
This MCP (Model Context Protocol) server provides a lightweight HTTP gateway to manage Azure DevOps artifacts using a consistent, directory-aware API. It centralizes common operations — work items, repositories, builds and pipelines — and adds a simple way to switch authentication contexts by directory (organization/team project). That makes local development and multi-project automation easier when you work across multiple Azure DevOps organizations or projects.
The server is intended for developers and automation scripts that need programmatic access to DevOps resources without embedding organization-specific logic in every consumer. You configure directory mappings and credentials locally, then call the MCP endpoints to operate on the appropriate Azure DevOps context. This enables local multi-project configuration, quick environment switching, and simplified integration with tools like scripts, dashboards or CI helpers.
Features
- Directory-based authentication switching (map an incoming request to an Azure DevOps organization and token)
- CRUD-style endpoints for work items, repositories, builds and pipelines
- Multi-project local configuration for per-project tokens and defaults
- Lightweight HTTP API compatible with MCP client patterns
- Designed for local development, automation scripts, and integration adapters
- Simple JSON-based configuration files for credentials and project mappings
Installation / Configuration
Prerequisites:
- .NET 6+ SDK (if the server is a .NET project)
- An Azure DevOps Personal Access Token (PAT) per organization or service principal with appropriate permissions
Quick start:
- Clone the repository:
- Run the server (typical .NET commands — path may vary depending on project layout):
- Create a local multi-project configuration file (example: mcp.local.json) and place it next to the running server or in a configured config directory.
Example mcp.local.json:
Environment-based configuration (appsettings.json snippet):
Security note: store PATs securely (use OS secret stores or CI/CD secrets for production). The local config pattern is intended for developer machines; do not commit secrets to source control.
Available Resources
The server exposes a small set of HTTP endpoints (paths and parameters may vary; consult the repository README for exact routes). Typical endpoints include:
| Resource | Example Endpoint | Description |
|---|---|---|
| Work items | GET /mcp/{dir}/workitems | List or query work items within the directory/project |
| Repositories | GET /mcp/{dir}/repos | List repositories in the mapped organization/project |
| Builds | GET /mcp/{dir}/builds | Retrieve build definitions and recent runs |
| Pipelines | POST /mcp/{dir}/pipelines/{id}/run | Queue a pipeline run |
Sample curl — list repositories from the “acme-corp” directory:
Sample curl — queue a pipeline run:
If the server supports directory selection via header instead of path, use:
Use Cases
- Multi-organization development: Switch quickly between Azure DevOps organizations without changing client code — map directories to organization + PAT in mcp.local.json and call the same endpoint path for different contexts.
- Local automation scripts: Write scripts that operate on work items, repos or pipelines for multiple projects. Use the directory parameter to avoid embedding tokens or org names in the script.
- Troubleshooting CI/CD: Trigger builds or replay pipeline runs against different projects while preserving a consistent API surface for tooling and dashboards.
- Migration and bulk operations: Iterate over repositories and work items across projects to perform bulk changes (rename, move, update policies) using a single gateway that handles authentication per-directory.
Troubleshooting & Notes
- Ensure PATs have the right scopes (Work Items, Code, Build and Release or Pipelines) for the actions you perform.
- Run the server locally behind an authenticated developer proxy if you need additional access controls.
- For production or shared environments, replace file-based PAT storage with a secure secret store and limit exposure of the server to trusted networks.
Links and Resources
- Repository: https://github.com/wangkanai/devops-mcp
- Consult the repo README for exact endpoint names, route variations and implementation details.