@octopusdeploy/mcp-server 0.1.2
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 +373 -0
- package/README.md +210 -0
- package/dist/helpers/getClientConfigurationFromEnvironment.d.ts +7 -0
- package/dist/helpers/getClientConfigurationFromEnvironment.d.ts.map +1 -0
- package/dist/helpers/getClientConfigurationFromEnvironment.js +31 -0
- package/dist/helpers/getClientConfigurationFromEnvironment.js.map +1 -0
- package/dist/helpers/getPublicUrl.d.ts +2 -0
- package/dist/helpers/getPublicUrl.d.ts.map +1 -0
- package/dist/helpers/getPublicUrl.js +4 -0
- package/dist/helpers/getPublicUrl.js.map +1 -0
- package/dist/helpers/vcsProjectHelpers.d.ts +4 -0
- package/dist/helpers/vcsProjectHelpers.d.ts.map +1 -0
- package/dist/helpers/vcsProjectHelpers.js +21 -0
- package/dist/helpers/vcsProjectHelpers.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/index.d.ts +3 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +4 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/spacesResource.d.ts +3 -0
- package/dist/resources/spacesResource.d.ts.map +1 -0
- package/dist/resources/spacesResource.js +54 -0
- package/dist/resources/spacesResource.js.map +1 -0
- package/dist/tools/getBranches.d.ts +3 -0
- package/dist/tools/getBranches.d.ts.map +1 -0
- package/dist/tools/getBranches.js +55 -0
- package/dist/tools/getBranches.js.map +1 -0
- package/dist/tools/getCurrentUser.d.ts +3 -0
- package/dist/tools/getCurrentUser.d.ts.map +1 -0
- package/dist/tools/getCurrentUser.js +40 -0
- package/dist/tools/getCurrentUser.js.map +1 -0
- package/dist/tools/getDeploymentProcess.d.ts +3 -0
- package/dist/tools/getDeploymentProcess.d.ts.map +1 -0
- package/dist/tools/getDeploymentProcess.js +91 -0
- package/dist/tools/getDeploymentProcess.js.map +1 -0
- package/dist/tools/getDeploymentTarget.d.ts +3 -0
- package/dist/tools/getDeploymentTarget.d.ts.map +1 -0
- package/dist/tools/getDeploymentTarget.js +66 -0
- package/dist/tools/getDeploymentTarget.js.map +1 -0
- package/dist/tools/getKubernetesLiveStatus.d.ts +3 -0
- package/dist/tools/getKubernetesLiveStatus.d.ts.map +1 -0
- package/dist/tools/getKubernetesLiveStatus.js +64 -0
- package/dist/tools/getKubernetesLiveStatus.js.map +1 -0
- package/dist/tools/getLatestDeployment.d.ts +3 -0
- package/dist/tools/getLatestDeployment.d.ts.map +1 -0
- package/dist/tools/getLatestDeployment.js +85 -0
- package/dist/tools/getLatestDeployment.js.map +1 -0
- package/dist/tools/getMissingTenantVariables.d.ts +3 -0
- package/dist/tools/getMissingTenantVariables.d.ts.map +1 -0
- package/dist/tools/getMissingTenantVariables.js +47 -0
- package/dist/tools/getMissingTenantVariables.js.map +1 -0
- package/dist/tools/getReleaseById.d.ts +3 -0
- package/dist/tools/getReleaseById.d.ts.map +1 -0
- package/dist/tools/getReleaseById.js +45 -0
- package/dist/tools/getReleaseById.js.map +1 -0
- package/dist/tools/getTaskById.d.ts +9 -0
- package/dist/tools/getTaskById.d.ts.map +1 -0
- package/dist/tools/getTaskById.js +44 -0
- package/dist/tools/getTaskById.js.map +1 -0
- package/dist/tools/getTaskDetails.d.ts +9 -0
- package/dist/tools/getTaskDetails.d.ts.map +1 -0
- package/dist/tools/getTaskDetails.js +44 -0
- package/dist/tools/getTaskDetails.js.map +1 -0
- package/dist/tools/getTaskRaw.d.ts +9 -0
- package/dist/tools/getTaskRaw.d.ts.map +1 -0
- package/dist/tools/getTaskRaw.js +43 -0
- package/dist/tools/getTaskRaw.js.map +1 -0
- package/dist/tools/getTenantById.d.ts +3 -0
- package/dist/tools/getTenantById.d.ts.map +1 -0
- package/dist/tools/getTenantById.js +45 -0
- package/dist/tools/getTenantById.js.map +1 -0
- package/dist/tools/getTenantVariables.d.ts +3 -0
- package/dist/tools/getTenantVariables.d.ts.map +1 -0
- package/dist/tools/getTenantVariables.js +58 -0
- package/dist/tools/getTenantVariables.js.map +1 -0
- package/dist/tools/index.d.ts +24 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +49 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/listDeploymentTargets.d.ts +3 -0
- package/dist/tools/listDeploymentTargets.d.ts.map +1 -0
- package/dist/tools/listDeploymentTargets.js +98 -0
- package/dist/tools/listDeploymentTargets.js.map +1 -0
- package/dist/tools/listDeployments.d.ts +3 -0
- package/dist/tools/listDeployments.d.ts.map +1 -0
- package/dist/tools/listDeployments.js +70 -0
- package/dist/tools/listDeployments.js.map +1 -0
- package/dist/tools/listEnvironments.d.ts +3 -0
- package/dist/tools/listEnvironments.d.ts.map +1 -0
- package/dist/tools/listEnvironments.js +42 -0
- package/dist/tools/listEnvironments.js.map +1 -0
- package/dist/tools/listProjects.d.ts +3 -0
- package/dist/tools/listProjects.d.ts.map +1 -0
- package/dist/tools/listProjects.js +44 -0
- package/dist/tools/listProjects.js.map +1 -0
- package/dist/tools/listReleases.d.ts +3 -0
- package/dist/tools/listReleases.d.ts.map +1 -0
- package/dist/tools/listReleases.js +54 -0
- package/dist/tools/listReleases.js.map +1 -0
- package/dist/tools/listReleasesForProject.d.ts +3 -0
- package/dist/tools/listReleasesForProject.d.ts.map +1 -0
- package/dist/tools/listReleasesForProject.js +60 -0
- package/dist/tools/listReleasesForProject.js.map +1 -0
- package/dist/tools/listSpaces.d.ts +3 -0
- package/dist/tools/listSpaces.d.ts.map +1 -0
- package/dist/tools/listSpaces.js +38 -0
- package/dist/tools/listSpaces.js.map +1 -0
- package/dist/tools/listTenants.d.ts +3 -0
- package/dist/tools/listTenants.d.ts.map +1 -0
- package/dist/tools/listTenants.js +64 -0
- package/dist/tools/listTenants.js.map +1 -0
- package/dist/types/baseResource.d.ts +14 -0
- package/dist/types/baseResource.d.ts.map +1 -0
- package/dist/types/baseResource.js +3 -0
- package/dist/types/baseResource.js.map +1 -0
- package/dist/types/deploymentProcessTypes.d.ts +33 -0
- package/dist/types/deploymentProcessTypes.d.ts.map +1 -0
- package/dist/types/deploymentProcessTypes.js +20 -0
- package/dist/types/deploymentProcessTypes.js.map +1 -0
- package/dist/types/deploymentTargetTypes.d.ts +74 -0
- package/dist/types/deploymentTargetTypes.d.ts.map +1 -0
- package/dist/types/deploymentTargetTypes.js +32 -0
- package/dist/types/deploymentTargetTypes.js.map +1 -0
- package/dist/types/gitBranchTypes.d.ts +11 -0
- package/dist/types/gitBranchTypes.d.ts.map +1 -0
- package/dist/types/gitBranchTypes.js +2 -0
- package/dist/types/gitBranchTypes.js.map +1 -0
- package/dist/types/projectTypes.d.ts +2 -0
- package/dist/types/projectTypes.d.ts.map +1 -0
- package/dist/types/projectTypes.js +2 -0
- package/dist/types/projectTypes.js.map +1 -0
- package/dist/types/resourceCollection.d.ts +9 -0
- package/dist/types/resourceCollection.d.ts.map +1 -0
- package/dist/types/resourceCollection.js +2 -0
- package/dist/types/resourceCollection.js.map +1 -0
- package/dist/types/spaceTypes.d.ts +2 -0
- package/dist/types/spaceTypes.d.ts.map +1 -0
- package/dist/types/spaceTypes.js +2 -0
- package/dist/types/spaceTypes.js.map +1 -0
- package/dist/types/taskTypes.d.ts +2 -0
- package/dist/types/taskTypes.d.ts.map +1 -0
- package/dist/types/taskTypes.js +2 -0
- package/dist/types/taskTypes.js.map +1 -0
- package/dist/types/tenantsTypes.d.ts +2 -0
- package/dist/types/tenantsTypes.d.ts.map +1 -0
- package/dist/types/tenantsTypes.js +2 -0
- package/dist/types/tenantsTypes.js.map +1 -0
- package/dist/types/toolConfig.d.ts +19 -0
- package/dist/types/toolConfig.d.ts.map +1 -0
- package/dist/types/toolConfig.js +17 -0
- package/dist/types/toolConfig.js.map +1 -0
- package/dist/utils/clientInfo.d.ts +20 -0
- package/dist/utils/clientInfo.d.ts.map +1 -0
- package/dist/utils/clientInfo.js +23 -0
- package/dist/utils/clientInfo.js.map +1 -0
- package/dist/utils/logger.d.ts +45 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +130 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/parseConfig.d.ts +4 -0
- package/dist/utils/parseConfig.d.ts.map +1 -0
- package/dist/utils/parseConfig.js +21 -0
- package/dist/utils/parseConfig.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Client, DeploymentRepository, SpaceServerTaskRepository } from "@octopusdeploy/api-client";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfigurationFromEnvironment.js";
|
|
5
|
+
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
6
|
+
import { logger } from "../utils/logger.js";
|
|
7
|
+
// TODO: review if this tool is needed, it should be possible for a competent model to retrieve this details by using the underlying tools
|
|
8
|
+
export function registerGetLatestDeploymentTool(server) {
|
|
9
|
+
server.tool("get_latest_deployment", `Get details for the latest deployment of a project
|
|
10
|
+
|
|
11
|
+
This tool finds the most recent deployment for a given project in a space and returns the deployment details along with the server task information.`, { spaceName: z.string(), projectId: z.string() }, {
|
|
12
|
+
title: "Get latest deployment details for an Octopus Deploy project",
|
|
13
|
+
readOnlyHint: true,
|
|
14
|
+
}, async ({ spaceName, projectId }) => {
|
|
15
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
16
|
+
const client = await Client.create(configuration);
|
|
17
|
+
const deploymentRepository = new DeploymentRepository(client, spaceName);
|
|
18
|
+
const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName);
|
|
19
|
+
// Get all deployments for the project, sorted by creation date descending
|
|
20
|
+
const deploymentsResponse = await deploymentRepository.list({
|
|
21
|
+
projects: [projectId]
|
|
22
|
+
});
|
|
23
|
+
if (deploymentsResponse.Items.length === 0) {
|
|
24
|
+
return {
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: "text",
|
|
28
|
+
text: JSON.stringify({ error: `No deployments found for project ${projectId}` }),
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// Sort deployments by created date to get the latest
|
|
34
|
+
const latestDeployment = deploymentsResponse.Items.sort((a, b) => new Date(b.Created).getTime() - new Date(a.Created).getTime())[0];
|
|
35
|
+
// Get the server task details for the deployment
|
|
36
|
+
let taskDetails = null;
|
|
37
|
+
if (latestDeployment.TaskId) {
|
|
38
|
+
try {
|
|
39
|
+
taskDetails = await serverTaskRepository.getDetails(latestDeployment.TaskId);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
logger.error(`Error getting task details: ${error}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const result = {
|
|
46
|
+
deployment: {
|
|
47
|
+
id: latestDeployment.Id,
|
|
48
|
+
name: latestDeployment.Name,
|
|
49
|
+
releaseId: latestDeployment.ReleaseId,
|
|
50
|
+
environmentId: latestDeployment.EnvironmentId,
|
|
51
|
+
tenantId: latestDeployment.TenantId,
|
|
52
|
+
created: latestDeployment.Created,
|
|
53
|
+
taskId: latestDeployment.TaskId,
|
|
54
|
+
projectId: latestDeployment.ProjectId,
|
|
55
|
+
channelId: latestDeployment.ChannelId,
|
|
56
|
+
deploymentProcessId: latestDeployment.DeploymentProcessId,
|
|
57
|
+
skipActions: latestDeployment.SkipActions,
|
|
58
|
+
specificMachineIds: latestDeployment.SpecificMachineIds,
|
|
59
|
+
excludedMachineIds: latestDeployment.ExcludedMachineIds,
|
|
60
|
+
forcePackageDownload: latestDeployment.ForcePackageDownload,
|
|
61
|
+
forcePackageRedeployment: latestDeployment.ForcePackageRedeployment,
|
|
62
|
+
formValues: latestDeployment.FormValues,
|
|
63
|
+
queueTime: latestDeployment.QueueTime,
|
|
64
|
+
queueTimeExpiry: latestDeployment.QueueTimeExpiry,
|
|
65
|
+
useGuidedFailure: latestDeployment.UseGuidedFailure,
|
|
66
|
+
comments: latestDeployment.Comments,
|
|
67
|
+
},
|
|
68
|
+
taskDetails: taskDetails
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
content: [
|
|
72
|
+
{
|
|
73
|
+
type: "text",
|
|
74
|
+
text: JSON.stringify(result, null, 2),
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
registerToolDefinition({
|
|
81
|
+
toolName: "get_latest_deployment",
|
|
82
|
+
config: { toolset: "deployments", readOnly: true },
|
|
83
|
+
registerFn: registerGetLatestDeploymentTool
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=getLatestDeployment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLatestDeployment.js","sourceRoot":"","sources":["../../src/tools/getLatestDeployment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACpG,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,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,0IAA0I;AAE1I,MAAM,UAAU,+BAA+B,CAAC,MAAiB;IAC/D,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB;;yJAEqJ,EACrJ,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,EAChD;QACE,KAAK,EAAE,6DAA6D;QACpE,YAAY,EAAE,IAAI;KACnB,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,S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,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;IAClD,UAAU,EAAE,+BAA+B;CAC5C,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMissingTenantVariables.d.ts","sourceRoot":"","sources":["../../src/tools/getMissingTenantVariables.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,qCAAqC,CAAC,MAAM,EAAE,SAAS,QA4CtE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Client, TenantRepository } from "@octopusdeploy/api-client";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfigurationFromEnvironment.js";
|
|
5
|
+
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
6
|
+
export function registerGetMissingTenantVariablesTool(server) {
|
|
7
|
+
server.tool("get_missing_tenant_variables", `Get missing tenant variables
|
|
8
|
+
|
|
9
|
+
This tool retrieves tenant variables that are missing values. Optionally filter by tenant, project, or environment.`, {
|
|
10
|
+
spaceName: z.string().describe("The space name"),
|
|
11
|
+
tenantId: z.string().optional().describe("Filter by specific tenant ID"),
|
|
12
|
+
projectId: z.string().optional().describe("Filter by specific project ID"),
|
|
13
|
+
environmentId: z.string().optional().describe("Filter by specific environment ID"),
|
|
14
|
+
includeDetails: z.boolean().optional().describe("Include detailed information about missing variables")
|
|
15
|
+
}, {
|
|
16
|
+
title: "Get missing tenant variables from Octopus Deploy",
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
}, async ({ spaceName, tenantId, projectId, environmentId, includeDetails = false }) => {
|
|
19
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
20
|
+
const client = await Client.create(configuration);
|
|
21
|
+
const tenantRepository = new TenantRepository(client, spaceName);
|
|
22
|
+
const filterOptions = {
|
|
23
|
+
tenantId,
|
|
24
|
+
projectId,
|
|
25
|
+
environmentId
|
|
26
|
+
};
|
|
27
|
+
const missingVariables = await tenantRepository.missingVariables(filterOptions, includeDetails);
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: "text",
|
|
32
|
+
text: JSON.stringify({
|
|
33
|
+
filters: filterOptions,
|
|
34
|
+
includeDetails,
|
|
35
|
+
missingVariables
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
registerToolDefinition({
|
|
43
|
+
toolName: "get_missing_tenant_variables",
|
|
44
|
+
config: { toolset: "tenants", readOnly: true },
|
|
45
|
+
registerFn: registerGetMissingTenantVariablesTool
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=getMissingTenantVariables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMissingTenantVariables.js","sourceRoot":"","sources":["../../src/tools/getMissingTenantVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACrE,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,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,UAAU,qCAAqC,CAAC,MAAiB;IACrE,MAAM,CAAC,IAAI,CACT,8BAA8B,EAC9B;;sHAEkH,EAClH;QACE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAChD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QACxE,SAAS,EAAE,C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version":3,"file":"getReleaseById.d.ts","sourceRoot":"","sources":["../../src/tools/getReleaseById.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,QAyC3D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Client, ReleaseRepository } from "@octopusdeploy/api-client";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfigurationFromEnvironment.js";
|
|
5
|
+
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
6
|
+
export function registerGetReleaseByIdTool(server) {
|
|
7
|
+
server.tool("get_release_by_id", "Get details for a specific release by its ID", {
|
|
8
|
+
spaceName: z.string().describe("The space name"),
|
|
9
|
+
releaseId: z.string().describe("The ID of the release to retrieve")
|
|
10
|
+
}, {
|
|
11
|
+
title: "Get release details by ID from Octopus Deploy",
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
}, async ({ spaceName, releaseId }) => {
|
|
14
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
15
|
+
const client = await Client.create(configuration);
|
|
16
|
+
const releaseRepository = new ReleaseRepository(client, spaceName);
|
|
17
|
+
const release = await releaseRepository.get(releaseId);
|
|
18
|
+
return {
|
|
19
|
+
content: [
|
|
20
|
+
{
|
|
21
|
+
type: "text",
|
|
22
|
+
text: JSON.stringify({
|
|
23
|
+
id: release.Id,
|
|
24
|
+
version: release.Version,
|
|
25
|
+
channelId: release.ChannelId,
|
|
26
|
+
projectId: release.ProjectId,
|
|
27
|
+
releaseNotes: release.ReleaseNotes,
|
|
28
|
+
assembled: release.Assembled,
|
|
29
|
+
ignoreChannelRules: release.IgnoreChannelRules,
|
|
30
|
+
selectedPackages: release.SelectedPackages,
|
|
31
|
+
selectedGitResources: release.SelectedGitResources,
|
|
32
|
+
buildInformation: release.BuildInformation,
|
|
33
|
+
customFields: release.CustomFields
|
|
34
|
+
}),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
registerToolDefinition({
|
|
41
|
+
toolName: "get_release_by_id",
|
|
42
|
+
config: { toolset: "releases", readOnly: true },
|
|
43
|
+
registerFn: registerGetReleaseByIdTool
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=getReleaseById.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getReleaseById.js","sourceRoot":"","sources":["../../src/tools/getReleaseById.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACtE,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,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,UAAU,0BAA0B,CAAC,MAAiB;IAC1D,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,8CAA8C,EAC9C;QACE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAChD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;KACpE,EACD;QACE,KAAK,EAAE,+CAA+C;QACtD,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,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAEnE,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAEvD,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,EAAE,EAAE,OAAO,CAAC,EAAE;wBACd,OAAO,EAAE,OAAO,CAAC,OAAO;wBACxB,SAAS,EAAE,OAAO,CAAC,SAAS;wBAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;wBAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;wBAClC,SAAS,EAAE,OAAO,CAAC,SAAS;wBAC5B,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;wBAC9C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;wBAC1C,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;wBAClD,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;wBAC1C,YAAY,EAAE,OAAO,CAAC,YAAY;qBACnC,CAAC;iBACH;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,mBAAmB;IAC7B,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC/C,UAAU,EAAE,0BAA0B;CACvC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Client } from '@octopusdeploy/api-client';
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
export interface GetTaskByIdParams {
|
|
4
|
+
spaceName: string;
|
|
5
|
+
taskId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function getTaskById(client: Client, params: GetTaskByIdParams): Promise<import("@octopusdeploy/api-client").ServerTask<any>>;
|
|
8
|
+
export declare function registerGetTaskByIdTool(server: McpServer): void;
|
|
9
|
+
//# sourceMappingURL=getTaskById.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTaskById.d.ts","sourceRoot":"","sources":["../../src/tools/getTaskById.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA6B,MAAM,2BAA2B,CAAC;AAG9E,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,gEAU1E;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,QAgCxD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Client, SpaceServerTaskRepository } from '@octopusdeploy/api-client';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { getClientConfigurationFromEnvironment } from '../helpers/getClientConfigurationFromEnvironment.js';
|
|
4
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
+
import { registerToolDefinition } from '../types/toolConfig.js';
|
|
6
|
+
import { tasksDescription } from '../types/taskTypes.js';
|
|
7
|
+
export async function getTaskById(client, params) {
|
|
8
|
+
const { spaceName, taskId } = params;
|
|
9
|
+
if (!taskId) {
|
|
10
|
+
throw new Error("Task ID is required");
|
|
11
|
+
}
|
|
12
|
+
const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName);
|
|
13
|
+
const response = await serverTaskRepository.getById(taskId);
|
|
14
|
+
return response;
|
|
15
|
+
}
|
|
16
|
+
export function registerGetTaskByIdTool(server) {
|
|
17
|
+
server.tool('get_task_by_id', `Get details for a specific server task by its ID. ${tasksDescription}`, { spaceName: z.string(), taskId: z.string() }, {
|
|
18
|
+
title: 'Get details for a specific server task by its ID',
|
|
19
|
+
readOnlyHint: true,
|
|
20
|
+
}, async (args) => {
|
|
21
|
+
const { spaceName, taskId } = args;
|
|
22
|
+
if (!taskId) {
|
|
23
|
+
throw new Error("Task ID is required");
|
|
24
|
+
}
|
|
25
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
26
|
+
const client = await Client.create(configuration);
|
|
27
|
+
const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName);
|
|
28
|
+
const response = await serverTaskRepository.getById(taskId);
|
|
29
|
+
return {
|
|
30
|
+
content: [
|
|
31
|
+
{
|
|
32
|
+
type: "text",
|
|
33
|
+
text: JSON.stringify(response),
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
registerToolDefinition({
|
|
40
|
+
toolName: "get_task_by_id",
|
|
41
|
+
config: { toolset: "tasks", readOnly: true },
|
|
42
|
+
registerFn: registerGetTaskByIdTool
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=getTaskById.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTaskById.js","sourceRoot":"","sources":["../../src/tools/getTaskById.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qCAAqC,EAAE,MAAM,qDAAqD,CAAC;AAC5G,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAc,EAAE,MAAyB;IACzE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAErC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACzC,CAAC;IAED,MAA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uB;CACpC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Client } from '@octopusdeploy/api-client';
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
export interface GetTaskDetailsParams {
|
|
4
|
+
spaceName: string;
|
|
5
|
+
taskId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function getTaskDetails(client: Client, params: GetTaskDetailsParams): Promise<import("@octopusdeploy/api-client").ServerTaskDetails>;
|
|
8
|
+
export declare function registerGetTaskDetailsTool(server: McpServer): void;
|
|
9
|
+
//# sourceMappingURL=getTaskDetails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTaskDetails.d.ts","sourceRoot":"","sources":["../../src/tools/getTaskDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA6B,MAAM,2BAA2B,CAAC;AAG9E,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,kEAUhF;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,QAgC3D"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Client, SpaceServerTaskRepository } from '@octopusdeploy/api-client';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { getClientConfigurationFromEnvironment } from '../helpers/getClientConfigurationFromEnvironment.js';
|
|
4
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
+
import { registerToolDefinition } from '../types/toolConfig.js';
|
|
6
|
+
import { tasksDescription } from '../types/taskTypes.js';
|
|
7
|
+
export async function getTaskDetails(client, params) {
|
|
8
|
+
const { spaceName, taskId } = params;
|
|
9
|
+
if (!taskId) {
|
|
10
|
+
throw new Error("Task ID is required");
|
|
11
|
+
}
|
|
12
|
+
const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName);
|
|
13
|
+
const response = await serverTaskRepository.getDetails(taskId);
|
|
14
|
+
return response;
|
|
15
|
+
}
|
|
16
|
+
export function registerGetTaskDetailsTool(server) {
|
|
17
|
+
server.tool('get_task_details', `Get detailed information for a specific server task by its ID. ${tasksDescription}`, { spaceName: z.string(), taskId: z.string() }, {
|
|
18
|
+
title: 'Get detailed information for a specific server task by its ID',
|
|
19
|
+
readOnlyHint: true,
|
|
20
|
+
}, async (args) => {
|
|
21
|
+
const { spaceName, taskId } = args;
|
|
22
|
+
if (!taskId) {
|
|
23
|
+
throw new Error("Task ID is required");
|
|
24
|
+
}
|
|
25
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
26
|
+
const client = await Client.create(configuration);
|
|
27
|
+
const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName);
|
|
28
|
+
const response = await serverTaskRepository.getDetails(taskId);
|
|
29
|
+
return {
|
|
30
|
+
content: [
|
|
31
|
+
{
|
|
32
|
+
type: "text",
|
|
33
|
+
text: JSON.stringify(response),
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
registerToolDefinition({
|
|
40
|
+
toolName: "get_task_details",
|
|
41
|
+
config: { toolset: "tasks", readOnly: true },
|
|
42
|
+
registerFn: registerGetTaskDetailsTool
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=getTaskDetails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTaskDetails.js","sourceRoot":"","sources":["../../src/tools/getTaskDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qCAAqC,E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SAAS,CAAC,CAAC;QAE9E,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAE/D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;iBAC/B;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC5C,UAAU,EAAE,0BAA0B;CACvC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Client } from '@octopusdeploy/api-client';
|
|
2
|
+
import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
export interface GetTaskRawParams {
|
|
4
|
+
spaceName: string;
|
|
5
|
+
taskId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function getTaskRaw(client: Client, params: GetTaskRawParams): Promise<string>;
|
|
8
|
+
export declare function registerGetTaskRawTool(server: McpServer): void;
|
|
9
|
+
//# sourceMappingURL=getTaskRaw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTaskRaw.d.ts","sourceRoot":"","sources":["../../src/tools/getTaskRaw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA6B,MAAM,2BAA2B,CAAC;AAG9E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,mBAUxE;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,QAgCvD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Client, SpaceServerTaskRepository } from '@octopusdeploy/api-client';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { getClientConfigurationFromEnvironment } from '../helpers/getClientConfigurationFromEnvironment.js';
|
|
4
|
+
import {} from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
+
import { registerToolDefinition } from '../types/toolConfig.js';
|
|
6
|
+
export async function getTaskRaw(client, params) {
|
|
7
|
+
const { spaceName, taskId } = params;
|
|
8
|
+
if (!taskId) {
|
|
9
|
+
throw new Error("Task ID is required");
|
|
10
|
+
}
|
|
11
|
+
const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName);
|
|
12
|
+
const response = await serverTaskRepository.getRaw(taskId);
|
|
13
|
+
return response;
|
|
14
|
+
}
|
|
15
|
+
export function registerGetTaskRawTool(server) {
|
|
16
|
+
server.tool('get_task_raw', 'Get raw details for a specific server task by its ID', { spaceName: z.string(), taskId: z.string() }, {
|
|
17
|
+
title: 'Get raw details for a specific server task by its ID',
|
|
18
|
+
readOnlyHint: true,
|
|
19
|
+
}, async (args) => {
|
|
20
|
+
const { spaceName, taskId } = args;
|
|
21
|
+
if (!taskId) {
|
|
22
|
+
throw new Error("Task ID is required");
|
|
23
|
+
}
|
|
24
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
25
|
+
const client = await Client.create(configuration);
|
|
26
|
+
const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName);
|
|
27
|
+
const response = await serverTaskRepository.getRaw(taskId);
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: "text",
|
|
32
|
+
text: response,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
registerToolDefinition({
|
|
39
|
+
toolName: "get_task_raw",
|
|
40
|
+
config: { toolset: "tasks", readOnly: true },
|
|
41
|
+
registerFn: registerG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Z,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,aAAa,GAAG,qCAAqC,EAAE,CAAC;QAC9D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAClD,MAAM,oBAAoB,GAAG,IAAI,yBAAyB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAE9E,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAE3D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,QAAQ;iBACf;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC5C,UAAU,EAAE,sBAAsB;CACnC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTenantById.d.ts","sourceRoot":"","sources":["../../src/tools/getTenantById.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMzE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,QAuC1D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Client, resolveSpaceId, TenantRepository } from "@octopusdeploy/api-client";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfigurationFromEnvironment.js";
|
|
5
|
+
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
6
|
+
import { tenantsDescription } from "../types/tenantsTypes.js";
|
|
7
|
+
import { getPublicUrl } from "../helpers/getPublicUrl.js";
|
|
8
|
+
export function registerGetTenantByIdTool(server) {
|
|
9
|
+
server.tool("get_tenant_by_id", `Get details for a specific tenant by its ID. ${tenantsDescription}`, {
|
|
10
|
+
spaceName: z.string().describe("The space name"),
|
|
11
|
+
tenantId: z.string().describe("The ID of the tenant to retrieve")
|
|
12
|
+
}, {
|
|
13
|
+
title: "Get tenant details by ID from Octopus Deploy",
|
|
14
|
+
readOnlyHint: true,
|
|
15
|
+
}, async ({ spaceName, tenantId }) => {
|
|
16
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
17
|
+
const client = await Client.create(configuration);
|
|
18
|
+
const tenantRepository = new TenantRepository(client, spaceName);
|
|
19
|
+
const tenant = await tenantRepository.get(tenantId);
|
|
20
|
+
return {
|
|
21
|
+
content: [
|
|
22
|
+
{
|
|
23
|
+
type: "text",
|
|
24
|
+
text: JSON.stringify({
|
|
25
|
+
id: tenant.Id,
|
|
26
|
+
name: tenant.Name,
|
|
27
|
+
description: tenant.Description,
|
|
28
|
+
projectEnvironments: tenant.ProjectEnvironments,
|
|
29
|
+
tenantTags: tenant.TenantTags,
|
|
30
|
+
clonedFromTenantId: tenant.ClonedFromTenantId,
|
|
31
|
+
spaceId: tenant.SpaceId,
|
|
32
|
+
publicUrl: getPublicUrl(`${configuration.instanceURL}/app#/{spaceId}/tenants/{tenantId}/overview`, { spaceId: tenant.SpaceId, tenantId: tenant.Id }),
|
|
33
|
+
publicUrlInstruction: `You can view more details about this tenant in the Octopus Deploy web portal at the provided publicUrl.`
|
|
34
|
+
}),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
registerToolDefinition({
|
|
41
|
+
toolName: "get_tenant_by_id",
|
|
42
|
+
config: { toolset: "tenants", readOnly: true },
|
|
43
|
+
registerFn: registerGetTenantByIdTool
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=getTenantById.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTen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AE;wBACb,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,WAAW,EAAE,MAAM,CAAC,WAAW;wBAC/B,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;wBAC/C,UAAU,EAAE,MAAM,CAAC,UAAU;wBAC7B,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;wBAC7C,OAAO,EAAE,MAAM,CAAC,OAAO;wBACvB,SAAS,EAAE,YAAY,CAAC,GAAG,aAAa,CAAC,WAAW,6CAA6C,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;wBACpJ,oBAAoB,EAAE,yGAAyG;qBAChI,CAAC;iBACH;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC9C,UAAU,EAAE,yBAAyB;CACtC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTenantVariables.d.ts","sourceRoot":"","sources":["../../src/tools/getTenantVariables.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,SAAS,QAuD/D"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Client, TenantRepository } from "@octopusdeploy/api-client";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfigurationFromEnvironment.js";
|
|
5
|
+
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
6
|
+
export function registerGetTenantVariablesTool(server) {
|
|
7
|
+
server.tool("get_tenant_variables", `Get tenant variables by type
|
|
8
|
+
|
|
9
|
+
This tool retrieves different types of tenant variables. Use variableType parameter to specify which type:
|
|
10
|
+
- "all": Get all tenant variables
|
|
11
|
+
- "common": Get common variables only
|
|
12
|
+
- "project": Get project-specific variables only`, {
|
|
13
|
+
spaceName: z.string().describe("The space name"),
|
|
14
|
+
tenantId: z.string().describe("The ID of the tenant to retrieve variables for"),
|
|
15
|
+
variableType: z.enum(["all", "common", "project"]).describe("Type of variables to retrieve"),
|
|
16
|
+
includeMissingVariables: z.boolean().optional().describe("Include missing variables in the response (for common/project types)")
|
|
17
|
+
}, {
|
|
18
|
+
title: "Get tenant variables from Octopus Deploy",
|
|
19
|
+
readOnlyHint: true,
|
|
20
|
+
}, async ({ spaceName, tenantId, variableType, includeMissingVariables = false }) => {
|
|
21
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
22
|
+
const client = await Client.create(configuration);
|
|
23
|
+
const tenantRepository = new TenantRepository(client, spaceName);
|
|
24
|
+
let variables;
|
|
25
|
+
switch (variableType) {
|
|
26
|
+
case "all": {
|
|
27
|
+
const tenant = await tenantRepository.get(tenantId);
|
|
28
|
+
variables = await tenantRepository.getVariables(tenant);
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case "common":
|
|
32
|
+
variables = await tenantRepository.getCommonVariablesById(tenantId, includeMissingVariables);
|
|
33
|
+
break;
|
|
34
|
+
case "project":
|
|
35
|
+
variables = await tenantRepository.getProjectVariablesById(tenantId, includeMissingVariables);
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: "text",
|
|
42
|
+
text: JSON.stringify({
|
|
43
|
+
tenantId,
|
|
44
|
+
variableType,
|
|
45
|
+
includeMissingVariables,
|
|
46
|
+
variables
|
|
47
|
+
}),
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
registerToolDefinition({
|
|
54
|
+
toolName: "get_tenant_variables",
|
|
55
|
+
config: { toolset: "tenants", readOnly: true },
|
|
56
|
+
registerFn: registerGetTenantVariablesTool
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=getTenantVariables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTenantVariables.js","sourceRoot":"","sources":["../../src/tools/getTenantVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACrE,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,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,UAAU,8BAA8B,CAAC,MAAiB;IAC9D,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB;;;;;mDAK+C,EAC/C;QACE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAChD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;QAC/E,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QAC5F,uBAAuB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sEAAsE,CAAC;KACjI,EACD;QACE,KAAK,EAAE,0CAA0C;QACjD,YAAY,EAAE,IAAI;KACnB,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,uBAAuB,GAAG,KAAK,EAAE,EAAE,EAAE;QAC/E,MAAM,aAAa,GAAG,qCAAqC,EAAE,CAAC;QAC9D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAClD,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAEjE,IAAI,SAAS,CAAC;QAEd,QAAQ,YAAY,EAAE,CAAC;YACrB,KAAK,KAAK,CAAC,CAAC,CAAC;gBACX,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBACpD,SAAS,GAAG,MAAM,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;gBACxD,MAAM;YACR,CAAC;YACD,KAAK,QAAQ;gBACX,SAAS,GAAG,MAAM,gBAAgB,CAAC,sBAAsB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;gBAC7F,MAAM;YACR,KAAK,SAAS;gBACZ,SAAS,GAAG,MAAM,gBAAgB,CAAC,uBAAuB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;gBAC9F,MAAM;QACV,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,QAAQ;wBACR,YAAY;wBACZ,uBAAuB;wBACvB,SAAS;qBACV,CAAC;iBACH;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,sBAAsB;IAChC,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC9C,UAAU,EAAE,8BAA8B;CAC3C,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { type ToolsetConfig } from "../types/toolConfig.js";
|
|
3
|
+
import "./listSpaces.js";
|
|
4
|
+
import "./listProjects.js";
|
|
5
|
+
import "./listEnvironments.js";
|
|
6
|
+
import "./listDeployments.js";
|
|
7
|
+
import "./getReleaseById.js";
|
|
8
|
+
import "./listReleases.js";
|
|
9
|
+
import "./listReleasesForProject.js";
|
|
10
|
+
import "./getTaskById.js";
|
|
11
|
+
import "./getTaskDetails.js";
|
|
12
|
+
import "./getTaskRaw.js";
|
|
13
|
+
import "./listTenants.js";
|
|
14
|
+
import "./getTenantById.js";
|
|
15
|
+
import "./getTenantVariables.js";
|
|
16
|
+
import "./getMissingTenantVariables.js";
|
|
17
|
+
import "./getKubernetesLiveStatus.js";
|
|
18
|
+
import "./listDeploymentTargets.js";
|
|
19
|
+
import './getDeploymentTarget.js';
|
|
20
|
+
import './getDeploymentProcess.js';
|
|
21
|
+
import './getBranches.js';
|
|
22
|
+
import './getCurrentUser.js';
|
|
23
|
+
export declare function registerTools(server: McpServer, config?: ToolsetConfig): void;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,iBAAiB,CAAC;AACzB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,6BAA6B,CAAC;AACrC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AACzB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,yBAAyB,CAAC;AACjC,OAAO,gCAAgC,CAAC;AACxC,OAAO,8BAA8B,CAAC;AACtC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,2BAA2B,CAAC;AACnC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAwB7B,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,GAAE,aAAkB,QAO1E"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { TOOL_REGISTRY, DEFAULT_TOOLSETS } from "../types/toolConfig.js";
|
|
3
|
+
// Import all tool files to trigger their self-registration
|
|
4
|
+
import "./listSpaces.js";
|
|
5
|
+
import "./listProjects.js";
|
|
6
|
+
import "./listEnvironments.js";
|
|
7
|
+
import "./listDeployments.js";
|
|
8
|
+
import "./getReleaseById.js";
|
|
9
|
+
import "./listReleases.js";
|
|
10
|
+
import "./listReleasesForProject.js";
|
|
11
|
+
import "./getTaskById.js";
|
|
12
|
+
import "./getTaskDetails.js";
|
|
13
|
+
import "./getTaskRaw.js";
|
|
14
|
+
import "./listTenants.js";
|
|
15
|
+
import "./getTenantById.js";
|
|
16
|
+
import "./getTenantVariables.js";
|
|
17
|
+
import "./getMissingTenantVariables.js";
|
|
18
|
+
import "./getKubernetesLiveStatus.js";
|
|
19
|
+
import "./listDeploymentTargets.js";
|
|
20
|
+
import './getDeploymentTarget.js';
|
|
21
|
+
import './getDeploymentProcess.js';
|
|
22
|
+
import './getBranches.js';
|
|
23
|
+
import './getCurrentUser.js';
|
|
24
|
+
function isToolEnabled(toolRegistration, config) {
|
|
25
|
+
if (!toolRegistration) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
// Check if toolset is enabled
|
|
29
|
+
const enabledToolsets = config.enabledToolsets === "all"
|
|
30
|
+
? DEFAULT_TOOLSETS
|
|
31
|
+
: (config.enabledToolsets || DEFAULT_TOOLSETS);
|
|
32
|
+
if (toolRegistration.config.toolset !== "core" && !enabledToolsets.includes(toolRegistration.config.toolset)) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
// Check read-only mode
|
|
36
|
+
if (config.readOnlyMode && !toolRegistration.config.readOnly) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
export function registerTools(server, config = {}) {
|
|
42
|
+
// Iterate through all registered tools and register those that are enabled
|
|
43
|
+
for (const [, toolRegistration] of TOOL_REGISTRY) {
|
|
44
|
+
if (isToolEnabled(toolRegistration, config)) {
|
|
45
|
+
toolRegistration.registerFn(server);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=index.js.map
|