@vm3jack/mcp-server-azure-devops 1.0.0 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Interactive setup script for @vm3jack/mcp-server-azure-devops
4
+ * Run with: npx @vm3jack/mcp-server-azure-devops-setup
5
+ */
6
+ export {};
package/dist/setup.js ADDED
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * Interactive setup script for @vm3jack/mcp-server-azure-devops
5
+ * Run with: npx @vm3jack/mcp-server-azure-devops-setup
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
20
+ }) : function(o, v) {
21
+ o["default"] = v;
22
+ });
23
+ var __importStar = (this && this.__importStar) || (function () {
24
+ var ownKeys = function(o) {
25
+ ownKeys = Object.getOwnPropertyNames || function (o) {
26
+ var ar = [];
27
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
28
+ return ar;
29
+ };
30
+ return ownKeys(o);
31
+ };
32
+ return function (mod) {
33
+ if (mod && mod.__esModule) return mod;
34
+ var result = {};
35
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36
+ __setModuleDefault(result, mod);
37
+ return result;
38
+ };
39
+ })();
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ const readline = __importStar(require("readline"));
42
+ const rl = readline.createInterface({
43
+ input: process.stdin,
44
+ output: process.stdout,
45
+ });
46
+ function ask(question, defaultValue) {
47
+ return new Promise((resolve) => {
48
+ const hint = defaultValue ? ` (default: ${defaultValue})` : '';
49
+ rl.question(`${question}${hint}: `, (answer) => {
50
+ resolve(answer.trim() || defaultValue || '');
51
+ });
52
+ });
53
+ }
54
+ function askYesNo(question, defaultYes = false) {
55
+ return new Promise((resolve) => {
56
+ const hint = defaultYes ? '[Y/n]' : '[y/N]';
57
+ rl.question(`${question} ${hint}: `, (answer) => {
58
+ const trimmed = answer.trim().toLowerCase();
59
+ if (!trimmed)
60
+ return resolve(defaultYes);
61
+ resolve(trimmed === 'y' || trimmed === 'yes');
62
+ });
63
+ });
64
+ }
65
+ async function main() {
66
+ console.log('\n========================================');
67
+ console.log(' Azure DevOps / TFS MCP Server Setup');
68
+ console.log('========================================\n');
69
+ // 1. TFS URL
70
+ const orgUrl = await ask('TFS / Azure DevOps URL\n (e.g. https://server/tfs/DefaultCollection)');
71
+ if (!orgUrl) {
72
+ console.error('\n❌ URL is required.');
73
+ process.exit(1);
74
+ }
75
+ // 2. Default project
76
+ const defaultProject = await ask('\nDefault project name (optional)');
77
+ // 3. PAT
78
+ const pat = await ask('\nPersonal Access Token (PAT)');
79
+ if (!pat) {
80
+ console.error('\n❌ PAT is required.');
81
+ process.exit(1);
82
+ }
83
+ // 4. Corporate proxy / self-signed certificate
84
+ console.log('\n⚠️ If your network uses a corporate proxy or self-signed SSL certificate,');
85
+ console.log(' TLS verification must be disabled for the MCP server to connect.');
86
+ const disableTls = await askYesNo('Are you behind a corporate proxy or using a self-signed certificate?', false);
87
+ rl.close();
88
+ // Build env object
89
+ const env = {
90
+ AZURE_DEVOPS_ORG_URL: orgUrl,
91
+ AZURE_DEVOPS_AUTH_METHOD: 'pat',
92
+ AZURE_DEVOPS_PAT: pat,
93
+ };
94
+ if (defaultProject) {
95
+ env['AZURE_DEVOPS_DEFAULT_PROJECT'] = defaultProject;
96
+ }
97
+ if (disableTls) {
98
+ env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';
99
+ console.log('\n⚠️ NODE_TLS_REJECT_UNAUTHORIZED=0 has been set. This disables SSL verification.');
100
+ console.log(' Only use this in trusted internal networks.\n');
101
+ }
102
+ // Output VS Code MCP config
103
+ const config = {
104
+ mcp: {
105
+ servers: {
106
+ tfs: {
107
+ command: 'mcp-server-azure-devops',
108
+ env,
109
+ },
110
+ },
111
+ },
112
+ };
113
+ console.log('\n========================================');
114
+ console.log(' Add this to your VS Code settings.json');
115
+ console.log('========================================\n');
116
+ console.log(JSON.stringify(config, null, 2));
117
+ console.log('\n✅ Setup complete! Copy the config above into your VS Code settings.json.');
118
+ console.log(' Path: Code > Preferences > Open User Settings (JSON)\n');
119
+ }
120
+ main().catch((err) => {
121
+ console.error('Setup failed:', err);
122
+ process.exit(1);
123
+ });
124
+ //# sourceMappingURL=setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";;AAEA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAErC,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;IAClC,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,MAAM,EAAE,OAAO,CAAC,MAAM;CACvB,CAAC,CAAC;AAEH,SAAS,GAAG,CAAC,QAAgB,EAAE,YAAqB;IAClD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,cAAc,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,EAAE,CAAC,QAAQ,CAAC,GAAG,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE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AAG,CACT,6EAA6E,CAC9E,CAAC;IACF,OAAO,CAAC,GAAG,CACT,4DAA4D,CAC7D,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;IACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@vm3jack/mcp-server-azure-devops",
3
- "version": "1.0.0",
3
+ "version": "1.0.4",
4
+ "publisher": "vm3jack",
4
5
  "description": "Azure DevOps reference server for the Model Context Protocol (MCP)",
