mcp-server-azure-devops
Copilot instructions393 starsChanged 5 months agoMITView on GitHub
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. You need to have Node.js and npm installed. Node 20 (LTS) or later is recommended for development; on the 20.x line, current tooling requires Node >=20.19.0 (or >=22.12.0 on newer majors). Copy .env.example to .env and configure Azure DevOps credentials: Required environment variables: Alternative setup methods: - Use ./setup_env.sh script for interactive environment setup with…
- Reads credentials
- Installs packages
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- codebase-designSkill
- decision-mappingSkill
- design-an-interfaceSkill
- domain-modelingSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- improve-codebase-architectureSkill
- prototypeSkill
- setup-matt-pocock-skillsSkill
- teachSkill
- to-issuesSkill
- to-prdSkill
- triageSkill
- azure-devops-rest-apiSkill
- skill-creatorSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
20 rules. About 0 are common, 8 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does …
- Very specific: line 71
Use ./setup_env.sh script for interactive environment setup with Azure CLI
- Distinctive: line 80
Before submitting a PR, ensure:
- Very specific: line 99
Test server startup: npm run dev (should start or fail gracefully with clear error messages)
- Very specific: line 100
Test MCP protocol using npm run inspector (requires working Azure DevOps credentials)
- Very specific: line 125
Path aliases: Use @/ instead of relative imports (e.g., import { something } from '@/shared/utils')
- Distinctive: line 137
Follow the Feature Module pattern used throughout the codebase:
- Very specific: line 155
Add to src/server.ts following existing patterns
- Distinctive: line 159
Follow the same structure and naming conventions
- Distinctive: line 163
When updating existing features:
- Distinctive: line 168
Update or add tests: Always update existing tests or add new ones
- Very specific: line 213
Authentication issues: Check docs/authentication.md first
- Very specific: line 216
Testing patterns: Use docs/testing/setup.md
- Distinctive: line 223
Ensure all imports are valid
- Very specific: line 224
Verify tsconfig.json paths configuration
- Very specific: line 232
Run npm run lint:fix to auto-fix common issues
- Very specific: line 233
Check Oxlint rules in .oxlintrc.json
- Very specific: line 236
Verify .env file configuration
- Distinctive: line 237
Check error messages for missing environment variables
- Very specific: line 245
Use @/ path aliases instead of relative imports
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Azure DevOps MCP Server - Development Instructions
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
Prerequisites
You need to have Node.js and npm installed. Node 20 (LTS) or later is recommended for development; on the 20.x line, current tooling requires Node >=20.19.0 (or >=22.12.0 on newer majors).
Building and Running
1. Install Dependencies
npm install # Takes ~25 seconds. NEVER CANCEL. Set timeout to 60+ seconds.2. Build the Server
npm run build # Takes ~5 seconds. Compiles TypeScript to `dist/` directory.3. Run Tests
# Unit tests (no Azure DevOps credentials required)
npm run test:unit # Takes ~19 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
# Integration tests (requires Azure DevOps credentials)
npm run test:int # Takes ~18 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
# E2E tests (requires Azure DevOps credentials)
npm run test:e2e # Takes ~6 seconds. NEVER CANCEL. Set timeout to 30+ seconds.
# All tests
npm test # Takes ~45 seconds total. NEVER CANCEL. Set timeout to 90+ seconds.4. Code Quality
npm run lint # Takes ~3 seconds. Runs Oxlint for code quality.
npm run lint:fix # Auto-fix linting issues.
npm run format # Takes ~3 seconds. Runs oxfmt for code formatting.
npm run format:check # Checks formatting with oxfmt.5. Run the Server
# IMPORTANT: Always configure environment first using `.env` file (copy from `.env.example`)
npm run dev # Development mode with auto-restart using ts-node-dev
npm run start # Production mode - runs compiled version from `dist/index.js`
npm run inspector # Debug mode with MCP Inspector toolEnvironment Setup
Copy .env.example to .env and configure Azure DevOps credentials:
cp .env.example .env
# Edit .env with your Azure DevOps credentialsRequired environment variables:
AZURE_DEVOPS_ORG_URL=https://dev.azure.com/your-organization
AZURE_DEVOPS_AUTH_METHOD=pat # Options: pat, azure-identity, azure-cli
AZURE_DEVOPS_PAT=your-personal-access-token # For PAT auth
AZURE_DEVOPS_DEFAULT_PROJECT=your-project-name # OptionalAlternative setup methods:
- Use
./setup_env.shscript for interactive environment setup with Azure CLI - See
docs/authentication.mdfor comprehensive authentication guides - Copy from
docs/examples/directory for ready-to-use configurations (PAT, Azure Identity, Azure CLI) - For CI/CD environments: Reference
docs/ci-setup.mdfor secrets configuration
Note: The application will fail gracefully with clear error messages if credentials are missing.
Submitting Changes
Before submitting a PR, ensure:
- Linting and formatting pass:
npm run lint:fix && npm run format - Build succeeds:
npm run build - Unit tests pass:
npm run test:unit - Manual testing complete:
- Configure
.envfile (copy from.env.exampleand update values) - Test server startup:
npm run dev(should start or fail gracefully with clear error messages) - Test MCP protocol using
npm run inspector(requires working Azure DevOps credentials)
- Configure
- Integration/E2E tests pass (if you have Azure DevOps credentials):
npm run test:int && npm run test:e2e - Conventional commits:
npm run commit # Use this for guided commit message creation
Note: Unit tests must pass even without Azure DevOps credentials - they use mocks for all external dependencies.
Project Architecture
- TypeScript project with strict configuration (
tsconfig.json) - Feature-based architecture: Each Azure DevOps feature area is a separate module in
src/features/- Example:
src/features/work-items/,src/features/projects/,src/features/repositories/
- Example:
- MCP Protocol implementation for AI assistant integration using
@modelcontextprotocol/sdk - Test Strategy: Testing Trophy approach (see
docs/testing/README.md)- Unit tests:
.spec.unit.ts(mock all external dependencies, focus on logic) - Integration tests:
.spec.int.ts(test with real Azure DevOps APIs, requires credentials) - E2E tests:
.spec.e2e.ts(test complete MCP server functionality) - Tests are co-located with feature code
- Unit tests:
- Path aliases: Use
@/instead of relative imports (e.g.,import { something } from '@/shared/utils')
Key Directories
src/index.tsandsrc/server.ts- Main server entry pointssrc/features/[feature-name]/- Feature modulessrc/shared/- Shared utilities (auth, errors, types, config)src/clients/azure-devops.ts- Azure DevOps clienttests/setup.ts- Test configurationdocs/- Comprehensive documentation (authentication, testing, tools)
Adding a New Feature
Follow the Feature Module pattern used throughout the codebase:
- Create feature module directory:
src/features/[feature-name]/ - Add required files:
feature.ts- Core feature logicschema.ts- Zod schemas for input/output validationtool-definitions.ts- MCP tool definitionsindex.ts- Exports and request handlers
- Add test files:
feature.spec.unit.ts- Unit tests (required)feature.spec.int.ts- Integration tests (if applicable)
- Register the feature:
- Add to
src/server.tsfollowing existing patterns
- Add to
- Reference existing modules:
- See
src/features/work-items/orsrc/features/projects/for complete examples - Follow the same structure and naming conventions
- See
Modifying Existing Features
When updating existing features:
- Update core logic:
src/features/[feature-name]/feature.ts - Update schemas:
schemas.ts(if input/output changes) - Update tool definitions:
tool-definitions.ts(if MCP interface changes) - Update or add tests: Always update existing tests or add new ones
- Run validation: Execute the full validation workflow before committing
Dependencies
Core libraries:
@modelcontextprotocol/sdk- MCP protocol implementationazure-devops-node-api- Azure DevOps REST APIs@azure/identity- Azure authenticationzod- Schema validation and type safety
Development tools:
jest- Testing framework (with separate configs for unit/int/e2e tests)ts-node-dev- Development server with auto-restartoxlint+oxfmt- Code quality and formattinghusky- Git hooks for commit validation
CI/CD:
- GitHub Actions workflow:
.github/workflows/main.yml - Runs on PRs to
main: Install → Lint → Build → Unit Tests → Integration Tests → E2E Tests - Integration and E2E tests require Azure DevOps secrets in CI
- Release automation with
release-please
Documentation
The repository has extensive documentation. Reference these for specific scenarios:
Authentication & Configuration
docs/authentication.md- Complete authentication guide (PAT, Azure Identity, Azure CLI)docs/azure-identity-authentication.md- Detailed Azure Identity setup and troubleshootingdocs/ci-setup.md- CI/CD environment setup and secrets configurationdocs/examples/- Ready-to-use environment configuration examples
Testing & Development
docs/testing/README.md- Testing Trophy approach, test types, and testing philosophydocs/testing/setup.md- Test environment setup, import patterns, VSCode integrationCONTRIBUTING.md- Development practices, commit guidelines, and workflow
Tool & API Documentation
docs/tools/README.md- Complete tool catalog with examples and response formatsdocs/tools/[feature].md- Detailed docs for each feature area (work-items, projects, etc.)docs/tools/resources.md- Resource URI patterns for accessing repository content
When to Reference
- Starting new features: Review
CONTRIBUTING.mdanddocs/testing/README.md - Authentication issues: Check
docs/authentication.mdfirst - Available tools: Browse
docs/tools/README.md - CI/CD problems: Reference
docs/ci-setup.md - Testing patterns: Use
docs/testing/setup.md - Environment setup: Copy from
docs/examples/
Troubleshooting
Build fails:
- Check TypeScript errors
- Ensure all imports are valid
- Verify
tsconfig.jsonpaths configuration
Tests fail:
- Unit tests: Should pass without Azure DevOps credentials (they use mocks)
- Integration/E2E tests: Check
.envfile has valid Azure DevOps credentials - See
docs/testing/setup.mdfor environment variables and patterns
Lint errors:
- Run
npm run lint:fixto auto-fix common issues - Check Oxlint rules in
.oxlintrc.json
Server won't start:
- Verify
.envfile configuration - Check error messages for missing environment variables
- See
docs/authentication.mdfor comprehensive setup guides
Authentication issues:
- See
docs/authentication.mdfor comprehensive troubleshooting - For CI/CD: Reference
docs/ci-setup.mdfor proper secrets configuration
Import errors:
- Use
@/path aliases instead of relative imports - Verify
tsconfig.jsonpaths configuration
Unknown tool capabilities:
- Browse
docs/tools/README.mdfor complete tool documentation
Available Skills
Skills are modular, self-contained packages that extend capabilities with specialized knowledge, workflows, and tools. Reference these skills when working on related tasks.
| Skill Name | Use When... | Path |
| skill-creator | Creating a new skill or updating an existing skill that extends capabilities with specialized knowledge, workflows, or tool integrations | .github/skills/skill-creator/SKILL.md |
| azure-devops-rest-api | Implementing new Azure DevOps API integrations, exploring API capabilities, understanding request/response formats, or referencing the official OpenAPI specifications from the vsts-rest-api-specs repository | .github/skills/azure-devops-rest-api/SKILL.md |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

