@azure-devops/mcp 2.10.0-nightly.20260915 → 2.10.0-nightly.20260916
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/dist/shared/tool-annotations.js +81 -0
- package/dist/tools.js +20 -17
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
const READ_ONLY_ANNOTATIONS = {
|
|
4
|
+
readOnlyHint: true,
|
|
5
|
+
destructiveHint: false,
|
|
6
|
+
idempotentHint: true,
|
|
7
|
+
openWorldHint: true,
|
|
8
|
+
};
|
|
9
|
+
const MUTATING_ANNOTATIONS = {
|
|
10
|
+
readOnlyHint: false,
|
|
11
|
+
destructiveHint: true,
|
|
12
|
+
idempotentHint: false,
|
|
13
|
+
openWorldHint: true,
|
|
14
|
+
};
|
|
15
|
+
const ADDITIVE_ANNOTATIONS = {
|
|
16
|
+
...MUTATING_ANNOTATIONS,
|
|
17
|
+
destructiveHint: false,
|
|
18
|
+
};
|
|
19
|
+
const TOOL_ANNOTATIONS = {
|
|
20
|
+
advsec_get_alert_details: READ_ONLY_ANNOTATIONS,
|
|
21
|
+
advsec_get_alerts: READ_ONLY_ANNOTATIONS,
|
|
22
|
+
core_get_identity_ids: READ_ONLY_ANNOTATIONS,
|
|
23
|
+
core_list_projects: READ_ONLY_ANNOTATIONS,
|
|
24
|
+
core_list_project_teams: READ_ONLY_ANNOTATIONS,
|
|
25
|
+
mcp_apps_ping: { ...READ_ONLY_ANNOTATIONS, openWorldHint: false },
|
|
26
|
+
pipelines_artifact: MUTATING_ANNOTATIONS,
|
|
27
|
+
pipelines_build: READ_ONLY_ANNOTATIONS,
|
|
28
|
+
pipelines_build_log: READ_ONLY_ANNOTATIONS,
|
|
29
|
+
pipelines_definition: READ_ONLY_ANNOTATIONS,
|
|
30
|
+
pipelines_run: READ_ONLY_ANNOTATIONS,
|
|
31
|
+
pipelines_write: MUTATING_ANNOTATIONS,
|
|
32
|
+
repo_branch: READ_ONLY_ANNOTATIONS,
|
|
33
|
+
repo_create_branch: ADDITIVE_ANNOTATIONS,
|
|
34
|
+
repo_file: READ_ONLY_ANNOTATIONS,
|
|
35
|
+
repo_pull_request: READ_ONLY_ANNOTATIONS,
|
|
36
|
+
repo_pull_request_thread: READ_ONLY_ANNOTATIONS,
|
|
37
|
+
repo_pull_request_thread_write: MUTATING_ANNOTATIONS,
|
|
38
|
+
repo_pull_request_write: MUTATING_ANNOTATIONS,
|
|
39
|
+
repo_repository: READ_ONLY_ANNOTATIONS,
|
|
40
|
+
repo_search_commits: READ_ONLY_ANNOTATIONS,
|
|
41
|
+
search_code: READ_ONLY_ANNOTATIONS,
|
|
42
|
+
search_wiki: READ_ONLY_ANNOTATIONS,
|
|
43
|
+
search_workitem: READ_ONLY_ANNOTATIONS,
|
|
44
|
+
testplan: READ_ONLY_ANNOTATIONS,
|
|
45
|
+
testplan_show_test_results_from_build_id: READ_ONLY_ANNOTATIONS,
|
|
46
|
+
testplan_test_case_write: MUTATING_ANNOTATIONS,
|
|
47
|
+
testplan_test_plan_write: MUTATING_ANNOTATIONS,
|
|
48
|
+
testplan_test_suite_write: MUTATING_ANNOTATIONS,
|
|
49
|
+
wiki: READ_ONLY_ANNOTATIONS,
|
|
50
|
+
wiki_upsert_page: MUTATING_ANNOTATIONS,
|
|
51
|
+
wit_backlog: MUTATING_ANNOTATIONS,
|
|
52
|
+
wit_query: READ_ONLY_ANNOTATIONS,
|
|
53
|
+
wit_work_item: READ_ONLY_ANNOTATIONS,
|
|
54
|
+
wit_work_item_attachment: ADDITIVE_ANNOTATIONS,
|
|
55
|
+
wit_work_item_comment_write: MUTATING_ANNOTATIONS,
|
|
56
|
+
wit_work_item_link_write: MUTATING_ANNOTATIONS,
|
|
57
|
+
wit_work_item_write: MUTATING_ANNOTATIONS,
|
|
58
|
+
work: READ_ONLY_ANNOTATIONS,
|
|
59
|
+
work_capacity_write: MUTATING_ANNOTATIONS,
|
|
60
|
+
work_iteration_write: ADDITIVE_ANNOTATIONS,
|
|
61
|
+
};
|
|
62
|
+
function configureToolsWithAnnotations(server, configureFn) {
|
|
63
|
+
const originalTool = server.tool;
|
|
64
|
+
server.tool = new Proxy(originalTool, {
|
|
65
|
+
apply(target, thisArg, argumentsList) {
|
|
66
|
+
const toolName = argumentsList[0];
|
|
67
|
+
if (typeof toolName !== "string" || !Object.hasOwn(TOOL_ANNOTATIONS, toolName)) {
|
|
68
|
+
throw new Error(`Missing MCP annotations for tool: ${String(toolName)}`);
|
|
69
|
+
}
|
|
70
|
+
argumentsList.splice(argumentsList.length - 1, 0, TOOL_ANNOTATIONS[toolName]);
|
|
71
|
+
return Reflect.apply(target, thisArg, argumentsList);
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
try {
|
|
75
|
+
configureFn();
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
server.tool = originalTool;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export { configureToolsWithAnnotations, TOOL_ANNOTATIONS };
|
package/dist/tools.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { wrapExternalToolResponse } from "./shared/content-safety.js";
|
|
4
4
|
import { Domain } from "./shared/domains.js";
|
|
5
|
+
import { configureToolsWithAnnotations } from "./shared/tool-annotations.js";
|
|
5
6
|
import { configureAdvSecTools } from "./tools/advanced-security.js";
|
|
6
7
|
import { configureMcpAppsTools } from "./tools/mcp-apps.js";
|
|
7
8
|
import { configurePipelineTools } from "./tools/pipelines.js";
|
|
@@ -13,23 +14,25 @@ import { configureWikiTools } from "./tools/wiki.js";
|
|
|
13
14
|
import { configureWorkTools } from "./tools/work.js";
|
|
14
15
|
import { configureWorkItemTools } from "./tools/work-items.js";
|
|
15
16
|
function configureAllTools(server, tokenProvider, connectionProvider, userAgentProvider, enabledDomains) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
configureToolsWithAnnotations(server, () => {
|
|
18
|
+
const configureIfDomainEnabled = (domain, configureFn) => {
|
|
19
|
+
if (enabledDomains.has(domain)) {
|
|
20
|
+
configureToolsWithContentSafety(server, domain, configureFn);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
configureIfDomainEnabled(Domain.CORE, () => configureCoreTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
24
|
+
// This is a local health-check response and contains no Azure DevOps content.
|
|
25
|
+
if (enabledDomains.has(Domain.MCP_APPS))
|
|
26
|
+
configureMcpAppsTools(server);
|
|
27
|
+
configureIfDomainEnabled(Domain.WORK, () => configureWorkTools(server, tokenProvider, connectionProvider));
|
|
28
|
+
configureIfDomainEnabled(Domain.PIPELINES, () => configurePipelineTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
29
|
+
configureIfDomainEnabled(Domain.REPOSITORIES, () => configureRepoTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
30
|
+
configureIfDomainEnabled(Domain.WORK_ITEMS, () => configureWorkItemTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
31
|
+
configureIfDomainEnabled(Domain.WIKI, () => configureWikiTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
32
|
+
configureIfDomainEnabled(Domain.TEST_PLANS, () => configureTestPlanTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
33
|
+
configureIfDomainEnabled(Domain.SEARCH, () => configureSearchTools(server, tokenProvider, connectionProvider, userAgentProvider));
|
|
34
|
+
configureIfDomainEnabled(Domain.ADVANCED_SECURITY, () => configureAdvSecTools(server, tokenProvider, connectionProvider));
|
|
35
|
+
});
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
38
|
* Centralizes the untrusted-content boundary for tool responses. Tool registration
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.10.0-nightly.
|
|
1
|
+
export const packageVersion = "2.10.0-nightly.20260916";
|
package/package.json
CHANGED