@azure-devops/mcp 2.2.0-nightly.20250930 → 2.2.0-nightly.20251002
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/tools/wiki.js +50 -0
- package/dist/version.js +1 -1
- package/package.json +4 -4
package/dist/tools/wiki.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { z } from "zod";
|
|
4
|
+
import { apiVersion } from "../utils.js";
|
|
4
5
|
const WIKI_TOOLS = {
|
|
5
6
|
list_wikis: "wiki_list_wikis",
|
|
6
7
|
get_wiki: "wiki_get_wiki",
|
|
7
8
|
list_wiki_pages: "wiki_list_pages",
|
|
9
|
+
get_wiki_page: "wiki_get_page",
|
|
8
10
|
get_wiki_page_content: "wiki_get_page_content",
|
|
9
11
|
create_or_update_page: "wiki_create_or_update_page",
|
|
10
12
|
};
|
|
@@ -85,6 +87,54 @@ function configureWikiTools(server, tokenProvider, connectionProvider, userAgent
|
|
|
85
87
|
};
|
|
86
88
|
}
|
|
87
89
|
});
|
|
90
|
+
server.tool(WIKI_TOOLS.get_wiki_page, "Retrieve wiki page metadata by path. This tool does not return page content.", {
|
|
91
|
+
wikiIdentifier: z.string().describe("The unique identifier of the wiki."),
|
|
92
|
+
project: z.string().describe("The project name or ID where the wiki is located."),
|
|
93
|
+
path: z.string().describe("The path of the wiki page (e.g., '/Home' or '/Documentation/Setup')."),
|
|
94
|
+
recursionLevel: z
|
|
95
|
+
.enum(["None", "OneLevel", "OneLevelPlusNestedEmptyFolders", "Full"])
|
|
96
|
+
.optional()
|
|
97
|
+
.describe("Recursion level for subpages. 'None' returns only the specified page. 'OneLevel' includes direct children. 'Full' includes all descendants."),
|
|
98
|
+
}, async ({ wikiIdentifier, project, path, recursionLevel }) => {
|
|
99
|
+
try {
|
|
100
|
+
const connection = await connectionProvider();
|
|
101
|
+
const accessToken = await tokenProvider();
|
|
102
|
+
// Normalize the path
|
|
103
|
+
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
104
|
+
//const encodedPath = encodeURIComponent(normalizedPath);
|
|
105
|
+
// Build the URL for the wiki page API
|
|
106
|
+
const baseUrl = connection.serverUrl.replace(/\/$/, "");
|
|
107
|
+
const params = new URLSearchParams({
|
|
108
|
+
"path": normalizedPath,
|
|
109
|
+
"api-version": apiVersion,
|
|
110
|
+
});
|
|
111
|
+
if (recursionLevel) {
|
|
112
|
+
params.append("recursionLevel", recursionLevel);
|
|
113
|
+
}
|
|
114
|
+
const url = `${baseUrl}/${project}/_apis/wiki/wikis/${wikiIdentifier}/pages?${params.toString()}`;
|
|
115
|
+
const response = await fetch(url, {
|
|
116
|
+
headers: {
|
|
117
|
+
"Authorization": `Bearer ${accessToken}`,
|
|
118
|
+
"User-Agent": userAgentProvider(),
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
if (!response.ok) {
|
|
122
|
+
const errorText = await response.text();
|
|
123
|
+
throw new Error(`Failed to get wiki page (${response.status}): ${errorText}`);
|
|
124
|
+
}
|
|
125
|
+
const pageData = await response.json();
|
|
126
|
+
return {
|
|
127
|
+
content: [{ type: "text", text: JSON.stringify(pageData, null, 2) }],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
132
|
+
return {
|
|
133
|
+
content: [{ type: "text", text: `Error fetching wiki page metadata: ${errorMessage}` }],
|
|
134
|
+
isError: true,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
});
|
|
88
138
|
server.tool(WIKI_TOOLS.get_wiki_page_content, "Retrieve wiki page content. Provide either a 'url' parameter OR the combination of 'wikiIdentifier' and 'project' parameters.", {
|
|
89
139
|
url: z
|
|
90
140
|
.string()
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.2.0-nightly.
|
|
1
|
+
export const packageVersion = "2.2.0-nightly.20251002";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-devops/mcp",
|
|
3
|
-
"version": "2.2.0-nightly.
|
|
3
|
+
"version": "2.2.0-nightly.20251002",
|
|
4
4
|
"description": "MCP server for interacting with Azure DevOps",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Microsoft Corporation",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@azure/identity": "^4.10.0",
|
|
41
|
-
"@modelcontextprotocol/sdk": "1.
|
|
41
|
+
"@modelcontextprotocol/sdk": "1.18.2",
|
|
42
42
|
"azure-devops-extension-api": "^4.252.0",
|
|
43
43
|
"azure-devops-extension-sdk": "^4.0.2",
|
|
44
44
|
"azure-devops-node-api": "^15.1.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"shx": "^0.4.0",
|
|
60
60
|
"ts-jest": "^29.4.0",
|
|
61
61
|
"tsconfig-paths": "^4.2.0",
|
|
62
|
-
"typescript": "^5.
|
|
63
|
-
"typescript-eslint": "^8.
|
|
62
|
+
"typescript": "^5.9.3",
|
|
63
|
+
"typescript-eslint": "^8.45.0"
|
|
64
64
|
}
|
|
65
65
|
}
|