5
6
  "repository": {
6
7
  "type": "git",
7
8
  "url": "https://github.com/vm3jack/mcp-server-azure-devops"
8
9
  },
9
- "main": "dist/index.js",
10
+ "main": "dist/extension.js",
10
11
  "types": "dist/index.d.ts",
11
12
  "bin": {
12
13
  "mcp-server-azure-devops": "./dist/index.js"
@@ -17,6 +18,54 @@
17
18
  "LICENSE",
18
19
  "README.md"
19
20
  ],
21
+ "engines": {
22
+ "vscode": "^1.109.0"
23
+ },
24
+ "activationEvents": [
25
+ "onStartupFinished"
26
+ ],
27
+ "contributes": {
28
+ "mcpServerDefinitionProviders": [
29
+ {
30
+ "id": "azure-devops",
31
+ "label": "Azure DevOps"
32
+ }
33
+ ],
34
+ "commands": [
35
+ {
36
+ "command": "azureDevOps.updateCredentials",
37
+ "title": "Azure DevOps: Update Credentials"
38
+ }
39
+ ],
40
+ "configuration": {
41
+ "title": "Azure DevOps",
42
+ "properties": {
43
+ "azureDevOps.organizationUrl": {
44
+ "type": "string",
45
+ "description": "Azure DevOps organization URL,例如 https://dev.azure.com/your-org"
46
+ },
47
+ "azureDevOps.authMethod": {
48
+ "type": "string",
49
+ "enum": ["pat", "azure-identity", "azure-cli"],
50
+ "default": "pat",
51
+ "description": "認證方式"
52
+ },
53
+ "azureDevOps.personalAccessToken": {
54
+ "type": "string",
55
+ "description": "Personal Access Token(PAT 認證時使用)"
56
+ },
57
+ "azureDevOps.defaultProject": {
58
+ "type": "string",
59
+ "description": "預設專案名稱(選填)"
60
+ },
61
+ "azureDevOps.rejectUnauthorized": {
62
+ "type": "boolean",
63
+ "default": true,
64
+ "description": "驗證 SSL 憑證(內網自簽憑證請設為 false)"
65
+ }
66
+ }
67
+ }
68
+ },
20
69
  "publishConfig": {
21
70
  "access": "public"
22
71
  },
@@ -67,8 +116,9 @@
67
116
  ]
68
117
  },
69
118
  "scripts": {
70
- "build": "tsc",
119
+ "build": "tsc && esbuild src/index.ts --bundle --platform=node --target=node20 --outfile=dist/index.js --external:vscode",
71
120
  "prepack": "npm run build && chmod +x dist/index.js",
121
+ "package": "vsce package",
72
122
  "dev": "ts-node-dev --respawn --transpile-only src/index.ts",
73
123
  "start": "node dist/index.js",
74
124
  "inspector": "npm run build && npx @modelcontextprotocol/inspector@0.9.0 node dist/index.js",
@@ -109,10 +159,13 @@
109
159
  "@types/diff": "^7.0.2",
110
160
  "@types/jest": "^29.5.0",
111
161
  "@types/node": "^20.0.0",
162
+ "@types/vscode": "^1.109.0",
112
163
  "@typescript-eslint/eslint-plugin": "^8.27.0",
113
164
  "@typescript-eslint/parser": "^8.27.0",
165
+ "@vscode/vsce": "^3.7.1",
114
166
  "commitizen": "^4.3.1",
115
167
  "cz-conventional-changelog": "^3.3.0",
168
+ "esbuild": "^0.27.3",
116
169
  "eslint": "^8.0.0",
117
170
  "husky": "^8.0.3",
118
171
  "jest": "^29.0.0",