@@ -9,43 +9,52 @@ This is an Azure DevOps MCP (Model Context Protocol) Server that provides access
9
9
## Development Commands
10
10
11
11
### Building and Development
12
+
12
13
- ` npm run build ` - Compile TypeScript to JavaScript in ` dist/ ` directory
13
14
- ` npm run watch ` - Watch mode for continuous compilation during development
14
15
- ` npm run prepare ` - Runs build automatically (used by npm lifecycle)
15
16
- ` npm run clean ` - Remove the ` dist/ ` directory
16
17
- ` npm run validate-tools ` - Validate tool names and TypeScript compilation
17
18
18
19
### Code Quality
20
+
19
21
- ` npm run eslint ` - Run ESLint linter
20
22
- ` npm run eslint-fix ` - Run ESLint with automatic fixes
21
23
- ` npm run format ` - Format code with Prettier
22
24
- ` npm run format-check ` - Check code formatting without making changes
23
25
24
26
### Testing
27
+
25
28
- ` npm test ` - Run Jest test suite
26
29
- Coverage thresholds are set to 40% for branches, functions, lines, and statements
27
30
- Test files are located in ` test/ ` directory and follow the pattern ` **/?(*.)+(spec|test).[jt]s?(x) `
28
31
29
32
### Running the Server
33
+
30
34
- ` npm start ` - Start the MCP server (requires Azure DevOps organization name as argument)
31
35
- ` npm run inspect ` - Run the server with MCP inspector for debugging
32
36
33
37
### Local Development Setup
38
+
34
39
For source installation (development mode):
40
+
35
41
1 . Clone repository and run ` npm install `
36
42
2 . Configure ` .vscode/mcp.json ` with local command: ` "mcp-server-azuredevops" `
37
43
3 . The server requires an Azure DevOps organization name as the first argument
38
44
39
45
## Architecture
40
46
41
47
### Core Components
48
+
42
49
- ** Entry Point** : ` src/index.ts ` - Main server initialization, Azure authentication, and MCP server setup
43
50
- ** Tool Configuration** : ` src/tools.ts ` - Aggregates all tool modules and configures them with the MCP server
44
51
- ** Authentication** : Uses ` @azure/identity ` with ` DefaultAzureCredential ` for Azure DevOps API access
45
52
- ** Client Setup** : Creates Azure DevOps WebApi clients with proper user agent and authentication
46
53
47
54
### Tool Organization
55
+
48
56
Tools are organized by Azure DevOps service area in ` src/tools/ ` :
57
+
49
58
- ` core.ts ` - Projects and teams management
50
59
- ` work.ts ` - Iterations and team work management
51
60
- ` workitems.ts ` - Work item CRUD operations and queries
@@ -59,16 +68,19 @@ Tools are organized by Azure DevOps service area in `src/tools/`:
59
68
- ` auth.ts ` - Authentication utilities
60
69
61
70
### Key Patterns
71
+
62
72
- Each tool module follows the pattern: ` configure[ServiceName]Tools(server, tokenProvider, connectionProvider, ...) `
63
73
- All tools use Zod schemas for input validation and JSON schema generation
64
74
- Authentication is handled centrally through token and connection providers
65
75
- User agent composition includes package version and MCP client information
66
76
67
77
### Environment Variables
78
+
68
79
- ` ADO_MCP_AZURE_TOKEN_CREDENTIALS ` - Optional override for Azure token credentials
69
80
- Falls back to ` AZURE_TOKEN_CREDENTIALS = "dev" ` for development
70
81
71
82
### Project Structure
83
+
72
84
- ` src/ ` - TypeScript source code
73
85
- ` dist/ ` - Compiled JavaScript output (created by build)
74
86
- ` test/ ` - Jest test files with mocks in ` test/mocks/ `
@@ -77,19 +89,22 @@ Tools are organized by Azure DevOps service area in `src/tools/`:
77
89
## Important Notes
78
90
79
91
### Adding New Tools
92
+
80
93
- Follow existing patterns in tool modules under ` src/tools/ `
81
94
- Use Azure DevOps TypeScript clients when available, fall back to direct API calls only when necessary
82
95
- Add tool configuration to ` configureAllTools() ` in ` src/tools.ts `
83
96
- Include comprehensive input validation with Zod schemas
84
97
- Follow the established naming convention: ` [service]_[action]_[object] `
85
98
86
99
### Testing
100
+
87
101
- Mock Azure DevOps API responses in ` test/mocks/ `
88
102
- Test files mirror the source structure in ` test/src/ `
89
103
- Use Jest with ts-jest preset for TypeScript support
90
104
91
105
### Code Quality Standards
106
+
92
107
- TypeScript with strict mode enabled
93
108
- ESLint configuration with Prettier integration
94
109
- All files must include Microsoft copyright headers
95
- - Follow existing code patterns for consistency
110
+ - Follow existing code patterns for consistency
0 commit comments