A Model Context Protocol (MCP) server that provides tools for searching Azure DevOps wiki and code repositories.
This MCP server provides two tools:
- Azure DevOps Wiki Search - Search for content in Azure DevOps wiki pages
- Azure DevOps Code Search - Search for code in Azure DevOps repositories with support for:
- File type filtering
- Path-based search
- Code element search (classes, functions, variables)
- Branch-specific searches
- Repository filtering
- Node.js 16 or higher
- An Azure DevOps organization with access to the Wiki and Code Search APIs
- A Personal Access Token (PAT) with the following permissions:
- Code (Read)
- Wiki (Read)
-
Clone this repository:
git clone https://github.com/yourusername/azure-devops-search-mcp.git cd azure-devops-search-mcp -
Install dependencies:
npm install -
Configure environment variables:
Copy the
.env.examplefile to.envand update with your Azure DevOps details:AZURE_DEVOPS_ORG_URL=https://dev.azure.com/your-organization AZURE_DEVOPS_PAT=your-personal-access-token AZURE_DEVOPS_PROJECT=your-project-name -
Build and start the server:
npm run build npm startFor development with hot-reload:
npm run dev
The server implements the Model Context Protocol (MCP) specification version 1.8.0 for tools.
query(required): The search queryproject(optional): The Azure DevOps project namemaxResults(optional): Maximum number of results to return (default: 10)
query(required): The search queryproject(optional): The Azure DevOps project namerepository(optional): The repository name to search inbranch(optional): The branch to search infileExtensions(optional): Array of file extensions to filter resultspath(optional): Path filter within repositoriescodeElements(optional): Types of code elements to search for (class, function, variable, comment)maxResults(optional): Maximum number of results to return (default: 10)
To enable this MCP server in VS Code, add the following configuration to your workspace's .vscode/mcp.json file:
{
"inputs": [],
"servers": {
"ado-search": {
"command": "node",
"args": [
"${workspaceFolder}/dist/index.js"
],
"env": {
"AZURE_DEVOPS_ORG_URL": "https://dev.azure.com/your-organization",
"AZURE_DEVOPS_PROJECT": "your-project",
"AZURE_DEVOPS_PAT": "your-personal-access-token",
"PROJECT_FRIENDLY_NAME": "Your Project Name",
"LOG_DIR": "${workspaceFolder}/logs"
}
}
}
}Replace the following values with your own:
your-organization: Your Azure DevOps organization nameyour-project: Your Azure DevOps project nameyour-personal-access-token: Your Azure DevOps Personal Access TokenYour Project Name: A friendly name for your project (used in logs and messages)
The server will be automatically detected by VS Code's MCP support and its search tools will become available.
- @modelcontextprotocol/sdk: ^1.8.0
- azure-devops-node-api: ^14.1.0
- axios: ^1.8.4
- dotenv: ^16.0.0
- zod: ^3.24.2
MIT