MCP server for Azure DevOps integration with TFVC support - provides seamless access to work items, repositories, projects, boards, and sprints
npm install berzegerol-azuredevops-mcp-serverbash
npx @ryancardin/azuredevops-mcp-server@latest
`
No installation or build steps required! Just set your environment variables and run.
$3
Click the button below to install the Azure DevOps MCP server directly in Cursor:

Important: After installation in Cursor, you must update the environment variables in your Cursor MCP configuration with your actual Azure DevOps details.
> Learn more about Cursor deeplinks at https://docs.cursor.com/deeplinks
$3
#### Global NPM Installation
`bash
npm install -g @ryancardin/azuredevops-mcp-server
azuredevops-mcp-server
`
#### Via Smithery (Claude Desktop)
`bash
npx -y @smithery/cli install @RyanCardin15/azuredevops-mcp --client claude
`
#### Development Setup
For development or customization:
1. Clone the repository:
`bash
git clone https://github.com/RyanCardin15/AzureDevOps-MCP.git
cd AzureDevOps-MCP
`
2. Install dependencies:
`bash
npm install
`
3. Build the project:
`bash
npm run build
`
4. Run locally:
`bash
npm start
`
Configuration
$3
- Node.js (v16 or later)
- An Azure DevOps account with a Personal Access Token (PAT) or appropriate credentials
$3
Configure the server using environment variables. You can set these in your shell, .env file, or in your MCP client configuration:
#### For Azure DevOps Services (Cloud)
`bash
AZURE_DEVOPS_ORG_URL=https://dev.azure.com/your-organization
AZURE_DEVOPS_PROJECT=your-default-project
AZURE_DEVOPS_IS_ON_PREMISES=false
AZURE_DEVOPS_AUTH_TYPE=pat
AZURE_DEVOPS_PERSONAL_ACCESS_TOKEN=your-personal-access-token
`
#### For Azure DevOps Server (On-Premises)
`bash
AZURE_DEVOPS_ORG_URL=https://your-server/tfs
AZURE_DEVOPS_PROJECT=your-default-project
AZURE_DEVOPS_IS_ON_PREMISES=true
AZURE_DEVOPS_COLLECTION=your-collection
AZURE_DEVOPS_API_VERSION=6.0
AZURE_DEVOPS_AUTH_TYPE=pat
AZURE_DEVOPS_PERSONAL_ACCESS_TOKEN=your-personal-access-token
`
#### Alternative Authentication Methods (On-Premises)
`bash
NTLM Authentication
AZURE_DEVOPS_AUTH_TYPE=ntlm
AZURE_DEVOPS_USERNAME=your-username
AZURE_DEVOPS_PASSWORD=your-password
AZURE_DEVOPS_DOMAIN=your-domain
Basic Authentication
AZURE_DEVOPS_AUTH_TYPE=basic
AZURE_DEVOPS_USERNAME=your-username
AZURE_DEVOPS_PASSWORD=your-password
Entra ID Authentication (requires az CLI)
AZURE_DEVOPS_AUTH_TYPE=entra
`
$3
#### Cursor Configuration
Add this to your Cursor MCP settings:
`json
{
"mcpServers": {
"azure-devops": {
"command": "npx",
"args": ["@ryancardin/azuredevops-mcp-server@latest"],
"env": {
"AZURE_DEVOPS_ORG_URL": "https://dev.azure.com/your-organization",
"AZURE_DEVOPS_PROJECT": "your-project",
"AZURE_DEVOPS_IS_ON_PREMISES": "false",
"AZURE_DEVOPS_AUTH_TYPE": "pat",
"AZURE_DEVOPS_PERSONAL_ACCESS_TOKEN": "your-personal-access-token"
}
}
}
}
`
#### Claude Desktop Configuration
Add this to your Claude Desktop MCP configuration file:
`json
{
"mcpServers": {
"azure-devops": {
"command": "npx",
"args": ["@ryancardin/azuredevops-mcp-server@latest"],
"env": {
"AZURE_DEVOPS_ORG_URL": "https://dev.azure.com/your-organization",
"AZURE_DEVOPS_PROJECT": "your-project",
"AZURE_DEVOPS_IS_ON_PREMISES": "false",
"AZURE_DEVOPS_AUTH_TYPE": "pat",
"AZURE_DEVOPS_PERSONAL_ACCESS_TOKEN": "your-personal-access-token"
}
}
}
}
`
$3
For Azure DevOps Services (cloud), you'll need to create a Personal Access Token with appropriate permissions:
1. Go to your Azure DevOps organization
2. Click on your profile icon in the top right
3. Select "Personal access tokens"
4. Click "New Token"
5. Give it a name and select the appropriate scopes:
- Work Items: Read & Write
- Code: Read & Write
- Project and Team: Read & Write
- Build: Read
- Release: Read
For Azure DevOps Server (on-premises), create the PAT in your on-premises instance following similar steps.
$3
| Variable | Description | Required | Default |
|----------|-------------|----------|---------|
| AZURE_DEVOPS_ORG_URL | URL of your Azure DevOps organization or server | Yes | - |
| AZURE_DEVOPS_PROJECT | Default project to use | Yes | - |
| AZURE_DEVOPS_IS_ON_PREMISES | Whether using Azure DevOps Server | No | false |
| AZURE_DEVOPS_COLLECTION | Collection name for on-premises | No* | - |
| AZURE_DEVOPS_API_VERSION | API version for on-premises | No | - |
| AZURE_DEVOPS_AUTH_TYPE | Authentication type (pat/ntlm/basic/entra) | No | pat |
| AZURE_DEVOPS_PERSONAL_ACCESS_TOKEN | Personal access token (for 'pat' auth) | No** | - |
| AZURE_DEVOPS_USERNAME | Username for NTLM/Basic auth | No** | - |
| AZURE_DEVOPS_PASSWORD | Password for NTLM/Basic auth | No** | - |
| AZURE_DEVOPS_DOMAIN | Domain for NTLM auth | No | - |
| ALLOWED_TOOLS | Comma-separated list of tool methods to enable | No | All tools |
\* Required if AZURE_DEVOPS_IS_ON_PREMISES=true
\** Required based on chosen authentication type
#### Tool Filtering with ALLOWED_TOOLS
The ALLOWED_TOOLS environment variable allows you to restrict which tool methods are available. This is completely optional - if not specified, all tools will be enabled.
Format: Comma-separated list of method names with no spaces.
Example:
`
ALLOWED_TOOLS=listWorkItems,getWorkItemById,searchWorkItems,createWorkItem
`
This would only enable the specified work item methods while disabling all others.
#### Entra ID Authentication
For Entra ID authentication, ensure you have Azure CLI installed and authenticated:
`bash
az login
`
The server supports AZ CLI, AZD, and Azure PowerShell modules as long as you're authenticated.
Usage
Once the server is running, you can interact with it using the MCP protocol. The server exposes several tools for different Azure DevOps functionalities.
$3
> Note: By default, only a subset of tools are registered in the index.ts file to keep the initial implementation simple. See the Tool Registration section for information on how to register additional tools.
$3
`json
{
"tool": "listWorkItems",
"params": {
"query": "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.State] = 'Active' ORDER BY [System.CreatedDate] DESC"
}
}
`
$3
`json
{
"tool": "createWorkItem",
"params": {
"workItemType": "User Story",
"title": "Implement new feature",
"description": "As a user, I want to be able to export reports to PDF.",
"assignedTo": "john@example.com"
}
}
`
$3
`json
{
"tool": "listRepositories",
"params": {
"projectId": "MyProject"
}
}
`
$3
`json
{
"tool": "createPullRequest",
"params": {
"repositoryId": "repo-guid",
"sourceRefName": "refs/heads/feature-branch",
"targetRefName": "refs/heads/main",
"title": "Add new feature",
"description": "This PR adds the export to PDF feature"
}
}
`
Architecture
The project is structured as follows:
- src/
- Interfaces/: Type definitions for parameters and responses
- Services/: Service classes for interacting with Azure DevOps APIs
- Tools/: Tool implementations that expose functionality to clients
- index.ts: Main entry point that registers tools and starts the server
- config.ts: Configuration handling
$3
The service layer handles direct communication with the Azure DevOps API:
- WorkItemService: Work item operations
- BoardsSprintsService: Boards and sprints operations
- ProjectService: Project management operations
- GitService: Git repository operations
- TestingCapabilitiesService: Testing capabilities operations
- DevSecOpsService: DevSecOps operations
- ArtifactManagementService: Artifact management operations
- AIAssistedDevelopmentService: AI-assisted development operations
$3
The tools layer wraps the services and provides a consistent interface for the MCP protocol:
- WorkItemTools: Tools for work item operations
- BoardsSprintsTools: Tools for boards and sprints operations
- ProjectTools: Tools for project management operations
- GitTools: Tools for Git operations
- TestingCapabilitiesTools: Tools for testing capabilities operations
- DevSecOpsTools: Tools for DevSecOps operations
- ArtifactManagementTools: Tools for artifact management operations
- AIAssistedDevelopmentTools: Tools for AI-assisted development operations
Tool Registration
The MCP server requires tools to be explicitly registered in the index.ts file. By default, only a subset of all possible tools are registered to keep the initial implementation manageable.
To register more tools:
1. Open the src/index.ts file
2. Add new tool registrations following the pattern of existing tools
3. Build and restart the server
A comprehensive guide to tool registration is available in the TOOL_REGISTRATION.md file in the repository.
> Note: When registering tools, be careful to use the correct parameter types, especially for enum values. The type definitions in the Interfaces directory define the expected types for each parameter. Using the wrong type (e.g., using z.string() instead of z.enum() for enumerated values) will result in TypeScript errors during build.
Example of registering a new tool:
`typescript
server.tool("searchCode",
"Search for code in repositories",
{
searchText: z.string().describe("Text to search for"),
repositoryId: z.string().optional().describe("ID of the repository")
},
async (params, extra) => {
const result = await gitTools.searchCode(params);
return {
content: result.content,
rawData: result.rawData,
isError: result.isError
};
}
);
`
Troubleshooting
$3
#### Authentication Errors
- Ensure your Personal Access Token is valid and has the required permissions
- Check that the organization URL is correct
#### TypeScript Errors During Build
- Use npm run build:ignore-errors to bypass TypeScript errors
- Check for missing or incorrect type definitions
#### Runtime Errors
- Verify that the Azure DevOps project specified exists and is accessible
Contributing
Contributions are welcome! Here's how you can contribute:
1. Fork the repository
2. Create a feature branch (git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add some amazing feature')
4. Push to the branch (git push origin feature/amazing-feature`)