@octopusdeploy/mcp-server 1.0.1 → 2.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 +237 -46
- package/dist/helpers/activeToolsetConfig.d.ts +4 -0
- package/dist/helpers/activeToolsetConfig.d.ts.map +1 -0
- package/dist/helpers/activeToolsetConfig.js +18 -0
- package/dist/helpers/activeToolsetConfig.js.map +1 -0
- package/dist/helpers/errorHandling.d.ts +38 -0
- package/dist/helpers/errorHandling.d.ts.map +1 -0
- package/dist/helpers/errorHandling.js +75 -0
- package/dist/helpers/errorHandling.js.map +1 -0
- package/dist/helpers/getClientConfigurationFromEnvironment.d.ts +2 -0
- package/dist/helpers/getClientConfigurationFromEnvironment.d.ts.map +1 -1
- package/dist/helpers/getClientConfigurationFromEnvironment.js +21 -5
- package/dist/helpers/getClientConfigurationFromEnvironment.js.map +1 -1
- package/dist/helpers/grepLines.d.ts +38 -0
- package/dist/helpers/grepLines.d.ts.map +1 -0
- package/dist/helpers/grepLines.js +65 -0
- package/dist/helpers/grepLines.js.map +1 -0
- package/dist/helpers/methodTier.d.ts +15 -0
- package/dist/helpers/methodTier.d.ts.map +1 -0
- package/dist/helpers/methodTier.js +25 -0
- package/dist/helpers/methodTier.js.map +1 -0
- package/dist/helpers/pathAllowlist.d.ts +27 -0
- package/dist/helpers/pathAllowlist.d.ts.map +1 -0
- package/dist/helpers/pathAllowlist.js +177 -0
- package/dist/helpers/pathAllowlist.js.map +1 -0
- package/dist/helpers/pathGlob.d.ts +15 -0
- package/dist/helpers/pathGlob.d.ts.map +1 -0
- package/dist/helpers/pathGlob.js +47 -0
- package/dist/helpers/pathGlob.js.map +1 -0
- package/dist/helpers/requireConfirmation.d.ts +119 -0
- package/dist/helpers/requireConfirmation.d.ts.map +1 -0
- package/dist/helpers/requireConfirmation.js +148 -0
- package/dist/helpers/requireConfirmation.js.map +1 -0
- package/dist/helpers/sensitivePathDenylist.d.ts +32 -0
- package/dist/helpers/sensitivePathDenylist.d.ts.map +1 -0
- package/dist/helpers/sensitivePathDenylist.js +49 -0
- package/dist/helpers/sensitivePathDenylist.js.map +1 -0
- 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/stripLinks.d.ts +15 -0
- package/dist/helpers/stripLinks.d.ts.map +1 -0
- package/dist/helpers/stripLinks.js +19 -0
- package/dist/helpers/stripLinks.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/helpers/userCache.d.ts +14 -0
- package/dist/helpers/userCache.d.ts.map +1 -0
- package/dist/helpers/userCache.js +16 -0
- package/dist/helpers/userCache.js.map +1 -0
- package/dist/helpers/validateExecutePath.d.ts +29 -0
- package/dist/helpers/validateExecutePath.d.ts.map +1 -0
- package/dist/helpers/validateExecutePath.js +62 -0
- package/dist/helpers/validateExecutePath.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -15
- package/dist/index.js.map +1 -1
- package/dist/resources/catalog/capabilities.d.ts +36 -0
- package/dist/resources/catalog/capabilities.d.ts.map +1 -0
- package/dist/resources/catalog/capabilities.js +90 -0
- package/dist/resources/catalog/capabilities.js.map +1 -0
- package/dist/resources/catalog/llmsTxt.d.ts +8 -0
- package/dist/resources/catalog/llmsTxt.d.ts.map +1 -0
- package/dist/resources/catalog/llmsTxt.js +44 -0
- package/dist/resources/catalog/llmsTxt.js.map +1 -0
- package/dist/resources/dispatch.d.ts +30 -0
- package/dist/resources/dispatch.d.ts.map +1 -0
- package/dist/resources/dispatch.js +81 -0
- package/dist/resources/dispatch.js.map +1 -0
- package/dist/resources/featureToggle.d.ts +2 -0
- package/dist/resources/featureToggle.d.ts.map +1 -0
- package/dist/resources/featureToggle.js +34 -0
- package/dist/resources/featureToggle.js.map +1 -0
- package/dist/resources/index.d.ts +12 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +44 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/interruption.d.ts +2 -0
- package/dist/resources/interruption.d.ts.map +1 -0
- package/dist/resources/interruption.js +34 -0
- package/dist/resources/interruption.js.map +1 -0
- package/dist/resources/release.d.ts +2 -0
- package/dist/resources/release.d.ts.map +1 -0
- package/dist/resources/release.js +33 -0
- package/dist/resources/release.js.map +1 -0
- package/dist/resources/rolloutGroup.d.ts +2 -0
- package/dist/resources/rolloutGroup.d.ts.map +1 -0
- package/dist/resources/rolloutGroup.js +35 -0
- package/dist/resources/rolloutGroup.js.map +1 -0
- package/dist/resources/runbook.d.ts +2 -0
- package/dist/resources/runbook.d.ts.map +1 -0
- package/dist/resources/runbook.js +34 -0
- package/dist/resources/runbook.js.map +1 -0
- package/dist/resources/task.d.ts +2 -0
- package/dist/resources/task.d.ts.map +1 -0
- package/dist/resources/task.js +68 -0
- package/dist/resources/task.js.map +1 -0
- package/dist/tools/createRelease.d.ts +3 -0
- package/dist/tools/createRelease.d.ts.map +1 -0
- package/dist/tools/createRelease.js +151 -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 +227 -0
- package/dist/tools/deployRelease.js.map +1 -0
- package/dist/tools/execute.d.ts +3 -0
- package/dist/tools/execute.d.ts.map +1 -0
- package/dist/tools/execute.js +261 -0
- package/dist/tools/execute.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 +90 -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 +98 -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 +161 -0
- package/dist/tools/findDeploymentTargets.js.map +1 -0
- package/dist/tools/findFeatureToggles.d.ts +37 -0
- package/dist/tools/findFeatureToggles.d.ts.map +1 -0
- package/dist/tools/findFeatureToggles.js +139 -0
- package/dist/tools/findFeatureToggles.js.map +1 -0
- package/dist/tools/findInterruptions.d.ts +79 -0
- package/dist/tools/findInterruptions.d.ts.map +1 -0
- package/dist/tools/findInterruptions.js +273 -0
- package/dist/tools/findInterruptions.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 +138 -0
- package/dist/tools/findReleases.js.map +1 -0
- package/dist/tools/findRunbooks.d.ts +3 -0
- package/dist/tools/findRunbooks.d.ts.map +1 -0
- package/dist/tools/findRunbooks.js +139 -0
- package/dist/tools/findRunbooks.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 +133 -0
- package/dist/tools/findTenants.js.map +1 -0
- package/dist/tools/getBranches.d.ts.map +1 -1
- package/dist/tools/getBranches.js +51 -33
- package/dist/tools/getBranches.js.map +1 -1
- package/dist/tools/getCurrentUser.d.ts.map +1 -1
- package/dist/tools/getCurrentUser.js +34 -25
- package/dist/tools/getCurrentUser.js.map +1 -1
- package/dist/tools/getDeploymentFromUrl.d.ts +57 -0
- package/dist/tools/getDeploymentFromUrl.d.ts.map +1 -0
- package/dist/tools/getDeploymentFromUrl.js +162 -0
- package/dist/tools/getDeploymentFromUrl.js.map +1 -0
- package/dist/tools/getDeploymentProcess.d.ts.map +1 -1
- package/dist/tools/getDeploymentProcess.js +57 -19
- package/dist/tools/getDeploymentProcess.js.map +1 -1
- package/dist/tools/getKubernetesLiveStatus.d.ts.map +1 -1
- package/dist/tools/getKubernetesLiveStatus.js +70 -48
- package/dist/tools/getKubernetesLiveStatus.js.map +1 -1
- package/dist/tools/getMissingTenantVariables.d.ts.map +1 -1
- package/dist/tools/getMissingTenantVariables.js +58 -26
- package/dist/tools/getMissingTenantVariables.js.map +1 -1
- package/dist/tools/getTaskFromUrl.d.ts +18 -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/getTenantVariables.d.ts.map +1 -1
- package/dist/tools/getTenantVariables.js +58 -38
- package/dist/tools/getTenantVariables.js.map +1 -1
- package/dist/tools/getVariables.d.ts.map +1 -1
- package/dist/tools/getVariables.js +12 -9
- package/dist/tools/getVariables.js.map +1 -1
- package/dist/tools/grepLlmsTxt.d.ts +13 -0
- package/dist/tools/grepLlmsTxt.d.ts.map +1 -0
- package/dist/tools/grepLlmsTxt.js +105 -0
- package/dist/tools/grepLlmsTxt.js.map +1 -0
- package/dist/tools/grepTaskLog.d.ts +30 -0
- package/dist/tools/grepTaskLog.d.ts.map +1 -0
- package/dist/tools/grepTaskLog.js +116 -0
- package/dist/tools/grepTaskLog.js.map +1 -0
- package/dist/tools/index.d.ts +22 -18
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +33 -21
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/listDeployments.d.ts.map +1 -1
- package/dist/tools/listDeployments.js +77 -37
- package/dist/tools/listDeployments.js.map +1 -1
- package/dist/tools/listEnvironments.d.ts.map +1 -1
- package/dist/tools/listEnvironments.js +63 -37
- package/dist/tools/listEnvironments.js.map +1 -1
- package/dist/tools/listProjects.d.ts.map +1 -1
- package/dist/tools/listProjects.js +64 -38
- package/dist/tools/listProjects.js.map +1 -1
- package/dist/tools/listSpaces.d.ts.map +1 -1
- package/dist/tools/listSpaces.js +56 -30
- package/dist/tools/listSpaces.js.map +1 -1
- package/dist/tools/readResource.d.ts +3 -0
- package/dist/tools/readResource.d.ts.map +1 -0
- package/dist/tools/readResource.js +50 -0
- package/dist/tools/readResource.js.map +1 -0
- package/dist/tools/runRunbook.d.ts +3 -0
- package/dist/tools/runRunbook.d.ts.map +1 -0
- package/dist/tools/runRunbook.js +174 -0
- package/dist/tools/runRunbook.js.map +1 -0
- package/dist/tools/updateFeatureToggle.d.ts +94 -0
- package/dist/tools/updateFeatureToggle.d.ts.map +1 -0
- package/dist/tools/updateFeatureToggle.js +308 -0
- package/dist/tools/updateFeatureToggle.js.map +1 -0
- package/dist/types/featureToggleTypes.d.ts +47 -0
- package/dist/types/featureToggleTypes.d.ts.map +1 -0
- package/dist/types/featureToggleTypes.js +10 -0
- package/dist/types/featureToggleTypes.js.map +1 -0
- package/dist/types/resourceConfig.d.ts +17 -0
- package/dist/types/resourceConfig.d.ts.map +1 -0
- package/dist/types/resourceConfig.js +6 -0
- package/dist/types/resourceConfig.js.map +1 -0
- package/dist/types/toolAnnotations.d.ts +8 -0
- package/dist/types/toolAnnotations.d.ts.map +1 -0
- package/dist/types/toolAnnotations.js +28 -0
- package/dist/types/toolAnnotations.js.map +1 -0
- package/dist/types/toolConfig.d.ts +7 -1
- package/dist/types/toolConfig.d.ts.map +1 -1
- package/dist/types/toolConfig.js +4 -1
- package/dist/types/toolConfig.js.map +1 -1
- package/dist/utils/parseConfig.d.ts +1 -1
- package/dist/utils/parseConfig.d.ts.map +1 -1
- package/dist/utils/parseConfig.js +3 -2
- package/dist/utils/parseConfig.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/getTaskById.d.ts +0 -9
- package/dist/tools/getTaskById.d.ts.map +0 -1
- package/dist/tools/getTaskById.js +0 -44
- package/dist/tools/getTaskById.js.map +0 -1
- package/dist/tools/getTaskDetails.d.ts +0 -9
- package/dist/tools/getTaskDetails.d.ts.map +0 -1
- package/dist/tools/getTaskDetails.js +0 -44
- package/dist/tools/getTaskDetails.js.map +0 -1
- package/dist/tools/getTaskRaw.d.ts +0 -9
- package/dist/tools/getTaskRaw.d.ts.map +0 -1
- package/dist/tools/getTaskRaw.js +0 -43
- package/dist/tools/getTaskRaw.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 -50
- 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/listReleasesForProject.d.ts +0 -3
- package/dist/tools/listReleasesForProject.d.ts.map +0 -1
- package/dist/tools/listReleasesForProject.js +0 -60
- package/dist/tools/listReleasesForProject.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 -69
- package/dist/tools/listTenants.js.map +0 -1
|
@@ -3,51 +3,71 @@ 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 { READ_ONLY_TOOL_ANNOTATIONS } from "../types/toolAnnotations.js";
|
|
7
|
+
import { validateEntityId, handleOctopusApiError, ENTITY_PREFIXES } from "../helpers/errorHandling.js";
|
|
6
8
|
export function registerGetTenantVariablesTool(server) {
|
|
7
|
-
server.
|
|
8
|
-
|
|
9
|
+
server.registerTool("get_tenant_variables", {
|
|
10
|
+
title: "Get tenant variables from Octopus Deploy",
|
|
11
|
+
description: `Get tenant variables by type
|
|
12
|
+
|
|
9
13
|
This tool retrieves different types of tenant variables. Use variableType parameter to specify which type:
|
|
10
14
|
- "all": Get all tenant variables
|
|
11
15
|
- "common": Get common variables only
|
|
12
|
-
- "project": Get project-specific variables only`,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
- "project": Get project-specific variables only`,
|
|
17
|
+
inputSchema: {
|
|
18
|
+
spaceName: z.string().describe("The space name"),
|
|
19
|
+
tenantId: z.string().describe("The ID of the tenant to retrieve variables for"),
|
|
20
|
+
variableType: z.enum(["all", "common", "project"]).describe("Type of variables to retrieve"),
|
|
21
|
+
includeMissingVariables: z.boolean().optional().describe("Include missing variables in the response (for common/project types)")
|
|
22
|
+
},
|
|
23
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
20
24
|
}, async ({ spaceName, tenantId, variableType, includeMissingVariables = false }) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
validateEntityId(tenantId, 'tenant', ENTITY_PREFIXES.tenant);
|
|
26
|
+
if (!variableType) {
|
|
27
|
+
throw new Error("Variable type is required. Valid values are: 'all', 'common', or 'project'. " +
|
|
28
|
+
"'all' returns all variables, 'common' returns shared variables, 'project' returns project-specific variables.");
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const configuration = getClientConfigurationFromEnvironment();
|
|
32
|
+
const client = await Client.create(configuration);
|
|
33
|
+
const tenantRepository = new TenantRepository(client, spaceName);
|
|
34
|
+
let variables;
|
|
35
|
+
switch (variableType) {
|
|
36
|
+
case "all": {
|
|
37
|
+
const tenant = await tenantRepository.get(tenantId);
|
|
38
|
+
variables = await tenantRepository.getVariables(tenant);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
case "common":
|
|
42
|
+
variables = await tenantRepository.getCommonVariablesById(tenantId, includeMissingVariables);
|
|
43
|
+
break;
|
|
44
|
+
case "project":
|
|
45
|
+
variables = await tenantRepository.getProjectVariablesById(tenantId, includeMissingVariables);
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
throw new Error(`Invalid variable type '${variableType}'. Valid values are: 'all', 'common', or 'project'.`);
|
|
30
49
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
50
|
+
return {
|
|
51
|
+
content: [
|
|
52
|
+
{
|
|
53
|
+
type: "text",
|
|
54
|
+
text: JSON.stringify({
|
|
55
|
+
tenantId,
|
|
56
|
+
variableType,
|
|
57
|
+
includeMissingVariables,
|
|
58
|
+
variables
|
|
59
|
+
}),
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
handleOctopusApiError(error, {
|
|
66
|
+
entityType: 'tenant',
|
|
67
|
+
entityId: tenantId,
|
|
68
|
+
spaceName
|
|
69
|
+
});
|
|
37
70
|
}
|
|
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
71
|
});
|
|
52
72
|
}
|
|
53
73
|
registerToolDefinition({
|
|
@@ -1 +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;
|
|
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,sBAAs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":["../../src/tools/getVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EAIT,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"getVariables.d.ts","sourceRoot":"","sources":["../../src/tools/getVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EAIT,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,QA0CzD;AAQD,KAAK,gBAAgB,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;CACxB,CAAA;AAED,KAAK,MAAM,CAAC,CAAC,IAAI;KACZ,CAAC,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC9B,CAAC;AAEF,KAAK,kBAAkB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAE1D,UAAU,uBAAuB;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,mBAAmB;IAC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nB;AAED,KAAK,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;AAEpE,wBAAsB,eAAe,CACjC,MAAM,EAAE,qBAAqB,EAC7B,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,sBAAsB,CAAC,CAajC"}
|
|
@@ -3,18 +3,21 @@ 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 { READ_ONLY_TOOL_ANNOTATIONS } from "../types/toolAnnotations.js";
|
|
6
7
|
export function registerGetVariablesTool(server) {
|
|
7
|
-
server.
|
|
8
|
-
|
|
8
|
+
server.registerTool("get_variables", {
|
|
9
|
+
title: "Get variables for a Project from Octopus Deploy",
|
|
10
|
+
description: `This tool gets all project and library variable set variables for a given project.
|
|
11
|
+
Projects can contain variables (specific to a project), library variable sets (shared collections of variables associated with many projects),
|
|
9
12
|
and tenant variables (variables related to a tenants connected to the project)
|
|
10
13
|
If you want to retrieve tenant variables for a tenant connected to the project, use the get_tenant_variables tool.
|
|
11
|
-
`,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
`,
|
|
15
|
+
inputSchema: {
|
|
16
|
+
spaceName: z.string().describe("The space name"),
|
|
17
|
+
projectId: z.string().describe("The ID of the project to retrieve the variables for"),
|
|
18
|
+
gitRef: z.string().describe("The gitRef to retrieve the variables from, if the project is a config-as-code project").optional(),
|
|
19
|
+
},
|
|
20
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
18
21
|
}, async ({ spaceName, projectId, gitRef }) => {
|
|
19
22
|
const configuration = getClientConfigurationFromEnvironment();
|
|
20
23
|
const client = await Client.create(configuration);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVariables.js","sourceRoot":"","sources":["../../src/tools/getVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EAEN,iBAAiB,EACjB,cAAc,EACjB,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,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"getVariables.js","sourceRoot":"","sources":["../../src/tools/getVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EAEN,iBAAiB,EACjB,cAAc,EACjB,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,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAGzE,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACtD,MAAM,CAAC,YAAY,CACf,eAAe,EACf;QACI,KAAK,EAAE,iDAAiD;QACxD,WAAW,EAAE;;;;SAIhB;QACG,WAAW,EAAE;YACT,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YAChD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC;YACrF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uFAAuF,CAAC,CAAC,QAAQ,EAAE;SAClI;QACD,WAAW,EAAE,0BAA0B;KAC1C,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,MAA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E,QAAQ,EAAE,EAAE;QACzG,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC;QAC5B,OAAO,GAAG,CAAC;IACf,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,yDAAyD;IACzD,OAAO,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACzC,WAAW,EAAE,kBAAkB,CAAC,GAAG,CAAC,aAAa,CAAC;QAClD,kBAAkB,EAAE,GAAG;KAC1B,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { type GrepMatch } from "../helpers/grepLines.js";
|
|
3
|
+
export interface GrepLlmsTxtResult {
|
|
4
|
+
pattern: string;
|
|
5
|
+
totalLines: number;
|
|
6
|
+
totalMatches: number;
|
|
7
|
+
returnedMatches: number;
|
|
8
|
+
truncated: boolean;
|
|
9
|
+
matches: GrepMatch[];
|
|
10
|
+
catalogResourceUri: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function registerGrepLlmsTxtTool(server: McpServer): void;
|
|
13
|
+
//# sourceMappingURL=grepLlmsTxt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grepLlmsTxt.d.ts","sourceRoot":"","sources":["../../src/tools/grepLlmsTxt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAC;AAGjC,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAsDD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,QA0DxD"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { registerToolDefinition } from "../types/toolConfig.js";
|
|
4
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from "../types/toolAnnotations.js";
|
|
5
|
+
import { grepLines, MAX_CONTEXT, MAX_COUNT_HARD_CAP, } from "../helpers/grepLines.js";
|
|
6
|
+
import { fetchLlmsTxt } from "../resources/catalog/llmsTxt.js";
|
|
7
|
+
const inputSchema = {
|
|
8
|
+
pattern: z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.describe("Regex (default) or literal substring (when fixedString=true). Tested against each line of llms.txt independently — same model as `grep`."),
|
|
12
|
+
caseInsensitive: z
|
|
13
|
+
.boolean()
|
|
14
|
+
.default(false)
|
|
15
|
+
.describe("Equivalent to grep -i. Default false."),
|
|
16
|
+
invertMatch: z
|
|
17
|
+
.boolean()
|
|
18
|
+
.default(false)
|
|
19
|
+
.describe("Equivalent to grep -v: return lines that do NOT match. Default false."),
|
|
20
|
+
fixedString: z
|
|
21
|
+
.boolean()
|
|
22
|
+
.default(false)
|
|
23
|
+
.describe("Equivalent to grep -F: treat pattern as a literal substring, not a regex. Use this when grepping for text containing regex metacharacters. Default false."),
|
|
24
|
+
beforeContext: z
|
|
25
|
+
.number()
|
|
26
|
+
.int()
|
|
27
|
+
.min(0)
|
|
28
|
+
.max(MAX_CONTEXT)
|
|
29
|
+
.default(0)
|
|
30
|
+
.describe(`Equivalent to grep -B: lines of preceding context to include with each match. Capped at ${MAX_CONTEXT}.`),
|
|
31
|
+
afterContext: z
|
|
32
|
+
.number()
|
|
33
|
+
.int()
|
|
34
|
+
.min(0)
|
|
35
|
+
.max(MAX_CONTEXT)
|
|
36
|
+
.default(0)
|
|
37
|
+
.describe(`Equivalent to grep -A: lines of trailing context to include with each match. Capped at ${MAX_CONTEXT}.`),
|
|
38
|
+
maxCount: z
|
|
39
|
+
.number()
|
|
40
|
+
.int()
|
|
41
|
+
.min(1)
|
|
42
|
+
.max(MAX_COUNT_HARD_CAP)
|
|
43
|
+
.default(100)
|
|
44
|
+
.describe(`Equivalent to grep -m: stop returning matches after this many. totalMatches in the response still reflects the true count across the whole file. Hard cap ${MAX_COUNT_HARD_CAP}.`),
|
|
45
|
+
};
|
|
46
|
+
export function registerGrepLlmsTxtTool(server) {
|
|
47
|
+
server.registerTool("grep_llms_txt", {
|
|
48
|
+
title: "Grep the Octopus API catalog (llms.txt)",
|
|
49
|
+
description: `Search the Octopus API catalog at octopus://api/llms.txt with grep-style semantics. The catalog is large (~300+ KB) — call this rather than reading the resource body directly.
|
|
50
|
+
|
|
51
|
+
llms.txt is structured as:
|
|
52
|
+
- Authentication and Space Selection sections (top of file)
|
|
53
|
+
- Endpoints section: one '### {Category}' heading per resource family (Accounts, ActionTemplates, Channels, Releases, …) and one bullet per endpoint of the form
|
|
54
|
+
\`- \\\`METHOD /path\\\` - description | Prefixes (pick one): /{spaceId}, /spaces/{spaceIdentifier} | ?queryParams → ReturnType\`
|
|
55
|
+
- Steps section: deployment step types (Octopus.* ActionType) and their configurable property keys.
|
|
56
|
+
|
|
57
|
+
Useful patterns:
|
|
58
|
+
- 'POST /releases' — find write endpoints under a resource family
|
|
59
|
+
- 'DELETE ' — enumerate delete endpoints
|
|
60
|
+
- '### Channels' — jump to a section heading
|
|
61
|
+
- 'Body: Create.*Command' — find endpoints that take a Create command body
|
|
62
|
+
|
|
63
|
+
Parameter conventions mirror GNU grep:
|
|
64
|
+
- pattern (regex by default; set fixedString:true for literal text)
|
|
65
|
+
- caseInsensitive (-i)
|
|
66
|
+
- invertMatch (-v)
|
|
67
|
+
- fixedString (-F)
|
|
68
|
+
- beforeContext (-B)
|
|
69
|
+
- afterContext (-A)
|
|
70
|
+
- maxCount (-m)
|
|
71
|
+
|
|
72
|
+
Response: totalMatches (true count across the whole file), totalLines, the matched lines with 1-indexed lineNumber, optional before/after context arrays, and catalogResourceUri for the structured fall-through.`,
|
|
73
|
+
inputSchema,
|
|
74
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
75
|
+
}, async (args) => {
|
|
76
|
+
const params = args;
|
|
77
|
+
const body = await fetchLlmsTxt();
|
|
78
|
+
const { totalLines, totalMatches, matches } = grepLines(body, params);
|
|
79
|
+
const result = {
|
|
80
|
+
pattern: params.pattern,
|
|
81
|
+
totalLines,
|
|
82
|
+
totalMatches,
|
|
83
|
+
returnedMatches: matches.length,
|
|
84
|
+
truncated: totalMatches > matches.length,
|
|
85
|
+
matches,
|
|
86
|
+
catalogResourceUri: "octopus://api/llms.txt",
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
content: [
|
|
90
|
+
{
|
|
91
|
+
type: "text",
|
|
92
|
+
text: JSON.stringify(result),
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
registerToolDefinition({
|
|
99
|
+
toolName: "grep_llms_txt",
|
|
100
|
+
config: { toolset: "core", readOnly: true },
|
|
101
|
+
registerFn: registerGrepLlmsTxtTool,
|
|
102
|
+
// The /api/experimental/llms.txt endpoint shipped in Octopus 2026.2.3916.
|
|
103
|
+
minimumOctopusVersion: "2026.2.3916",
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=grepLlmsTxt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grepLlmsTxt.js","sourceRoot":"","sources":["../../src/tools/grepLlmsTxt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE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D,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,KAAK,EAAE,yCAAyC;QAChD,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;kNAuB+L;QAC5M,WAAW;QACX,WAAW,EAAE,0BAA0B;KACxC,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,MAAM,GAAG,IAAuB,CAAC;QAEvC,MAAM,IAAI,GAAG,MAAM,YAAY,EAAE,CAAC;QAClC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAEtE,MAAM,MAAM,GAAsB;YAChC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,UAAU;YACV,YAAY;YACZ,eAAe,EAAE,OAAO,CAAC,MAAM;YAC/B,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM;YACxC,OAAO;YACP,kBAAkB,EAAE,wBAAwB;SAC7C,CAAC;QAEF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;iBAC7B;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,eAAe;IACzB,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC3C,UAAU,EAAE,uBAAuB;IACnC,0EAA0E;IAC1E,qBAAqB,EAAE,aAAa;CACrC,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { type GrepMatch } from "../helpers/grepLines.js";
|
|
3
|
+
export interface GrepTaskLogParams {
|
|
4
|
+
spaceName: string;
|
|
5
|
+
taskId: string;
|
|
6
|
+
pattern: string;
|
|
7
|
+
caseInsensitive?: boolean;
|
|
8
|
+
invertMatch?: boolean;
|
|
9
|
+
fixedString?: boolean;
|
|
10
|
+
beforeContext?: number;
|
|
11
|
+
afterContext?: number;
|
|
12
|
+
maxCount?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface GrepTaskLogResult {
|
|
15
|
+
spaceName: string;
|
|
16
|
+
taskId: string;
|
|
17
|
+
pattern: string;
|
|
18
|
+
totalLines: number;
|
|
19
|
+
totalMatches: number;
|
|
20
|
+
returnedMatches: number;
|
|
21
|
+
truncated: boolean;
|
|
22
|
+
matches: GrepMatch[];
|
|
23
|
+
/**
|
|
24
|
+
* URI for the structured ActivityLogs tree if the agent needs more than
|
|
25
|
+
* grep can express (e.g. step hierarchy, category filtering, timing).
|
|
26
|
+
*/
|
|
27
|
+
taskDetailsResourceUri: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function registerGrepTaskLogTool(server: McpServer): void;
|
|
30
|
+
//# sourceMappingURL=grepTaskLog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grepTaskLog.d.ts","sourceRoot":"","sources":["../../src/tools/grepTaskLog.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASzE,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB;;;OAGG;IACH,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAkDD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,QAsExD"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Client, SpaceServerTaskRepository } 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 { READ_ONLY_TOOL_ANNOTATIONS } from "../types/toolAnnotations.js";
|
|
6
|
+
import { getClientConfigurationFromEnvironment } from "../helpers/getClientConfigurationFromEnvironment.js";
|
|
7
|
+
import { validateEntityId, handleOctopusApiError, ENTITY_PREFIXES, } from "../helpers/errorHandling.js";
|
|
8
|
+
import { grepLines, MAX_CONTEXT, MAX_COUNT_HARD_CAP, } from "../helpers/grepLines.js";
|
|
9
|
+
const inputSchema = {
|
|
10
|
+
spaceName: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe("Octopus space name. Case-sensitive."),
|
|
13
|
+
taskId: z
|
|
14
|
+
.string()
|
|
15
|
+
.describe("ServerTasks-XXXX ID. Use find_releases or list_deployments to discover task IDs from their parent entities."),
|
|
16
|
+
pattern: z
|
|
17
|
+
.string()
|
|
18
|
+
.min(1)
|
|
19
|
+
.describe("Regex (default) or literal substring (when fixedString=true). Anchors and groups behave as in JavaScript RegExp. Tested against each log line independently — the same model as `grep`."),
|
|
20
|
+
caseInsensitive: z
|
|
21
|
+
.boolean()
|
|
22
|
+
.default(false)
|
|
23
|
+
.describe("Equivalent to grep -i. Default false."),
|
|
24
|
+
invertMatch: z
|
|
25
|
+
.boolean()
|
|
26
|
+
.default(false)
|
|
27
|
+
.describe("Equivalent to grep -v: return lines that do NOT match. Default false."),
|
|
28
|
+
fixedString: z
|
|
29
|
+
.boolean()
|
|
30
|
+
.default(false)
|
|
31
|
+
.describe("Equivalent to grep -F: treat pattern as a literal substring, not a regex. Use this when grepping for text containing regex metacharacters. Default false."),
|
|
32
|
+
beforeContext: z
|
|
33
|
+
.number()
|
|
34
|
+
.int()
|
|
35
|
+
.min(0)
|
|
36
|
+
.max(MAX_CONTEXT)
|
|
37
|
+
.default(0)
|
|
38
|
+
.describe(`Equivalent to grep -B: lines of preceding context to include with each match. Capped at ${MAX_CONTEXT}.`),
|
|
39
|
+
afterContext: z
|
|
40
|
+
.number()
|
|
41
|
+
.int()
|
|
42
|
+
.min(0)
|
|
43
|
+
.max(MAX_CONTEXT)
|
|
44
|
+
.default(0)
|
|
45
|
+
.describe(`Equivalent to grep -A: lines of trailing context to include with each match. Capped at ${MAX_CONTEXT}.`),
|
|
46
|
+
maxCount: z
|
|
47
|
+
.number()
|
|
48
|
+
.int()
|
|
49
|
+
.min(1)
|
|
50
|
+
.max(MAX_COUNT_HARD_CAP)
|
|
51
|
+
.default(100)
|
|
52
|
+
.describe(`Equivalent to grep -m: stop returning matches after this many. totalMatches in the response still reflects the true count across the whole log. Hard cap ${MAX_COUNT_HARD_CAP}.`),
|
|
53
|
+
};
|
|
54
|
+
export function registerGrepTaskLogTool(server) {
|
|
55
|
+
server.registerTool("grep_task_log", {
|
|
56
|
+
title: "Grep an Octopus task activity log",
|
|
57
|
+
description: `Search a server task's activity log with grep-style semantics. Returns only matching lines (with optional symmetric context windows). This is the canonical way to inspect task logs — there is no full-log resource URI, because exposing one would tempt callers to inhale multi-megabyte bodies when grep is almost always the better primitive.
|
|
58
|
+
|
|
59
|
+
Use this when you know what to look for (a specific error string, a step name, a pattern). For structured access to the activity tree (step hierarchy, categories, timing) use the octopus://spaces/{spaceName}/tasks/{taskId}/details resource instead.
|
|
60
|
+
|
|
61
|
+
Parameter conventions mirror GNU grep so the schema is self-explanatory:
|
|
62
|
+
- pattern (regex by default; set fixedString:true for literal text)
|
|
63
|
+
- caseInsensitive (-i)
|
|
64
|
+
- invertMatch (-v)
|
|
65
|
+
- fixedString (-F)
|
|
66
|
+
- beforeContext (-B)
|
|
67
|
+
- afterContext (-A)
|
|
68
|
+
- maxCount (-m)
|
|
69
|
+
|
|
70
|
+
Response includes totalMatches (true count across the whole log), totalLines, the matched lines with 1-indexed lineNumber, optional before/after context arrays, and a taskDetailsResourceUri for the structured fall-through.`,
|
|
71
|
+
inputSchema,
|
|
72
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
73
|
+
}, async (args) => {
|
|
74
|
+
const params = args;
|
|
75
|
+
const { spaceName, taskId } = params;
|
|
76
|
+
validateEntityId(taskId, "task", ENTITY_PREFIXES.task);
|
|
77
|
+
try {
|
|
78
|
+
const client = await Client.create(getClientConfigurationFromEnvironment());
|
|
79
|
+
const rawLog = await new SpaceServerTaskRepository(client, spaceName).getRaw(taskId);
|
|
80
|
+
const { totalLines, totalMatches, matches } = grepLines(rawLog, params);
|
|
81
|
+
const result = {
|
|
82
|
+
spaceName,
|
|
83
|
+
taskId,
|
|
84
|
+
pattern: params.pattern,
|
|
85
|
+
totalLines,
|
|
86
|
+
totalMatches,
|
|
87
|
+
returnedMatches: matches.length,
|
|
88
|
+
truncated: totalMatches > matches.length,
|
|
89
|
+
matches,
|
|
90
|
+
taskDetailsResourceUri: `octopus://spaces/${encodeURIComponent(spaceName)}/tasks/${encodeURIComponent(taskId)}/details`,
|
|
91
|
+
};
|
|
92
|
+
return {
|
|
93
|
+
content: [
|
|
94
|
+
{
|
|
95
|
+
type: "text",
|
|
96
|
+
text: JSON.stringify(result),
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
handleOctopusApiError(error, {
|
|
103
|
+
entityType: "task",
|
|
104
|
+
entityId: taskId,
|
|
105
|
+
spaceName,
|
|
106
|
+
helpText: "Use find_releases or list_deployments to discover task IDs via their parent entity. Use get_task_from_url to resolve a task ID from an Octopus portal URL.",
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
registerToolDefinition({
|
|
112
|
+
toolName: "grep_task_log",
|
|
113
|
+
config: { toolset: "tasks", readOnly: true },
|
|
114
|
+
registerFn: registerGrepTaskLogTool,
|
|
115
|
+
});
|
|
116
|
+
//# sourceMappingURL=grepTaskLog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grepTaskLog.js","sourceRoot":"","sources":["../../src/tools/grepTaskLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,qCAAqC,EAAE,MAAM,qDAAqD,CAAC;AAC5G,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,GAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,SAAS,EACT,WAAW,EACX,kBAAkB,GAEnB,MAAM,yBAAyB,CAAC;AA8BjC,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,CAAC,qCAAqC,CAAC;IAClD,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,CAAC,6GAA6G,CAAC;IAC1H,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yLAAyL,CAC1L;IAC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/tools/index.d.ts
CHANGED
|
@@ -4,26 +4,30 @@ import "./listSpaces.js";
|
|
|
4
4
|
import "./listProjects.js";
|
|
5
5
|
import "./listEnvironments.js";
|
|
6
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
7
|
import "./getTenantVariables.js";
|
|
16
8
|
import "./getMissingTenantVariables.js";
|
|
17
9
|
import "./getKubernetesLiveStatus.js";
|
|
18
|
-
import "./
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
10
|
+
import "./getDeploymentProcess.js";
|
|
11
|
+
import "./getBranches.js";
|
|
12
|
+
import "./getCurrentUser.js";
|
|
13
|
+
import "./getVariables.js";
|
|
14
|
+
import "./getTaskFromUrl.js";
|
|
15
|
+
import "./getDeploymentFromUrl.js";
|
|
16
|
+
import "./findReleases.js";
|
|
17
|
+
import "./findRunbooks.js";
|
|
18
|
+
import "./findTenants.js";
|
|
19
|
+
import "./findDeploymentTargets.js";
|
|
20
|
+
import "./findCertificates.js";
|
|
21
|
+
import "./findAccounts.js";
|
|
22
|
+
import "./findInterruptions.js";
|
|
23
|
+
import "./findFeatureToggles.js";
|
|
24
|
+
import "./updateFeatureToggle.js";
|
|
25
|
+
import "./createRelease.js";
|
|
26
|
+
import "./deployRelease.js";
|
|
27
|
+
import "./runRunbook.js";
|
|
28
|
+
import "./grepTaskLog.js";
|
|
29
|
+
import "./grepLlmsTxt.js";
|
|
30
|
+
import "./execute.js";
|
|
31
|
+
import "./readResource.js";
|
|
28
32
|
export declare function registerTools(server: McpServer, config?: ToolsetConfig): void;
|
|
29
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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,
|
|
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,yBAAyB,CAAC;AACjC,OAAO,gCAAgC,CAAC;AACxC,OAAO,8BAA8B,CAAC;AACtC,OAAO,2BAA2B,CAAC;AACnC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,2BAA2B,CAAC;AAGnC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,4BAA4B,CAAC;AACpC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,wBAAwB,CAAC;AAGhC,OAAO,yBAAyB,CAAC;AACjC,OAAO,0BAA0B,CAAC;AAGlC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,iBAAiB,CAAC;AAGzB,OAAO,kBAAkB,CAAC;AAG1B,OAAO,kBAAkB,CAAC;AAG1B,OAAO,cAAc,CAAC;AAGtB,OAAO,mBAAmB,CAAC;AA8B3B,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,GAAE,aAAkB,QAO1E"}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,31 +1,42 @@
|
|
|
1
1
|
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
import { TOOL_REGISTRY, DEFAULT_TOOLSETS } from "../types/toolConfig.js";
|
|
2
|
+
import { TOOL_REGISTRY, DEFAULT_TOOLSETS, } from "../types/toolConfig.js";
|
|
3
3
|
// Import all tool files to trigger their self-registration
|
|
4
4
|
import "./listSpaces.js";
|
|
5
5
|
import "./listProjects.js";
|
|
6
6
|
import "./listEnvironments.js";
|
|
7
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
8
|
import "./getTenantVariables.js";
|
|
17
9
|
import "./getMissingTenantVariables.js";
|
|
18
10
|
import "./getKubernetesLiveStatus.js";
|
|
19
|
-
import "./
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
11
|
+
import "./getDeploymentProcess.js";
|
|
12
|
+
import "./getBranches.js";
|
|
13
|
+
import "./getCurrentUser.js";
|
|
14
|
+
import "./getVariables.js";
|
|
15
|
+
import "./getTaskFromUrl.js";
|
|
16
|
+
import "./getDeploymentFromUrl.js";
|
|
17
|
+
// Unified Find endpoints (replacing separate list/get pairs)
|
|
18
|
+
import "./findReleases.js";
|
|
19
|
+
import "./findRunbooks.js";
|
|
20
|
+
import "./findTenants.js";
|
|
21
|
+
import "./findDeploymentTargets.js";
|
|
22
|
+
import "./findCertificates.js";
|
|
23
|
+
import "./findAccounts.js";
|
|
24
|
+
import "./findInterruptions.js";
|
|
25
|
+
// Feature toggles
|
|
26
|
+
import "./findFeatureToggles.js";
|
|
27
|
+
import "./updateFeatureToggle.js";
|
|
28
|
+
// Write operations
|
|
29
|
+
import "./createRelease.js";
|
|
30
|
+
import "./deployRelease.js";
|
|
31
|
+
import "./runRunbook.js";
|
|
32
|
+
// Task log search
|
|
33
|
+
import "./grepTaskLog.js";
|
|
34
|
+
// API catalog search (llms.txt)
|
|
35
|
+
import "./grepLlmsTxt.js";
|
|
36
|
+
// REST backstop with hard read/write/delete gating
|
|
37
|
+
import "./execute.js";
|
|
38
|
+
// Resource backstop for clients without native MCP resource support
|
|
39
|
+
import "./readResource.js";
|
|
29
40
|
function isToolEnabled(toolRegistration, config) {
|
|
30
41
|
if (!toolRegistration) {
|
|
31
42
|
return false;
|
|
@@ -33,8 +44,9 @@ function isToolEnabled(toolRegistration, config) {
|
|
|
33
44
|
// Check if toolset is enabled
|
|
34
45
|
const enabledToolsets = config.enabledToolsets === "all"
|
|
35
46
|
? DEFAULT_TOOLSETS
|
|
36
|
-
:
|
|
37
|
-
if (toolRegistration.config.toolset !== "core" &&
|
|
47
|
+
: config.enabledToolsets || DEFAULT_TOOLSETS;
|
|
48
|
+
if (toolRegistration.config.toolset !== "core" &&
|
|
49
|
+
!enabledToolsets.includes(toolRegistration.config.toolset)) {
|
|
38
50
|
return false;
|
|
39
51
|
}
|
|
40
52
|
// Check read-only mode
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB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