@azure-devops/mcp 0.1.0 → 0.2.0-preview-oauth
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.
- package/LICENSE.md +21 -21
- package/README.md +320 -247
- package/dist/auth.js +74 -0
- package/dist/domains.js +1 -0
- package/dist/http.js +52 -0
- package/dist/index.js +61 -28
- package/dist/org-tenants.js +73 -0
- package/dist/orgtenants.js +73 -0
- package/dist/prompts.js +35 -10
- package/dist/server.js +36 -0
- package/dist/shared/domains.js +122 -0
- package/dist/shared/tool-validation.js +92 -0
- package/dist/tenant.js +73 -0
- package/dist/tools/advanced-security.js +108 -0
- package/dist/tools/advsec.js +108 -0
- package/dist/tools/auth.js +46 -4
- package/dist/tools/builds.js +146 -21
- package/dist/tools/core.js +73 -14
- package/dist/tools/releases.js +40 -15
- package/dist/tools/repos.js +421 -54
- package/dist/tools/repositories.js +666 -0
- package/dist/tools/search.js +100 -89
- package/dist/tools/test-plans.js +213 -0
- package/dist/tools/testplans.js +22 -21
- package/dist/tools/wiki.js +295 -37
- package/dist/tools/work-items.js +809 -0
- package/dist/tools/work.js +83 -39
- package/dist/tools/workitems.js +495 -171
- package/dist/tools.js +24 -14
- package/dist/useragent.js +20 -0
- package/dist/utils.js +52 -2
- package/dist/version.js +1 -1
- package/package.json +65 -55
package/dist/tools.js
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import {
|
|
3
|
+
import { Domain } from "./shared/domains.js";
|
|
4
|
+
import { configureAdvSecTools } from "./tools/advanced-security.js";
|
|
4
5
|
import { configureBuildTools } from "./tools/builds.js";
|
|
5
|
-
import {
|
|
6
|
-
import { configureWorkItemTools } from "./tools/workitems.js";
|
|
6
|
+
import { configureCoreTools } from "./tools/core.js";
|
|
7
7
|
import { configureReleaseTools } from "./tools/releases.js";
|
|
8
|
-
import {
|
|
9
|
-
import { configureTestPlanTools } from "./tools/testplans.js";
|
|
8
|
+
import { configureRepoTools } from "./tools/repositories.js";
|
|
10
9
|
import { configureSearchTools } from "./tools/search.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
import { configureTestPlanTools } from "./tools/test-plans.js";
|
|
11
|
+
import { configureWikiTools } from "./tools/wiki.js";
|
|
12
|
+
import { configureWorkTools } from "./tools/work.js";
|
|
13
|
+
import { configureWorkItemTools } from "./tools/work-items.js";
|
|
14
|
+
function configureAllTools(server, tokenProvider, connectionProvider, userAgentProvider, enabledDomains) {
|
|
15
|
+
const configureIfDomainEnabled = (domain, configureFn) => {
|
|
16
|
+
if (enabledDomains.has(domain)) {
|
|
17
|
+
configureFn();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
configureIfDomainEnabled(Domain.CORE, () => configureCoreTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
21
|
+
configureIfDomainEnabled(Domain.WORK, () => configureWorkTools(server, tokenProvider, connectionProvider));
|
|
22
|
+
configureIfDomainEnabled(Domain.BUILDS, () => configureBuildTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
23
|
+
configureIfDomainEnabled(Domain.REPOSITORIES, () => configureRepoTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
24
|
+
configureIfDomainEnabled(Domain.WORK_ITEMS, () => configureWorkItemTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
25
|
+
configureIfDomainEnabled(Domain.RELEASES, () => configureReleaseTools(server, tokenProvider, connectionProvider));
|
|
26
|
+
configureIfDomainEnabled(Domain.WIKI, () => configureWikiTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
27
|
+
configureIfDomainEnabled(Domain.TEST_PLANS, () => configureTestPlanTools(server, tokenProvider, connectionProvider));
|
|
28
|
+
configureIfDomainEnabled(Domain.SEARCH, () => configureSearchTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
29
|
+
configureIfDomainEnabled(Domain.ADVANCED_SECURITY, () => configureAdvSecTools(server, tokenProvider, connectionProvider));
|
|
20
30
|
}
|
|
21
31
|
export { configureAllTools };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
class UserAgentComposer {
|
|
4
|
+
_userAgent;
|
|
5
|
+
_mcpClientInfoAppended;
|
|
6
|
+
constructor(packageVersion) {
|
|
7
|
+
this._userAgent = `AzureDevOps.MCP/${packageVersion} (local)`;
|
|
8
|
+
this._mcpClientInfoAppended = false;
|
|
9
|
+
}
|
|
10
|
+
get userAgent() {
|
|
11
|
+
return this._userAgent;
|
|
12
|
+
}
|
|
13
|
+
appendMcpClientInfo(info) {
|
|
14
|
+
if (!this._mcpClientInfoAppended && info && info.name && info.version) {
|
|
15
|
+
this._userAgent += ` ${info.name}/${info.version}`;
|
|
16
|
+
this._mcpClientInfoAppended = true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export { UserAgentComposer };
|
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { packageVersion } from "./version.js";
|
|
4
3
|
export const apiVersion = "7.2-preview.1";
|
|
5
4
|
export const batchApiVersion = "5.0";
|
|
6
|
-
export const
|
|
5
|
+
export const markdownCommentsApiVersion = "7.2-preview.4";
|
|
6
|
+
export function createEnumMapping(enumObject) {
|
|
7
|
+
const mapping = {};
|
|
8
|
+
for (const [key, value] of Object.entries(enumObject)) {
|
|
9
|
+
if (typeof key === "string" && typeof value === "number") {
|
|
10
|
+
mapping[key.toLowerCase()] = value;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return mapping;
|
|
14
|
+
}
|
|
15
|
+
export function mapStringToEnum(value, enumObject, defaultValue) {
|
|
16
|
+
if (!value)
|
|
17
|
+
return defaultValue;
|
|
18
|
+
const enumMapping = createEnumMapping(enumObject);
|
|
19
|
+
return enumMapping[value.toLowerCase()] ?? defaultValue;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Maps an array of strings to an array of enum values, filtering out invalid values.
|
|
23
|
+
* @param values Array of string values to map
|
|
24
|
+
* @param enumObject The enum object to map to
|
|
25
|
+
* @returns Array of valid enum values
|
|
26
|
+
*/
|
|
27
|
+
export function mapStringArrayToEnum(values, enumObject) {
|
|
28
|
+
if (!values)
|
|
29
|
+
return [];
|
|
30
|
+
return values.map((value) => mapStringToEnum(value, enumObject)).filter((v) => v !== undefined);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Converts a TypeScript numeric enum to an array of string keys for use with z.enum().
|
|
34
|
+
* This ensures that enum schemas generate string values rather than numeric values.
|
|
35
|
+
* @param enumObject The TypeScript enum object
|
|
36
|
+
* @returns Array of string keys from the enum
|
|
37
|
+
*/
|
|
38
|
+
export function getEnumKeys(enumObject) {
|
|
39
|
+
return Object.keys(enumObject).filter((key) => isNaN(Number(key)));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Safely converts a string enum key to its corresponding enum value.
|
|
43
|
+
* Validates that the key exists in the enum before conversion.
|
|
44
|
+
* @param enumObject The TypeScript enum object
|
|
45
|
+
* @param key The string key to convert
|
|
46
|
+
* @returns The enum value if key is valid, undefined otherwise
|
|
47
|
+
*/
|
|
48
|
+
export function safeEnumConvert(enumObject, key) {
|
|
49
|
+
if (!key)
|
|
50
|
+
return undefined;
|
|
51
|
+
const validKeys = getEnumKeys(enumObject);
|
|
52
|
+
if (!validKeys.includes(key)) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
return enumObject[key];
|
|
56
|
+
}
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "0.
|
|
1
|
+
export const packageVersion = "0.2.0-preview-oauth";
|
package/package.json
CHANGED
|
@@ -1,55 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@azure-devops/mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "MCP server for interacting with Azure DevOps",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "Microsoft Corporation",
|
|
7
|
-
"homepage": "
|
|
8
|
-
"bugs": "
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
},
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@azure-devops/mcp",
|
|
3
|
+
"version": "0.2.0-preview-oauth",
|
|
4
|
+
"description": "MCP server for interacting with Azure DevOps",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Microsoft Corporation",
|
|
7
|
+
"homepage": "https://github.com/microsoft/azure-devops-mcp",
|
|
8
|
+
"bugs": "https://github.com/microsoft/azure-devops-mcp/issues",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/microsoft/azure-devops-mcp.git"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"bin": {
|
|
15
|
+
"mcp-server-azuredevops": "dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"preinstall": "npm config set registry https://registry.npmjs.org/",
|
|
25
|
+
"prebuild": "node -p \"'export const packageVersion = ' + JSON.stringify(require('./package.json').version) + ';\\n'\" > src/version.ts && prettier --write src/version.ts",
|
|
26
|
+
"validate-tools": "tsc --noEmit && node scripts/build-validate-tools.js",
|
|
27
|
+
"build": "tsc && shx chmod +x dist/*.js",
|
|
28
|
+
"prepare": "npm run build",
|
|
29
|
+
"watch": "tsc --watch",
|
|
30
|
+
"inspect": "ALLOWED_ORIGINS=http://127.0.0.1:6274 npx @modelcontextprotocol/inspector node dist/index.js",
|
|
31
|
+
"start": "node -r tsconfig-paths/register dist/index.js",
|
|
32
|
+
"eslint": "eslint",
|
|
33
|
+
"eslint-fix": "eslint --fix",
|
|
34
|
+
"format": "prettier --write .",
|
|
35
|
+
"format-check": "prettier --check .",
|
|
36
|
+
"clean": "shx rm -rf dist",
|
|
37
|
+
"test": "jest"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@azure/identity": "^4.10.0",
|
|
41
|
+
"@modelcontextprotocol/sdk": "1.17.0",
|
|
42
|
+
"azure-devops-extension-api": "^4.252.0",
|
|
43
|
+
"azure-devops-extension-sdk": "^4.0.2",
|
|
44
|
+
"azure-devops-node-api": "^15.1.0",
|
|
45
|
+
"yargs": "^18.0.0",
|
|
46
|
+
"zod": "^3.25.63",
|
|
47
|
+
"zod-to-json-schema": "^3.24.5"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@modelcontextprotocol/inspector": "^0.16.1",
|
|
51
|
+
"@types/jest": "^30.0.0",
|
|
52
|
+
"@types/node": "^22",
|
|
53
|
+
"eslint-config-prettier": "10.1.8",
|
|
54
|
+
"eslint-plugin-header": "^3.1.1",
|
|
55
|
+
"glob": "^11.0.3",
|
|
56
|
+
"jest": "^30.0.2",
|
|
57
|
+
"jest-extended": "^6.0.0",
|
|
58
|
+
"prettier": "3.6.2",
|
|
59
|
+
"shx": "^0.4.0",
|
|
60
|
+
"ts-jest": "^29.4.0",
|
|
61
|
+
"tsconfig-paths": "^4.2.0",
|
|
62
|
+
"typescript": "^5.8.3",
|
|
63
|
+
"typescript-eslint": "^8.32.1"
|
|
64
|
+
}
|
|
65
|
+
}
|