@octopusdeploy/mcp-server 1.0.0 → 1.1.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/README.md +56 -20
- package/dist/helpers/errorHandling.d.ts +35 -0
- package/dist/helpers/errorHandling.d.ts.map +1 -0
- package/dist/helpers/errorHandling.js +72 -0
- package/dist/helpers/errorHandling.js.map +1 -0
- package/dist/helpers/getClientConfigurationFromEnvironment.js +1 -1
- package/dist/helpers/getClientConfigurationFromEnvironment.js.map +1 -1
- package/dist/helpers/spaceResolver.d.ts +4 -0
- package/dist/helpers/spaceResolver.d.ts.map +1 -0
- package/dist/helpers/spaceResolver.js +18 -0
- package/dist/helpers/spaceResolver.js.map +1 -0
- package/dist/helpers/urlParser.d.ts +16 -0
- package/dist/helpers/urlParser.d.ts.map +1 -0
- package/dist/helpers/urlParser.js +83 -0
- package/dist/helpers/urlParser.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/tools/createRelease.d.ts +3 -0
- package/dist/tools/createRelease.d.ts.map +1 -0
- package/dist/tools/createRelease.js +108 -0
- package/dist/tools/createRelease.js.map +1 -0
- package/dist/tools/deployRelease.d.ts +3 -0
- package/dist/tools/deployRelease.d.ts.map +1 -0
- package/dist/tools/deployRelease.js +207 -0
- package/dist/tools/deployRelease.js.map +1 -0
- package/dist/tools/findAccounts.d.ts +3 -0
- package/dist/tools/findAccounts.d.ts.map +1 -0
- package/dist/tools/findAccounts.js +87 -0
- package/dist/tools/findAccounts.js.map +1 -0
- package/dist/tools/findCertificates.d.ts +3 -0
- package/dist/tools/findCertificates.d.ts.map +1 -0
- package/dist/tools/findCertificates.js +95 -0
- package/dist/tools/findCertificates.js.map +1 -0
- package/dist/tools/findDeploymentTargets.d.ts +3 -0
- package/dist/tools/findDeploymentTargets.d.ts.map +1 -0
- package/dist/tools/findDeploymentTargets.js +158 -0
- package/dist/tools/findDeploymentTargets.js.map +1 -0
- package/dist/tools/findReleases.d.ts +3 -0
- package/dist/tools/findReleases.d.ts.map +1 -0
- package/dist/tools/findReleases.js +96 -0
- package/dist/tools/findReleases.js.map +1 -0
- package/dist/tools/findTenants.d.ts +19 -0
- package/dist/tools/findTenants.d.ts.map +1 -0
- package/dist/tools/findTenants.js +130 -0
- package/dist/tools/findTenants.js.map +1 -0
- package/dist/tools/getBranches.d.ts.map +1 -1
- package/dist/tools/getBranches.js +38 -23
- package/dist/tools/getBranches.js.map +1 -1
- package/dist/tools/getCurrentUser.d.ts.map +1 -1
- package/dist/tools/getCurrentUser.js +27 -21
- package/dist/tools/getCurrentUser.js.map +1 -1
- package/dist/tools/getDeploymentFromUrl.d.ts +52 -0
- package/dist/tools/getDeploymentFromUrl.d.ts.map +1 -0
- package/dist/tools/getDeploymentFromUrl.js +134 -0
- package/dist/tools/getDeploymentFromUrl.js.map +1 -0
- package/dist/tools/getDeploymentProcess.d.ts.map +1 -1
- package/dist/tools/getDeploymentProcess.js +48 -13
- package/dist/tools/getDeploymentProcess.js.map +1 -1
- package/dist/tools/getKubernetesLiveStatus.d.ts.map +1 -1
- package/dist/tools/getKubernetesLiveStatus.js +57 -38
- package/dist/tools/getKubernetesLiveStatus.js.map +1 -1
- package/dist/tools/getMissingTenantVariables.d.ts.map +1 -1
- package/dist/tools/getMissingTenantVariables.js +45 -16
- package/dist/tools/getMissingTenantVariables.js.map +1 -1
- package/dist/tools/getTaskById.d.ts.map +1 -1
- package/dist/tools/getTaskById.js +24 -17
- package/dist/tools/getTaskById.js.map +1 -1
- package/dist/tools/getTaskDetails.d.ts +2 -2
- package/dist/tools/getTaskDetails.d.ts.map +1 -1
- package/dist/tools/getTaskDetails.js +48 -27
- package/dist/tools/getTaskDetails.js.map +1 -1
- package/dist/tools/getTaskFromUrl.d.ts +19 -0
- package/dist/tools/getTaskFromUrl.d.ts.map +1 -0
- package/dist/tools/getTaskFromUrl.js +90 -0
- package/dist/tools/getTaskFromUrl.js.map +1 -0
- package/dist/tools/getTaskRaw.d.ts.map +1 -1
- package/dist/tools/getTaskRaw.js +24 -17
- package/dist/tools/getTaskRaw.js.map +1 -1
- package/dist/tools/getTenantVariables.d.ts.map +1 -1
- package/dist/tools/getTenantVariables.js +45 -28
- package/dist/tools/getTenantVariables.js.map +1 -1
- package/dist/tools/index.d.ts +13 -14
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +19 -17
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/listDeployments.d.ts.map +1 -1
- package/dist/tools/listDeployments.js +55 -24
- package/dist/tools/listDeployments.js.map +1 -1
- package/dist/tools/listEnvironments.d.ts.map +1 -1
- package/dist/tools/listEnvironments.js +53 -30
- package/dist/tools/listEnvironments.js.map +1 -1
- package/dist/tools/listProjects.d.ts.map +1 -1
- package/dist/tools/listProjects.js +55 -32
- package/dist/tools/listProjects.js.map +1 -1
- package/dist/tools/listSpaces.d.ts.map +1 -1
- package/dist/tools/listSpaces.js +48 -25
- package/dist/tools/listSpaces.js.map +1 -1
- package/dist/types/tenantsTypes.d.ts +11 -0
- package/dist/types/tenantsTypes.d.ts.map +1 -1
- package/dist/types/tenantsTypes.js +1 -0
- package/dist/types/tenantsTypes.js.map +1 -1
- package/dist/utils/version.d.ts +2 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +3 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +9 -3
- package/dist/tools/getAccount.d.ts +0 -3
- package/dist/tools/getAccount.d.ts.map +0 -1
- package/dist/tools/getAccount.js +0 -40
- package/dist/tools/getAccount.js.map +0 -1
- package/dist/tools/getCertificate.d.ts +0 -3
- package/dist/tools/getCertificate.d.ts.map +0 -1
- package/dist/tools/getCertificate.js +0 -40
- package/dist/tools/getCertificate.js.map +0 -1
- package/dist/tools/getDeploymentTarget.d.ts +0 -3
- package/dist/tools/getDeploymentTarget.d.ts.map +0 -1
- package/dist/tools/getDeploymentTarget.js +0 -66
- package/dist/tools/getDeploymentTarget.js.map +0 -1
- package/dist/tools/getReleaseById.d.ts +0 -3
- package/dist/tools/getReleaseById.d.ts.map +0 -1
- package/dist/tools/getReleaseById.js +0 -45
- package/dist/tools/getReleaseById.js.map +0 -1
- package/dist/tools/getTenantById.d.ts +0 -3
- package/dist/tools/getTenantById.d.ts.map +0 -1
- package/dist/tools/getTenantById.js +0 -45
- package/dist/tools/getTenantById.js.map +0 -1
- package/dist/tools/listAccounts.d.ts +0 -3
- package/dist/tools/listAccounts.d.ts.map +0 -1
- package/dist/tools/listAccounts.js +0 -54
- package/dist/tools/listAccounts.js.map +0 -1
- package/dist/tools/listCertificates.d.ts +0 -3
- package/dist/tools/listCertificates.d.ts.map +0 -1
- package/dist/tools/listCertificates.js +0 -62
- package/dist/tools/listCertificates.js.map +0 -1
- package/dist/tools/listDeploymentTargets.d.ts +0 -3
- package/dist/tools/listDeploymentTargets.d.ts.map +0 -1
- package/dist/tools/listDeploymentTargets.js +0 -98
- package/dist/tools/listDeploymentTargets.js.map +0 -1
- package/dist/tools/listReleases.d.ts +0 -3
- package/dist/tools/listReleases.d.ts.map +0 -1
- package/dist/tools/listReleases.js +0 -54
- package/dist/tools/listReleases.js.map +0 -1
- package/dist/tools/listTenants.d.ts +0 -3
- package/dist/tools/listTenants.d.ts.map +0 -1
- package/dist/tools/listTenants.js +0 -64
- package/dist/tools/listTenants.js.map +0 -1
|
@@ -1,47 +1,70 @@
|
|
|
1
|
-
import { Client, EnvironmentRepository } from "@octopusdeploy/api-client";
|
|
1
|
+
import { Client, EnvironmentRepository, } from "@octopusdeploy/api-client";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
4
|
import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfigurationFromEnvironment.js";
|
|
5
5
|
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
6
|
+
import { handleOctopusApiError } from "../helpers/errorHandling.js";
|
|
6
7
|
export function registerListEnvironmentsTool(server) {
|
|
7
8
|
server.tool("list_environments", `List environments in a space
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
This tool lists all environments in a given space. The space name is required. Use this tool as early as possible to understand which environments are configured. Optionally filter by partial name match using partialName parameter.`, {
|
|
10
11
|
spaceName: z.string(),
|
|
11
12
|
partialName: z.string().optional(),
|
|
12
13
|
skip: z.number().optional(),
|
|
13
|
-
take: z.number().optional()
|
|
14
|
+
take: z.number().optional(),
|
|
14
15
|
}, {
|
|
15
16
|
title: "List all environments in an Octopus Deploy space",
|
|
16
17
|
readOnlyHint: true,
|
|
17
18
|
}, async ({ spaceName, partialName, skip, take }) => {
|
|
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
|
-
|
|
19
|
+
try {
|
|
20
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
21
|
+
const client = await Client.create(configuration);
|
|
22
|
+
const environmentRepository = new EnvironmentRepository(client, spaceName);
|
|
23
|
+
const environmentsResponse = await environmentRepository.list({
|
|
24
|
+
partialName,
|
|
25
|
+
skip,
|
|
26
|
+
take,
|
|
27
|
+
});
|
|
28
|
+
if (environmentsResponse.Items.length === 0) {
|
|
29
|
+
const message = partialName
|
|
30
|
+
? `No environments found matching '${partialName}' in space '${spaceName}'. Environment names are case-sensitive.`
|
|
31
|
+
: `No environments found in space '${spaceName}'. This space may not have any environments configured.`;
|
|
32
|
+
return {
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: "text",
|
|
36
|
+
text: message,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: JSON.stringify({
|
|
46
|
+
totalResults: environmentsResponse.TotalResults,
|
|
47
|
+
itemsPerPage: environmentsResponse.ItemsPerPage,
|
|
48
|
+
numberOfPages: environmentsResponse.NumberOfPages,
|
|
49
|
+
lastPageNumber: environmentsResponse.LastPageNumber,
|
|
50
|
+
items: environmentsResponse.Items.map((environment) => ({
|
|
51
|
+
spaceId: environment.SpaceId,
|
|
52
|
+
id: environment.Id,
|
|
53
|
+
name: environment.Name,
|
|
54
|
+
description: environment.Description,
|
|
55
|
+
sortOrder: environment.SortOrder,
|
|
56
|
+
useGuidedFailure: environment.UseGuidedFailure,
|
|
57
|
+
allowDynamicInfrastructure: environment.AllowDynamicInfrastructure,
|
|
58
|
+
extensionSettings: environment.ExtensionSettings,
|
|
59
|
+
})),
|
|
60
|
+
}),
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
handleOctopusApiError(error, { spaceName });
|
|
67
|
+
}
|
|
45
68
|
});
|
|
46
69
|
}
|
|
47
70
|
registerToolDefinition({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listEnvironments.js","sourceRoot":"","sources":["../../src/tools/listEnvironments.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"listEnvironments.js","sourceRoot":"","sources":["../../src/tools/listEnvironments.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,qBAAqB,GAEtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,qCAAqC,EAAE,MAAM,qDAAqD,CAAC;AAC5G,OAAO,EAAE,sBAAsB,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,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACnB,YAAY,EAAE,oBAAoB,CAAC,YAAY;4BAC/C,YAAY,EAAE,oBAAoB,CAAC,YAAY;4BAC/C,aAAa,EAAE,oBAAoB,CAAC,aAAa;4BACjD,cAAc,EAAE,oBAAoB,CAAC,cAAc;4BACnD,KAAK,EAAE,oBAAoB,CAAC,KAAK,CAAC,GAAG,CACnC,CAAC,WAAkC,EAAE,EAAE,CAAC,CAAC;gCACvC,OAAO,EAAE,WAAW,CAAC,OAAO;gCAC5B,EAAE,EAAE,WAAW,CAAC,EAAE;gCAClB,IAAI,EAAE,WAAW,CAAC,IAAI;gCACtB,WAAW,EAAE,WAAW,CAAC,WAAW;gCACpC,SAAS,EAAE,WAAW,CAAC,SAAS;gCAChC,gBAAgB,EAAE,WAAW,CAAC,gBAAgB;gCAC9C,0BAA0B,EACxB,WAAW,CAAC,0BAA0B;gCACxC,iBAAiB,EAAE,WAAW,CAAC,iBAAiB;6BACjD,CAAC,CACH;yBACF,CAAC;qBACH;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,qBAAqB,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,mBAAmB;IAC7B,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC3C,UAAU,EAAE,4BAA4B;CACzC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listProjects.d.ts","sourceRoot":"","sources":["../../src/tools/listProjects.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listProjects.d.ts","sourceRoot":"","sources":["../../src/tools/listProjects.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,QAyEzD"}
|
|
@@ -1,49 +1,72 @@
|
|
|
1
|
-
import { Client, ProjectRepository } from "@octopusdeploy/api-client";
|
|
1
|
+
import { Client, ProjectRepository, } from "@octopusdeploy/api-client";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
4
|
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
5
5
|
import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfigurationFromEnvironment.js";
|
|
6
6
|
import { projectsDescription } from "../types/projectTypes.js";
|
|
7
|
+
import { handleOctopusApiError } from "../helpers/errorHandling.js";
|
|
7
8
|
export function registerListProjectsTool(server) {
|
|
8
9
|
server.tool("list_projects", `This tool lists all projects in a given space. ${projectsDescription} The space name is required, if you can't find the space name, ask the user directly for the name of the space. Optionally filter by partial name match using partialName parameter.`, {
|
|
9
10
|
spaceName: z.string(),
|
|
10
11
|
partialName: z.string().optional(),
|
|
11
12
|
skip: z.number().optional(),
|
|
12
|
-
take: z.number().optional()
|
|
13
|
+
take: z.number().optional(),
|
|
13
14
|
}, {
|
|
14
15
|
title: "List all projects in an Octopus Deploy space",
|
|
15
16
|
readOnlyHint: true,
|
|
16
17
|
}, async ({ spaceName, partialName, skip, take }) => {
|
|
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
|
-
|
|
18
|
+
try {
|
|
19
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
20
|
+
const client = await Client.create(configuration);
|
|
21
|
+
const projectRepository = new ProjectRepository(client, spaceName);
|
|
22
|
+
const projectsResponse = await projectRepository.list({
|
|
23
|
+
partialName,
|
|
24
|
+
skip,
|
|
25
|
+
take,
|
|
26
|
+
});
|
|
27
|
+
if (projectsResponse.Items.length === 0) {
|
|
28
|
+
const message = partialName
|
|
29
|
+
? `No projects found matching '${partialName}' in space '${spaceName}'. Project names are case-sensitive.`
|
|
30
|
+
: `No projects found in space '${spaceName}'. This space may be empty or you may not have permission to view projects.`;
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: message,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
content: [
|
|
42
|
+
{
|
|
43
|
+
type: "text",
|
|
44
|
+
text: JSON.stringify({
|
|
45
|
+
totalResults: projectsResponse.TotalResults,
|
|
46
|
+
itemsPerPage: projectsResponse.ItemsPerPage,
|
|
47
|
+
numberOfPages: projectsResponse.NumberOfPages,
|
|
48
|
+
lastPageNumber: projectsResponse.LastPageNumber,
|
|
49
|
+
items: projectsResponse.Items.map((project) => ({
|
|
50
|
+
spaceId: project.SpaceId,
|
|
51
|
+
id: project.Id,
|
|
52
|
+
name: project.Name,
|
|
53
|
+
description: project.Description,
|
|
54
|
+
slug: project.Slug,
|
|
55
|
+
deploymentProcessId: project.DeploymentProcessId,
|
|
56
|
+
lifecycleId: project.LifecycleId,
|
|
57
|
+
isDisabled: project.IsDisabled,
|
|
58
|
+
repositoryUrl: project.PersistenceSettings.Type === "VersionControlled"
|
|
59
|
+
? project.PersistenceSettings.Url
|
|
60
|
+
: null,
|
|
61
|
+
})),
|
|
62
|
+
}),
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
handleOctopusApiError(error, { spaceName });
|
|
69
|
+
}
|
|
47
70
|
});
|
|
48
71
|
}
|
|
49
72
|
registerToolDefinition({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listProjects.js","sourceRoot":"","sources":["../../src/tools/listProjects.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"listProjects.js","sourceRoot":"","sources":["../../src/tools/listProjects.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,iBAAiB,GAElB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qCAAqC,EAAE,MAAM,qDAAqD,CAAC;AAC5G,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,MAAM,CAAC,IAAI,CACT,eAAe,EACf,kDAAkD,mBAAmB,sLAAsL,EAC3P;QACE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAClC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC5B,EACD;QACE,KAAK,EAAE,8CAA8C;QACrD,YAAY,EAAE,IAAI;KACnB,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE;QAC/C,IAAI,CAAC;YACH,MAAM,aAAa,GAAG,qCAAqC,EAAE,C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AAU,EAAE,OAAO,CAAC,UAAU;gCAC9B,aAAa,EACX,OAAO,CAAC,mBAAmB,CAAC,IAAI,KAAK,mBAAmB;oCACtD,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG;oCACjC,CAAC,CAAC,IAAI;6BACX,CAAC,CAAC;yBACJ,CAAC;qBACH;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,qBAAqB,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,eAAe;IACzB,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC/C,UAAU,EAAE,wBAAwB;CACrC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listSpaces.d.ts","sourceRoot":"","sources":["../../src/tools/listSpaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"listSpaces.d.ts","sourceRoot":"","sources":["../../src/tools/listSpaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,QAiEvD"}
|
package/dist/tools/listSpaces.js
CHANGED
|
@@ -4,39 +4,62 @@ import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfi
|
|
|
4
4
|
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
5
|
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
6
6
|
import { spacesDescription } from "../types/spaceTypes.js";
|
|
7
|
+
import { handleOctopusApiError } from "../helpers/errorHandling.js";
|
|
7
8
|
export function registerListSpacesTool(server) {
|
|
8
9
|
server.tool("list_spaces", `List all spaces in the Octopus Deploy instance. ${spacesDescription} Always use this tool first to check that the requested space exists.`, {
|
|
9
10
|
partialName: z.string().optional(),
|
|
10
11
|
skip: z.number().optional(),
|
|
11
|
-
take: z.number().optional()
|
|
12
|
+
take: z.number().optional(),
|
|
12
13
|
}, {
|
|
13
14
|
title: "List all spaces in an Octopus Deploy instance",
|
|
14
15
|
readOnlyHint: true,
|
|
15
16
|
}, async ({ partialName, skip, take }) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
17
|
+
try {
|
|
18
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
19
|
+
const client = await Client.create(configuration);
|
|
20
|
+
const spaceRepository = new SpaceRepository(client);
|
|
21
|
+
const spacesResponse = await spaceRepository.list({
|
|
22
|
+
partialName,
|
|
23
|
+
skip,
|
|
24
|
+
take,
|
|
25
|
+
});
|
|
26
|
+
if (spacesResponse.Items.length === 0) {
|
|
27
|
+
const message = partialName
|
|
28
|
+
? `No spaces found matching '${partialName}'. Space names are case-sensitive.`
|
|
29
|
+
: "No spaces found. This may indicate a configuration or permission issue.";
|
|
30
|
+
return {
|
|
31
|
+
content: [
|
|
32
|
+
{
|
|
33
|
+
type: "text",
|
|
34
|
+
text: message,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
content: [
|
|
41
|
+
{
|
|
42
|
+
type: "text",
|
|
43
|
+
text: JSON.stringify({
|
|
44
|
+
totalResults: spacesResponse.TotalResults,
|
|
45
|
+
itemsPerPage: spacesResponse.ItemsPerPage,
|
|
46
|
+
numberOfPages: spacesResponse.NumberOfPages,
|
|
47
|
+
lastPageNumber: spacesResponse.LastPageNumber,
|
|
48
|
+
items: spacesResponse.Items.map((space) => ({
|
|
49
|
+
id: space.Id,
|
|
50
|
+
name: space.Name,
|
|
51
|
+
description: space.Description,
|
|
52
|
+
isDefault: space.IsDefault,
|
|
53
|
+
taskQueueStopped: space.TaskQueueStopped,
|
|
54
|
+
})),
|
|
55
|
+
}),
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
handleOctopusApiError(error, {});
|
|
62
|
+
}
|
|
40
63
|
});
|
|
41
64
|
}
|
|
42
65
|
registerToolDefinition({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listSpaces.js","sourceRoot":"","sources":["../../src/tools/listSpaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qCAAqC,EAAE,MAAM,qDAAqD,CAAC;AAC5G,OAAO,EAAkB,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"listSpaces.js","sourceRoot":"","sources":["../../src/tools/listSpaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qCAAqC,EAAE,MAAM,qDAAqD,CAAC;AAC5G,OAAO,EAAkB,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,O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AS,CAAC;4BACnB,YAAY,EAAE,cAAc,CAAC,YAAY;4BACzC,YAAY,EAAE,cAAc,CAAC,YAAY;4BACzC,aAAa,EAAE,cAAc,CAAC,aAAa;4BAC3C,cAAc,EAAE,cAAc,CAAC,cAAc;4BAC7C,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gCAC1C,EAAE,EAAE,KAAK,CAAC,EAAE;gCACZ,IAAI,EAAE,KAAK,CAAC,IAAI;gCAChB,WAAW,EAAE,KAAK,CAAC,WAAW;gCAC9B,SAAS,EAAE,KAAK,CAAC,SAAS;gCAC1B,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;6BACzC,CAAC,CAAC;yBACJ,CAAC;qBACH;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,qBAAqB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC3C,UAAU,EAAE,sBAAsB;CACnC,CAAC,CAAC"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
+
import { type NamedResource, type SpaceScopedResource } from "./baseResource.js";
|
|
1
2
|
export declare const tenantsDescription = "Tenants represent customers or clients in Octopus Deploy, allowing you to manage deployments and configurations specific to each tenant. Tenants can be grouped into tenant tags for easier management and deployment targeting. Tenants can also represent geographical locations, organizational units, or any other logical grouping.";
|
|
3
|
+
export interface TenantResource extends SpaceScopedResource, NamedResource {
|
|
4
|
+
IsDisabled: boolean | undefined;
|
|
5
|
+
Slug: string;
|
|
6
|
+
Description: string | null;
|
|
7
|
+
ClonedFromTenantId: string | null;
|
|
8
|
+
TenantTags: string[];
|
|
9
|
+
ProjectEnvironments: {
|
|
10
|
+
[projectId: string]: string[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
2
13
|
//# sourceMappingURL=tenantsTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenantsTypes.d.ts","sourceRoot":"","sources":["../../src/types/tenantsTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,6UAA6U,CAAC"}
|
|
1
|
+
{"version":3,"file":"tenantsTypes.d.ts","sourceRoot":"","sources":["../../src/types/tenantsTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEjF,eAAO,MAAM,kBAAkB,6UAA6U,CAAC;AAE7W,MAAM,WAAW,cAAe,SAAQ,mBAAmB,EAAE,aAAa;IACtE,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,mBAAmB,EAAE;QACjB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;KACjC,CAAC;CACL"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import {} from "./baseResource.js";
|
|
1
2
|
export const tenantsDescription = "Tenants represent customers or clients in Octopus Deploy, allowing you to manage deployments and configurations specific to each tenant. Tenants can be grouped into tenant tags for easier management and deployment targeting. Tenants can also represent geographical locations, organizational units, or any other logical grouping.";
|
|
2
3
|
//# sourceMappingURL=tenantsTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenantsTypes.js","sourceRoot":"","sources":["../../src/types/tenantsTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,0UAA0U,CAAC"}
|
|
1
|
+
{"version":3,"file":"tenantsTypes.js","sourceRoot":"","sources":["../../src/types/tenantsTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,MAAM,mBAAmB,CAAC;AAEjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,0UAA0U,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,QAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEnE,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"bugs": {
|
|
5
5
|
"url": "https://github.com/OctopusDeploy/mcp-server/issues"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.1.0",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"description": "The Octopus MCP Server provides your AI assistant with powerful tools that allow it to inspect, query, and diagnose problems within your Octopus instance.",
|
|
10
10
|
"main": "dist/index.js",
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
"build": "tsc && shx chmod +x dist/*.js",
|
|
21
21
|
"dev": "nodemon --quiet --exec \"tsc && node dist/index.js\" --ext ts --watch src",
|
|
22
22
|
"lint": "eslint src --ext .ts",
|
|
23
|
-
"lint:fix": "eslint src --ext .ts --fix"
|
|
23
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
24
|
+
"test": "vitest run --reporter=verbose",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"test:coverage": "vitest run --coverage"
|
|
24
27
|
},
|
|
25
28
|
"keywords": [
|
|
26
29
|
"octopus deploy",
|
|
@@ -47,12 +50,15 @@
|
|
|
47
50
|
"devDependencies": {
|
|
48
51
|
"@eslint/js": "^9.35.0",
|
|
49
52
|
"@types/node": "^24.3.1",
|
|
53
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
54
|
+
"@vitest/ui": "^2.1.8",
|
|
50
55
|
"eslint": "^9.35.0",
|
|
51
56
|
"globals": "^16.3.0",
|
|
52
57
|
"jiti": "^2.5.1",
|
|
53
58
|
"nodemon": "^3.1.10",
|
|
54
59
|
"shx": "^0.4.0",
|
|
55
60
|
"typescript": "^5.9.2",
|
|
56
|
-
"typescript-eslint": "^8.42.0"
|
|
61
|
+
"typescript-eslint": "^8.42.0",
|
|
62
|
+
"vitest": "^2.1.8"
|
|
57
63
|
}
|
|
58
64
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getAccount.d.ts","sourceRoot":"","sources":["../../src/tools/getAccount.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQzE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,QAuCvD"}
|
package/dist/tools/getAccount.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Client, resolveSpaceId } from "@octopusdeploy/api-client";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
-
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
5
|
-
import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfigurationFromEnvironment.js";
|
|
6
|
-
import { mapAccountResource } from "../types/accountTypes.js";
|
|
7
|
-
export function registerGetAccountTool(server) {
|
|
8
|
-
server.tool("get_account", `Get details for a specific account by its ID
|
|
9
|
-
|
|
10
|
-
This tool retrieves detailed information about a specific account using its ID. The space name and account ID are both required.`, {
|
|
11
|
-
spaceName: z.string(),
|
|
12
|
-
accountId: z.string().describe("The ID of the account to retrieve"),
|
|
13
|
-
}, {
|
|
14
|
-
title: "Get a specific account by ID from an Octopus Deploy space",
|
|
15
|
-
readOnlyHint: true,
|
|
16
|
-
}, async ({ spaceName, accountId }) => {
|
|
17
|
-
const configuration = getClientConfigurationFromEnvironment();
|
|
18
|
-
const client = await Client.create(configuration);
|
|
19
|
-
const spaceId = await resolveSpaceId(client, spaceName);
|
|
20
|
-
const response = await client.get("~/api/{spaceId}/accounts/{id}", {
|
|
21
|
-
spaceId,
|
|
22
|
-
id: accountId,
|
|
23
|
-
});
|
|
24
|
-
const account = mapAccountResource(response);
|
|
25
|
-
return {
|
|
26
|
-
content: [
|
|
27
|
-
{
|
|
28
|
-
type: "text",
|
|
29
|
-
text: JSON.stringify(account),
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
registerToolDefinition({
|
|
36
|
-
toolName: "get_account",
|
|
37
|
-
config: { toolset: "accounts", readOnly: true },
|
|
38
|
-
registerFn: registerGetAccountTool,
|
|
39
|
-
});
|
|
40
|
-
//# sourceMappingURL=getAccount.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getAccount.js","sourceRoot":"","sources":["../../src/tools/getAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qCAAqC,EAAE,MAAM,qDAAqD,CAAC;AAC5G,OAAO,EAEL,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC,MAAM,UAAU,sBAAsB,CAAC,MAAiB;IACtD,MAAM,CAAC,IAAI,CACT,aAAa,EACb;;iIAE6H,EAC7H;QACE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;KACpE,EACD;QACE,KAAK,EAAE,2DAA2D;QAClE,YAAY,EAAE,IAAI;KACnB,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE;QACjC,MAAM,aAAa,GAAG,qCAAqC,EAAE,CAAC;QAC9D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAClD,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAExD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAC/B,+BAA+B,EAC/B;YACE,OAAO;YACP,EAAE,EAAE,SAAS;SACd,CACF,CAAC;QAEF,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAE7C,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;iBAC9B;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC/C,UAAU,EAAE,sBAAsB;CACnC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCertificate.d.ts","sourceRoot":"","sources":["../../src/tools/getCertificate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,QAuC3D"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Client, resolveSpaceId } from "@octopusdeploy/api-client";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
-
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
5
|
-
import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfigurationFromEnvironment.js";
|
|
6
|
-
import { mapCertificateResource } from "../types/certificateTypes.js";
|
|
7
|
-
export function registerGetCertificateTool(server) {
|
|
8
|
-
server.tool("get_certificate", `Get details for a specific certificate by its ID
|
|
9
|
-
|
|
10
|
-
This tool retrieves detailed information about a specific certificate using its ID. The space name and certificate ID are both required.`, {
|
|
11
|
-
spaceName: z.string(),
|
|
12
|
-
certificateId: z.string().describe("The ID of the certificate to retrieve"),
|
|
13
|
-
}, {
|
|
14
|
-
title: "Get a specific certificate by ID from an Octopus Deploy space",
|
|
15
|
-
readOnlyHint: true,
|
|
16
|
-
}, async ({ spaceName, certificateId }) => {
|
|
17
|
-
const configuration = getClientConfigurationFromEnvironment();
|
|
18
|
-
const client = await Client.create(configuration);
|
|
19
|
-
const spaceId = await resolveSpaceId(client, spaceName);
|
|
20
|
-
const response = await client.get("~/api/{spaceId}/certificates/{id}", {
|
|
21
|
-
spaceId,
|
|
22
|
-
id: certificateId,
|
|
23
|
-
});
|
|
24
|
-
const certificate = mapCertificateResource(response);
|
|
25
|
-
return {
|
|
26
|
-
content: [
|
|
27
|
-
{
|
|
28
|
-
type: "text",
|
|
29
|
-
text: JSON.stringify(certificate),
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
registerToolDefinition({
|
|
36
|
-
toolName: "get_certificate",
|
|
37
|
-
config: { toolset: "certificates", readOnly: true },
|
|
38
|
-
registerFn: registerGetCertificateTool,
|
|
39
|
-
});
|
|
40
|
-
//# sourceMappingURL=getCertificate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCertificate.js","sourceRoot":"","sources":["../../src/tools/getCertificate.ts"],"names":[],"mappings":"AA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,iBAAiB;IAC3B,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE;IACnD,UAAU,EAAE,0BAA0B;CACvC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDeploymentTarget.d.ts","sourceRoot":"","sources":["../../src/tools/getDeploymentTarget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,SAAS,QAiEhE"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Client, resolveSpaceId } from "@octopusdeploy/api-client";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
-
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
5
|
-
import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfigurationFromEnvironment.js";
|
|
6
|
-
import {} from "../types/deploymentTargetTypes.js";
|
|
7
|
-
export function registerGetDeploymentTargetTool(server) {
|
|
8
|
-
server.tool("get_deployment_target", `Get a specific deployment target (machine) by ID
|
|
9
|
-
|
|
10
|
-
This tool retrieves detailed information about a specific deployment target using its ID. The space name and target ID are both required.`, {
|
|
11
|
-
spaceName: z.string(),
|
|
12
|
-
targetId: z.string(),
|
|
13
|
-
}, {
|
|
14
|
-
title: "Get a specific deployment target from an Octopus Deploy space",
|
|
15
|
-
readOnlyHint: true,
|
|
16
|
-
}, async ({ spaceName, targetId }) => {
|
|
17
|
-
const configuration = getClientConfigurationFromEnvironment();
|
|
18
|
-
const client = await Client.create(configuration);
|
|
19
|
-
const spaceId = await resolveSpaceId(client, spaceName);
|
|
20
|
-
const target = await client.get("~/api/{spaceId}/machines/{id}", {
|
|
21
|
-
spaceId,
|
|
22
|
-
id: targetId,
|
|
23
|
-
});
|
|
24
|
-
const deploymentTarget = {
|
|
25
|
-
spaceId: target.SpaceId,
|
|
26
|
-
id: target.Id,
|
|
27
|
-
name: target.Name,
|
|
28
|
-
slug: target.Slug,
|
|
29
|
-
isDisabled: target.IsDisabled,
|
|
30
|
-
healthStatus: target.HealthStatus,
|
|
31
|
-
statusSummary: target.StatusSummary,
|
|
32
|
-
environmentIds: target.EnvironmentIds,
|
|
33
|
-
roles: target.Roles,
|
|
34
|
-
tenantedDeploymentParticipation: target.TenantedDeploymentParticipation,
|
|
35
|
-
tenantIds: target.TenantIds,
|
|
36
|
-
tenantTags: target.TenantTags,
|
|
37
|
-
endpoint: {
|
|
38
|
-
id: target.Endpoint.Id,
|
|
39
|
-
communicationStyle: target.Endpoint.CommunicationStyle,
|
|
40
|
-
uri: target.Endpoint.Uri,
|
|
41
|
-
fingerprint: target.Endpoint.Fingerprint,
|
|
42
|
-
proxyId: target.Endpoint.ProxyId,
|
|
43
|
-
tentacleVersionDetails: target.Endpoint.TentacleVersionDetails,
|
|
44
|
-
},
|
|
45
|
-
shellName: target.ShellName,
|
|
46
|
-
machinePolicyId: target.MachinePolicyId,
|
|
47
|
-
hasLatestCalamari: target.HasLatestCalamari,
|
|
48
|
-
isInProcess: target.IsInProcess,
|
|
49
|
-
links: target.Links,
|
|
50
|
-
};
|
|
51
|
-
return {
|
|
52
|
-
content: [
|
|
53
|
-
{
|
|
54
|
-
type: "text",
|
|
55
|
-
text: JSON.stringify(deploymentTarget),
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
registerToolDefinition({
|
|
62
|
-
toolName: "get_deployment_target",
|
|
63
|
-
config: { toolset: "machines", readOnly: true },
|
|
64
|
-
registerFn: registerGetDeploymentTargetTool,
|
|
65
|
-
});
|
|
66
|
-
//# sourceMappingURL=getDeploymentTarget.js.map
|