@azure-devops/mcp 1.2.0 → 1.3.0
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 +30 -145
- package/dist/shared/tool-validation.js +92 -0
- package/dist/tools/advsec.js +108 -0
- package/dist/tools/core.test.js +1 -0
- package/dist/tools/repos.js +181 -19
- package/dist/tools/search.js +15 -15
- package/dist/tools/testplan.test.js +125 -0
- package/dist/tools/testplans.js +8 -4
- package/dist/tools/utils.js +6 -0
- package/dist/tools/wiki.test.js +87 -0
- package/dist/tools/workitem.test.js +101 -0
- package/dist/tools/workitems.js +88 -57
- package/dist/tools/workitems.test.js +530 -0
- package/dist/tools.js +8 -6
- package/dist/utils.js +26 -0
- package/dist/version.js +1 -1
- package/package.json +4 -2
- package/dist/http.js +0 -52
- package/dist/server.js +0 -36
package/dist/server.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
-
import * as azdev from "azure-devops-node-api";
|
|
5
|
-
import { DefaultAzureCredential } from "@azure/identity";
|
|
6
|
-
import { configurePrompts } from "./prompts.js";
|
|
7
|
-
import { configureAllTools } from "./tools.js";
|
|
8
|
-
import { userAgent } from "./utils.js";
|
|
9
|
-
import { packageVersion } from "./version.js";
|
|
10
|
-
async function getAzureDevOpsToken() {
|
|
11
|
-
process.env.AZURE_TOKEN_CREDENTIALS = "dev";
|
|
12
|
-
const credential = new DefaultAzureCredential(); // CodeQL [SM05138] resolved by explicitly setting AZURE_TOKEN_CREDENTIALS
|
|
13
|
-
const token = await credential.getToken("499b84ac-1321-427f-aa17-267ca6975798/.default");
|
|
14
|
-
return token;
|
|
15
|
-
}
|
|
16
|
-
async function getAzureDevOpsClient(orgUrl) {
|
|
17
|
-
const token = await getAzureDevOpsToken();
|
|
18
|
-
const authHandler = azdev.getBearerHandler(token.token);
|
|
19
|
-
const connection = new azdev.WebApi(orgUrl, authHandler, undefined, {
|
|
20
|
-
productName: "AzureDevOps.MCP",
|
|
21
|
-
productVersion: packageVersion,
|
|
22
|
-
userAgent: userAgent
|
|
23
|
-
});
|
|
24
|
-
return connection;
|
|
25
|
-
}
|
|
26
|
-
export async function serverBuildAndConnect(orgName, transport) {
|
|
27
|
-
const server = new McpServer({
|
|
28
|
-
name: "Azure DevOps MCP Server",
|
|
29
|
-
version: packageVersion,
|
|
30
|
-
});
|
|
31
|
-
const orgUrl = "https://dev.azure.com/" + orgName;
|
|
32
|
-
configurePrompts(server);
|
|
33
|
-
configureAllTools(server, () => orgName, getAzureDevOpsToken, () => getAzureDevOpsClient(orgUrl));
|
|
34
|
-
await server.connect(transport);
|
|
35
|
-
return server;
|
|
36
|
-
}
|