@octopusdeploy/mcp-server 1.1.0 → 2.1.1

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.
Files changed (231) hide show
  1. package/README.md +202 -47
  2. package/dist/helpers/activeToolsetConfig.d.ts +4 -0
  3. package/dist/helpers/activeToolsetConfig.d.ts.map +1 -0
  4. package/dist/helpers/activeToolsetConfig.js +18 -0
  5. package/dist/helpers/activeToolsetConfig.js.map +1 -0
  6. package/dist/helpers/errorHandling.d.ts +3 -0
  7. package/dist/helpers/errorHandling.d.ts.map +1 -1
  8. package/dist/helpers/errorHandling.js +4 -1
  9. package/dist/helpers/errorHandling.js.map +1 -1
  10. package/dist/helpers/getClientConfigurationFromEnvironment.d.ts +2 -0
  11. package/dist/helpers/getClientConfigurationFromEnvironment.d.ts.map +1 -1
  12. package/dist/helpers/getClientConfigurationFromEnvironment.js +20 -4
  13. package/dist/helpers/getClientConfigurationFromEnvironment.js.map +1 -1
  14. package/dist/helpers/grepLines.d.ts +38 -0
  15. package/dist/helpers/grepLines.d.ts.map +1 -0
  16. package/dist/helpers/grepLines.js +65 -0
  17. package/dist/helpers/grepLines.js.map +1 -0
  18. package/dist/helpers/methodTier.d.ts +15 -0
  19. package/dist/helpers/methodTier.d.ts.map +1 -0
  20. package/dist/helpers/methodTier.js +25 -0
  21. package/dist/helpers/methodTier.js.map +1 -0
  22. package/dist/helpers/pathAllowlist.d.ts +27 -0
  23. package/dist/helpers/pathAllowlist.d.ts.map +1 -0
  24. package/dist/helpers/pathAllowlist.js +177 -0
  25. package/dist/helpers/pathAllowlist.js.map +1 -0
  26. package/dist/helpers/pathGlob.d.ts +15 -0
  27. package/dist/helpers/pathGlob.d.ts.map +1 -0
  28. package/dist/helpers/pathGlob.js +47 -0
  29. package/dist/helpers/pathGlob.js.map +1 -0
  30. package/dist/helpers/requireConfirmation.d.ts +119 -0
  31. package/dist/helpers/requireConfirmation.d.ts.map +1 -0
  32. package/dist/helpers/requireConfirmation.js +148 -0
  33. package/dist/helpers/requireConfirmation.js.map +1 -0
  34. package/dist/helpers/sensitivePathDenylist.d.ts +32 -0
  35. package/dist/helpers/sensitivePathDenylist.d.ts.map +1 -0
  36. package/dist/helpers/sensitivePathDenylist.js +49 -0
  37. package/dist/helpers/sensitivePathDenylist.js.map +1 -0
  38. package/dist/helpers/stripLinks.d.ts +15 -0
  39. package/dist/helpers/stripLinks.d.ts.map +1 -0
  40. package/dist/helpers/stripLinks.js +19 -0
  41. package/dist/helpers/stripLinks.js.map +1 -0
  42. package/dist/helpers/userCache.d.ts +14 -0
  43. package/dist/helpers/userCache.d.ts.map +1 -0
  44. package/dist/helpers/userCache.js +16 -0
  45. package/dist/helpers/userCache.js.map +1 -0
  46. package/dist/helpers/validateExecutePath.d.ts +29 -0
  47. package/dist/helpers/validateExecutePath.d.ts.map +1 -0
  48. package/dist/helpers/validateExecutePath.js +62 -0
  49. package/dist/helpers/validateExecutePath.js.map +1 -0
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +58 -9
  52. package/dist/index.js.map +1 -1
  53. package/dist/resources/catalog/capabilities.d.ts +36 -0
  54. package/dist/resources/catalog/capabilities.d.ts.map +1 -0
  55. package/dist/resources/catalog/capabilities.js +89 -0
  56. package/dist/resources/catalog/capabilities.js.map +1 -0
  57. package/dist/resources/catalog/llmsTxt.d.ts +8 -0
  58. package/dist/resources/catalog/llmsTxt.d.ts.map +1 -0
  59. package/dist/resources/catalog/llmsTxt.js +44 -0
  60. package/dist/resources/catalog/llmsTxt.js.map +1 -0
  61. package/dist/resources/dispatch.d.ts +30 -0
  62. package/dist/resources/dispatch.d.ts.map +1 -0
  63. package/dist/resources/dispatch.js +81 -0
  64. package/dist/resources/dispatch.js.map +1 -0
  65. package/dist/resources/featureToggle.d.ts +2 -0
  66. package/dist/resources/featureToggle.d.ts.map +1 -0
  67. package/dist/resources/featureToggle.js +34 -0
  68. package/dist/resources/featureToggle.js.map +1 -0
  69. package/dist/resources/index.d.ts +12 -0
  70. package/dist/resources/index.d.ts.map +1 -0
  71. package/dist/resources/index.js +44 -0
  72. package/dist/resources/index.js.map +1 -0
  73. package/dist/resources/interruption.d.ts +2 -0
  74. package/dist/resources/interruption.d.ts.map +1 -0
  75. package/dist/resources/interruption.js +34 -0
  76. package/dist/resources/interruption.js.map +1 -0
  77. package/dist/resources/release.d.ts +2 -0
  78. package/dist/resources/release.d.ts.map +1 -0
  79. package/dist/resources/release.js +33 -0
  80. package/dist/resources/release.js.map +1 -0
  81. package/dist/resources/rolloutGroup.d.ts +2 -0
  82. package/dist/resources/rolloutGroup.d.ts.map +1 -0
  83. package/dist/resources/rolloutGroup.js +35 -0
  84. package/dist/resources/rolloutGroup.js.map +1 -0
  85. package/dist/resources/runbook.d.ts +2 -0
  86. package/dist/resources/runbook.d.ts.map +1 -0
  87. package/dist/resources/runbook.js +34 -0
  88. package/dist/resources/runbook.js.map +1 -0
  89. package/dist/resources/task.d.ts +2 -0
  90. package/dist/resources/task.d.ts.map +1 -0
  91. package/dist/resources/task.js +68 -0
  92. package/dist/resources/task.js.map +1 -0
  93. package/dist/tools/createRelease.d.ts.map +1 -1
  94. package/dist/tools/createRelease.js +93 -50
  95. package/dist/tools/createRelease.js.map +1 -1
  96. package/dist/tools/deployRelease.d.ts.map +1 -1
  97. package/dist/tools/deployRelease.js +117 -97
  98. package/dist/tools/deployRelease.js.map +1 -1
  99. package/dist/tools/execute.d.ts +3 -0
  100. package/dist/tools/execute.d.ts.map +1 -0
  101. package/dist/tools/execute.js +262 -0
  102. package/dist/tools/execute.js.map +1 -0
  103. package/dist/tools/findAccounts.d.ts.map +1 -1
  104. package/dist/tools/findAccounts.js +15 -12
  105. package/dist/tools/findAccounts.js.map +1 -1
  106. package/dist/tools/findCertificates.d.ts.map +1 -1
  107. package/dist/tools/findCertificates.js +19 -16
  108. package/dist/tools/findCertificates.js.map +1 -1
  109. package/dist/tools/findDeploymentTargets.d.ts.map +1 -1
  110. package/dist/tools/findDeploymentTargets.js +26 -23
  111. package/dist/tools/findDeploymentTargets.js.map +1 -1
  112. package/dist/tools/findFeatureToggles.d.ts +37 -0
  113. package/dist/tools/findFeatureToggles.d.ts.map +1 -0
  114. package/dist/tools/findFeatureToggles.js +139 -0
  115. package/dist/tools/findFeatureToggles.js.map +1 -0
  116. package/dist/tools/findInterruptions.d.ts +79 -0
  117. package/dist/tools/findInterruptions.d.ts.map +1 -0
  118. package/dist/tools/findInterruptions.js +273 -0
  119. package/dist/tools/findInterruptions.js.map +1 -0
  120. package/dist/tools/findReleases.d.ts.map +1 -1
  121. package/dist/tools/findReleases.js +90 -48
  122. package/dist/tools/findReleases.js.map +1 -1
  123. package/dist/tools/findRunbooks.d.ts +3 -0
  124. package/dist/tools/findRunbooks.d.ts.map +1 -0
  125. package/dist/tools/findRunbooks.js +139 -0
  126. package/dist/tools/findRunbooks.js.map +1 -0
  127. package/dist/tools/findTenants.d.ts.map +1 -1
  128. package/dist/tools/findTenants.js +28 -25
  129. package/dist/tools/findTenants.js.map +1 -1
  130. package/dist/tools/getBranches.d.ts.map +1 -1
  131. package/dist/tools/getBranches.js +13 -10
  132. package/dist/tools/getBranches.js.map +1 -1
  133. package/dist/tools/getCurrentUser.d.ts.map +1 -1
  134. package/dist/tools/getCurrentUser.js +7 -4
  135. package/dist/tools/getCurrentUser.js.map +1 -1
  136. package/dist/tools/getDeploymentFromUrl.d.ts +8 -3
  137. package/dist/tools/getDeploymentFromUrl.d.ts.map +1 -1
  138. package/dist/tools/getDeploymentFromUrl.js +46 -18
  139. package/dist/tools/getDeploymentFromUrl.js.map +1 -1
  140. package/dist/tools/getDeploymentProcess.d.ts.map +1 -1
  141. package/dist/tools/getDeploymentProcess.js +26 -23
  142. package/dist/tools/getDeploymentProcess.js.map +1 -1
  143. package/dist/tools/getKubernetesLiveStatus.d.ts.map +1 -1
  144. package/dist/tools/getKubernetesLiveStatus.js +13 -10
  145. package/dist/tools/getKubernetesLiveStatus.js.map +1 -1
  146. package/dist/tools/getMissingTenantVariables.d.ts.map +1 -1
  147. package/dist/tools/getMissingTenantVariables.js +13 -10
  148. package/dist/tools/getMissingTenantVariables.js.map +1 -1
  149. package/dist/tools/getTaskFromUrl.d.ts +2 -3
  150. package/dist/tools/getTaskFromUrl.d.ts.map +1 -1
  151. package/dist/tools/getTaskFromUrl.js +33 -33
  152. package/dist/tools/getTaskFromUrl.js.map +1 -1
  153. package/dist/tools/getTenantVariables.d.ts.map +1 -1
  154. package/dist/tools/getTenantVariables.js +13 -10
  155. package/dist/tools/getTenantVariables.js.map +1 -1
  156. package/dist/tools/getVariables.d.ts.map +1 -1
  157. package/dist/tools/getVariables.js +12 -9
  158. package/dist/tools/getVariables.js.map +1 -1
  159. package/dist/tools/grepLlmsTxt.d.ts +13 -0
  160. package/dist/tools/grepLlmsTxt.d.ts.map +1 -0
  161. package/dist/tools/grepLlmsTxt.js +105 -0
  162. package/dist/tools/grepLlmsTxt.js.map +1 -0
  163. package/dist/tools/grepTaskLog.d.ts +30 -0
  164. package/dist/tools/grepTaskLog.d.ts.map +1 -0
  165. package/dist/tools/grepTaskLog.js +116 -0
  166. package/dist/tools/grepTaskLog.js.map +1 -0
  167. package/dist/tools/index.d.ts +11 -5
  168. package/dist/tools/index.d.ts.map +1 -1
  169. package/dist/tools/index.js +21 -7
  170. package/dist/tools/index.js.map +1 -1
  171. package/dist/tools/listDeployments.d.ts.map +1 -1
  172. package/dist/tools/listDeployments.js +22 -13
  173. package/dist/tools/listDeployments.js.map +1 -1
  174. package/dist/tools/listEnvironments.d.ts.map +1 -1
  175. package/dist/tools/listEnvironments.js +12 -9
  176. package/dist/tools/listEnvironments.js.map +1 -1
  177. package/dist/tools/listProjects.d.ts.map +1 -1
  178. package/dist/tools/listProjects.js +10 -7
  179. package/dist/tools/listProjects.js.map +1 -1
  180. package/dist/tools/listSpaces.d.ts.map +1 -1
  181. package/dist/tools/listSpaces.js +9 -6
  182. package/dist/tools/listSpaces.js.map +1 -1
  183. package/dist/tools/readResource.d.ts +3 -0
  184. package/dist/tools/readResource.d.ts.map +1 -0
  185. package/dist/tools/readResource.js +50 -0
  186. package/dist/tools/readResource.js.map +1 -0
  187. package/dist/tools/runRunbook.d.ts +3 -0
  188. package/dist/tools/runRunbook.d.ts.map +1 -0
  189. package/dist/tools/runRunbook.js +174 -0
  190. package/dist/tools/runRunbook.js.map +1 -0
  191. package/dist/tools/updateFeatureToggle.d.ts +94 -0
  192. package/dist/tools/updateFeatureToggle.d.ts.map +1 -0
  193. package/dist/tools/updateFeatureToggle.js +308 -0
  194. package/dist/tools/updateFeatureToggle.js.map +1 -0
  195. package/dist/types/featureToggleTypes.d.ts +47 -0
  196. package/dist/types/featureToggleTypes.d.ts.map +1 -0
  197. package/dist/types/featureToggleTypes.js +10 -0
  198. package/dist/types/featureToggleTypes.js.map +1 -0
  199. package/dist/types/resourceConfig.d.ts +17 -0
  200. package/dist/types/resourceConfig.d.ts.map +1 -0
  201. package/dist/types/resourceConfig.js +6 -0
  202. package/dist/types/resourceConfig.js.map +1 -0
  203. package/dist/types/toolAnnotations.d.ts +8 -0
  204. package/dist/types/toolAnnotations.d.ts.map +1 -0
  205. package/dist/types/toolAnnotations.js +28 -0
  206. package/dist/types/toolAnnotations.js.map +1 -0
  207. package/dist/types/toolConfig.d.ts +15 -1
  208. package/dist/types/toolConfig.d.ts.map +1 -1
  209. package/dist/types/toolConfig.js +4 -1
  210. package/dist/types/toolConfig.js.map +1 -1
  211. package/dist/utils/parseConfig.d.ts +1 -1
  212. package/dist/utils/parseConfig.d.ts.map +1 -1
  213. package/dist/utils/parseConfig.js +3 -2
  214. package/dist/utils/parseConfig.js.map +1 -1
  215. package/package.json +4 -4
  216. package/dist/tools/getTaskById.d.ts +0 -9
  217. package/dist/tools/getTaskById.d.ts.map +0 -1
  218. package/dist/tools/getTaskById.js +0 -51
  219. package/dist/tools/getTaskById.js.map +0 -1
  220. package/dist/tools/getTaskDetails.d.ts +0 -9
  221. package/dist/tools/getTaskDetails.d.ts.map +0 -1
  222. package/dist/tools/getTaskDetails.js +0 -65
  223. package/dist/tools/getTaskDetails.js.map +0 -1
  224. package/dist/tools/getTaskRaw.d.ts +0 -9
  225. package/dist/tools/getTaskRaw.d.ts.map +0 -1
  226. package/dist/tools/getTaskRaw.js +0 -50
  227. package/dist/tools/getTaskRaw.js.map +0 -1
  228. package/dist/tools/listReleasesForProject.d.ts +0 -3
  229. package/dist/tools/listReleasesForProject.d.ts.map +0 -1
  230. package/dist/tools/listReleasesForProject.js +0 -60
  231. package/dist/tools/listReleasesForProject.js.map +0 -1
@@ -0,0 +1,139 @@
1
+ import { Client, resolveSpaceId, } 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 { READ_ONLY_TOOL_ANNOTATIONS } from "../types/toolAnnotations.js";
7
+ import { handleOctopusApiError, isErrorWithMessage, } from "../helpers/errorHandling.js";
8
+ import {} from "../types/featureToggleTypes.js";
9
+ /**
10
+ * Slim per-environment shape returned alongside each toggle. Includes just
11
+ * enough state to answer "where is X turned on, and at what rollout?" without
12
+ * dereferencing the full toggle body. Tenant lists, segments, and minimum
13
+ * versions stay in the resource.
14
+ */
15
+ function environmentSummary(env) {
16
+ return {
17
+ deploymentEnvironmentId: env.DeploymentEnvironmentId,
18
+ isEnabled: env.IsEnabled,
19
+ rolloutPercentage: env.RolloutPercentage,
20
+ clientRolloutPercentage: env.ClientRolloutPercentage,
21
+ };
22
+ }
23
+ function toggleSummary(toggle, spaceName) {
24
+ const encodedSpace = encodeURIComponent(spaceName);
25
+ const encodedProjectId = encodeURIComponent(toggle.ProjectId);
26
+ const encodedSlug = encodeURIComponent(toggle.Slug);
27
+ return {
28
+ id: toggle.Id,
29
+ slug: toggle.Slug,
30
+ name: toggle.Name,
31
+ projectId: toggle.ProjectId,
32
+ defaultIsEnabled: toggle.DefaultIsEnabled,
33
+ rolloutGroupId: toggle.RolloutGroupId ?? null,
34
+ tags: toggle.Tags ?? [],
35
+ environmentSummaries: (toggle.Environments ?? []).map(environmentSummary),
36
+ resourceUri: `octopus://spaces/${encodedSpace}/projects/${encodedProjectId}/featuretoggles/${encodedSlug}`,
37
+ };
38
+ }
39
+ const findFeatureTogglesSchema = z.object({
40
+ spaceName: z.string().describe("Space name."),
41
+ projectId: z
42
+ .string()
43
+ .describe("Project ID (e.g. Projects-123). Feature toggles are scoped per project."),
44
+ partialName: z
45
+ .string()
46
+ .optional()
47
+ .describe("Case-insensitive substring match on the toggle name."),
48
+ tags: z
49
+ .array(z.string())
50
+ .optional()
51
+ .describe('Filter by canonical tag names (e.g. "release-rings/beta"). Repeats: a toggle matches if it has any of these tags.'),
52
+ environmentIds: z
53
+ .array(z.string())
54
+ .optional()
55
+ .describe("Filter by environment IDs (e.g. Environments-7). A toggle matches if it has configuration for any of these environments."),
56
+ skip: z
57
+ .number()
58
+ .int()
59
+ .min(0)
60
+ .optional()
61
+ .describe("Pagination offset (≥ 0)."),
62
+ take: z
63
+ .number()
64
+ .int()
65
+ .min(1)
66
+ .max(100)
67
+ .optional()
68
+ .describe("Pagination page size (1–100, server-side cap)."),
69
+ });
70
+ export async function findFeatureTogglesHandler(params) {
71
+ const { spaceName, projectId, partialName, tags, environmentIds, skip, take } = params;
72
+ const client = await Client.create(getClientConfigurationFromEnvironment());
73
+ let spaceId;
74
+ try {
75
+ spaceId = await resolveSpaceId(client, spaceName);
76
+ }
77
+ catch (error) {
78
+ handleOctopusApiError(error, { spaceName });
79
+ }
80
+ try {
81
+ const response = await client.get("~/api/{spaceId}/projects/{projectId}/featuretoggles{?Skip,Take,PartialName,Tags,Environments}", {
82
+ spaceId,
83
+ projectId,
84
+ Skip: skip,
85
+ Take: take,
86
+ PartialName: partialName,
87
+ Tags: tags,
88
+ Environments: environmentIds,
89
+ });
90
+ return {
91
+ content: [
92
+ {
93
+ type: "text",
94
+ text: JSON.stringify({
95
+ totalResults: response.TotalResults,
96
+ itemsPerPage: response.ItemsPerPage,
97
+ numberOfPages: response.NumberOfPages,
98
+ lastPageNumber: response.LastPageNumber,
99
+ items: (response.Items ?? []).map((toggle) => toggleSummary(toggle, spaceName)),
100
+ }),
101
+ },
102
+ ],
103
+ };
104
+ }
105
+ catch (error) {
106
+ // 404 at this layer is ambiguous: either feature toggles are disabled on
107
+ // the instance (per the API contract — every route returns 404 when the
108
+ // capability is off), or the projectId is wrong. The space itself was
109
+ // already resolved successfully above. Surface the disabled-capability
110
+ // hint rather than the generic "Space not found" message.
111
+ if (isErrorWithMessage(error, "not found") || isErrorWithMessage(error, "404")) {
112
+ throw new Error(`Feature toggles endpoint returned 404 for project '${projectId}' in space '${spaceName}'. ` +
113
+ "Either the customer feature toggles capability is disabled on this Octopus instance, or the projectId is incorrect. " +
114
+ "Use list_projects to verify the project ID.");
115
+ }
116
+ handleOctopusApiError(error, { spaceName });
117
+ }
118
+ }
119
+ export function registerFindFeatureTogglesTool(server) {
120
+ server.registerTool("find_feature_toggles", {
121
+ title: "Find feature toggles",
122
+ description: `List customer feature toggles in an Octopus Deploy project.
123
+
124
+ Each summary includes per-environment state (isEnabled, rolloutPercentage, clientRolloutPercentage) so "where is X turned on" is answerable from the list response. Heavy fields (description, tenant lists, segments, minimum versions) live in the resource body.
125
+
126
+ Dereference the returned resourceUri (octopus://spaces/{spaceName}/projects/{projectId}/featuretoggles/{slug}) for the full toggle body.
127
+
128
+ Use update_feature_toggle to flip an environment on/off or change rollout percentages on an existing toggle. This MCP server does not expose toggle creation, deletion, renaming, or rollout-group management — direct customers to the Octopus UI for those.`,
129
+ inputSchema: findFeatureTogglesSchema.shape,
130
+ annotations: READ_ONLY_TOOL_ANNOTATIONS,
131
+ }, findFeatureTogglesHandler);
132
+ }
133
+ registerToolDefinition({
134
+ toolName: "find_feature_toggles",
135
+ config: { toolset: "featureToggles", readOnly: true },
136
+ registerFn: registerFindFeatureTogglesTool,
137
+ minimumOctopusVersion: "2026.1.10655",
138
+ });
139
+ //# sourceMappingURL=findFeatureToggles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findFeatureToggles.js","sourceRoot":"","sources":["../../src/tools/findFeatureToggles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,cAAc,GAEf,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;AACzE,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGN,MAAM,gCAAgC,CAAC;AAExC;;;;;GAKG;AACH,SAAS,kBAAkB,CAAC,GAAqC;IAC/D,OAAO;QACL,uBAAuB,EAAE,GAAG,CAAC,uBAAuB;QACpD,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,iBAAiB,EAAE,GAAG,CAAC,iBAAiB;QACxC,uBAAuB,EAAE,GAAG,CAAC,uBAAuB;KACrD,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,MAA6B,EAAE,SAAiB;IACrE,MAAM,YAAY,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACnD,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC9D,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEpD,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,SAAS,EAAE,MAAM,CAAC,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A0D;QAC1D,IAAI,kBAAkB,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;YAC/E,MAAM,IAAI,KAAK,CACb,sDAAsD,SAAS,eAAe,SAAS,KAAK;gBAC1F,sHAAsH;gBACtH,6CAA6C,CAChD,CAAC;QACJ,CAAC;QACD,qBAAqB,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,MAAiB;IAC9D,MAAM,CAAC,YAAY,CACjB,sBAAsB,EACtB;QACE,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE;;;;;;8PAM2O;QACxP,WAAW,EAAE,wBAAwB,CAAC,KAAK;QAC3C,WAAW,EAAE,0BAA0B;KACxC,EACD,yBAAyB,CAC1B,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,sBAAsB;IAChC,MAAM,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE;IACrD,UAAU,EAAE,8BAA8B;IAC1C,qBAAqB,EAAE,cAAc;CACtC,CAAC,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ interface InterruptionFormElement {
3
+ Name: string;
4
+ Control?: {
5
+ Type?: string;
6
+ } | null;
7
+ IsValueRequired?: boolean;
8
+ }
9
+ interface InterruptionResource {
10
+ Id: string;
11
+ Title: string;
12
+ Type?: string;
13
+ Created: string;
14
+ IsPending: boolean;
15
+ Form?: {
16
+ Values?: Record<string, unknown> | null;
17
+ Elements?: InterruptionFormElement[] | null;
18
+ } | null;
19
+ RelatedDocumentIds?: string[];
20
+ ResponsibleTeamIds?: string[];
21
+ ResponsibleUserId?: string;
22
+ CanTakeResponsibility: boolean;
23
+ HasResponsibility: boolean;
24
+ IsLinkedToOtherInterruption?: boolean;
25
+ TaskId: string;
26
+ CorrelationId?: string;
27
+ SpaceId: string;
28
+ }
29
+ export declare function interruptionSummary(interruption: InterruptionResource, spaceName: string, instanceURL: string): {
30
+ id: string;
31
+ title: string;
32
+ type: string | undefined;
33
+ taskId: string;
34
+ correlationId: string | undefined;
35
+ isPending: boolean;
36
+ isLinkedToOtherInterruption: boolean | undefined;
37
+ created: string;
38
+ relatedDocumentIds: string[];
39
+ responsible: {
40
+ teamIds: string[];
41
+ userId: string | undefined;
42
+ canTakeResponsibility: boolean;
43
+ hasResponsibility: boolean;
44
+ };
45
+ formElementNames: string[];
46
+ resourceUri: string;
47
+ taskResourceUri: string;
48
+ publicUrl: string;
49
+ publicUrlInstruction: string;
50
+ };
51
+ export interface FindInterruptionsParams {
52
+ spaceName: string;
53
+ interruptionId?: string;
54
+ pendingOnly?: boolean;
55
+ assignedToMe?: boolean;
56
+ regarding?: string;
57
+ skip?: number;
58
+ take?: number;
59
+ }
60
+ export declare function findInterruptionsHandler(params: FindInterruptionsParams): Promise<{
61
+ content: {
62
+ type: "text";
63
+ text: string;
64
+ }[];
65
+ }>;
66
+ /**
67
+ * Page through the unfiltered /interruptions result set, collecting items
68
+ * the authenticated user can act on. Octopus has no responsibleUserId query
69
+ * parameter, so post-filtering is the only correctness-preserving option.
70
+ *
71
+ * Safety cap: ASSIGNED_SCAN_MAX records inspected. Almost always hit only
72
+ * with pendingOnly: false on busy spaces with deep history; the assigned
73
+ * set under pendingOnly: true is virtually always small.
74
+ */
75
+ export declare const ASSIGNED_SCAN_PAGE_SIZE = 100;
76
+ export declare const ASSIGNED_SCAN_MAX = 500;
77
+ export declare function registerFindInterruptionsTool(server: McpServer): void;
78
+ export {};
79
+ //# sourceMappingURL=findInterruptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findInterruptions.d.ts","sourceRoot":"","sources":["../../src/tools/findInterruptions.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,y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,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA4DD,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,uBAAuB;;;;;GA6I7E;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,iBAAiB,MAAM,CAAC;AA2DrC,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,QAyB9D"}
@@ -0,0 +1,273 @@
1
+ import { Client, resolveSpaceId, } 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 { getPublicUrl } from "../helpers/getPublicUrl.js";
7
+ import { getCurrentUserCached } from "../helpers/userCache.js";
8
+ import { validateEntityId, handleOctopusApiError, ENTITY_PREFIXES, } from "../helpers/errorHandling.js";
9
+ export function interruptionSummary(interruption, spaceName, instanceURL) {
10
+ const encodedSpace = encodeURIComponent(spaceName);
11
+ const encodedInterruptionId = encodeURIComponent(interruption.Id);
12
+ const encodedTaskId = encodeURIComponent(interruption.TaskId);
13
+ const elements = interruption.Form?.Elements ?? [];
14
+ return {
15
+ id: interruption.Id,
16
+ title: interruption.Title,
17
+ type: interruption.Type,
18
+ taskId: interruption.TaskId,
19
+ correlationId: interruption.CorrelationId,
20
+ isPending: interruption.IsPending,
21
+ isLinkedToOtherInterruption: interruption.IsLinkedToOtherInterruption,
22
+ created: interruption.Created,
23
+ relatedDocumentIds: interruption.RelatedDocumentIds ?? [],
24
+ responsible: {
25
+ teamIds: interruption.ResponsibleTeamIds ?? [],
26
+ userId: interruption.ResponsibleUserId,
27
+ canTakeResponsibility: interruption.CanTakeResponsibility,
28
+ hasResponsibility: interruption.HasResponsibility,
29
+ },
30
+ formElementNames: elements.map((element) => element.Name),
31
+ resourceUri: `octopus://spaces/${encodedSpace}/interruptions/${encodedInterruptionId}`,
32
+ taskResourceUri: `octopus://spaces/${encodedSpace}/tasks/${encodedTaskId}`,
33
+ publicUrl: getPublicUrl(`${instanceURL}/app#/{spaceId}/tasks/{taskId}`, {
34
+ spaceId: interruption.SpaceId,
35
+ taskId: interruption.TaskId,
36
+ }),
37
+ publicUrlInstruction: "View and respond to this interruption in the Octopus Deploy web portal at the provided publicUrl. " +
38
+ "For full form details (Markdown instructions, button options, control types) dereference the resourceUri.",
39
+ };
40
+ }
41
+ const findInterruptionsSchema = z
42
+ .object({
43
+ spaceName: z.string().describe("Space name."),
44
+ interruptionId: z
45
+ .string()
46
+ .optional()
47
+ .describe("Fetch the slim summary for a single interruption by ID (e.g. Interruptions-1). " +
48
+ "Mutually exclusive with regarding/assignedToMe/pendingOnly. " +
49
+ "For the full body (form definition, instructions, button options, submitted values) dereference the returned resourceUri."),
50
+ pendingOnly: z
51
+ .boolean()
52
+ .optional()
53
+ .default(true)
54
+ .describe("Return only unprocessed (pending) interruptions. Defaults to true. Ignored when interruptionId is set."),
55
+ assignedToMe: z
56
+ .boolean()
57
+ .optional()
58
+ .describe("Limit to interruptions the authenticated user can act on (CanTakeResponsibility or HasResponsibility, " +
59
+ "or where the user is the explicit ResponsibleUserId). When true, /users/me is resolved (cached per session). " +
60
+ "Octopus has no responsibleUserId query parameter, so the tool pages through the server result set and " +
61
+ "post-filters; pages are scanned up to a safety cap (filteredAs.scanComplete signals whether the entire " +
62
+ "result set was inspected). totalResults reflects the post-filter count; the unfiltered server total is " +
63
+ "exposed under filteredAs. Ignored when interruptionId is set."),
64
+ regarding: z
65
+ .string()
66
+ .optional()
67
+ .describe("Native server-side filter to interruptions related to a specific entity ID " +
68
+ "(e.g. ServerTasks-1234, Deployments-5678). Ignored when interruptionId is set."),
69
+ skip: z.number().optional().describe("Pagination offset. Ignored when interruptionId is set."),
70
+ take: z.number().optional().describe("Pagination page size. Ignored when interruptionId is set."),
71
+ })
72
+ .superRefine((args, ctx) => {
73
+ if (!args.interruptionId)
74
+ return;
75
+ const conflicting = [
76
+ "regarding",
77
+ "assignedToMe",
78
+ "skip",
79
+ "take",
80
+ ];
81
+ for (const key of conflicting) {
82
+ if (args[key] !== undefined) {
83
+ ctx.addIssue({
84
+ code: z.ZodIssueCode.custom,
85
+ message: "Provide either interruptionId (to fetch a single interruption) or list filters " +
86
+ `(${conflicting.join(", ")}), not both.`,
87
+ path: [key],
88
+ });
89
+ }
90
+ }
91
+ });
92
+ export async function findInterruptionsHandler(params) {
93
+ const { spaceName, interruptionId, pendingOnly = true, assignedToMe, regarding, skip, take, } = params;
94
+ // Cheap pre-check: validate the ID format before any network round-trip,
95
+ // so callers get a clear error without paying for the space resolve first.
96
+ if (interruptionId) {
97
+ validateEntityId(interruptionId, "interruption", ENTITY_PREFIXES.interruption);
98
+ }
99
+ const configuration = getClientConfigurationFromEnvironment();
100
+ const client = await Client.create(configuration);
101
+ let spaceId;
102
+ try {
103
+ spaceId = await resolveSpaceId(client, spaceName);
104
+ }
105
+ catch (error) {
106
+ handleOctopusApiError(error, { spaceName });
107
+ }
108
+ // Single-id lookup mode.
109
+ if (interruptionId) {
110
+ try {
111
+ const interruption = await client.get("~/api/{spaceId}/interruptions/{interruptionId}", { spaceId, interruptionId });
112
+ return {
113
+ content: [
114
+ {
115
+ type: "text",
116
+ text: JSON.stringify(interruptionSummary(interruption, spaceName, configuration.instanceURL)),
117
+ },
118
+ ],
119
+ };
120
+ }
121
+ catch (error) {
122
+ handleOctopusApiError(error, {
123
+ entityType: "interruption",
124
+ entityId: interruptionId,
125
+ spaceName,
126
+ helpText: "Call find_interruptions without interruptionId to list valid IDs.",
127
+ });
128
+ }
129
+ }
130
+ // assignedToMe: scan multiple server pages and post-filter, since Octopus
131
+ // has no native "responsibleUserId" query param. Without paging, a first
132
+ // server page that contains zero matches would cause us to return an empty
133
+ // result and silently miss actionable interruptions on later pages.
134
+ if (assignedToMe) {
135
+ const user = await getCurrentUserCached(client);
136
+ const currentUserId = user.Id;
137
+ const scan = await scanAssignedInterruptions(client, spaceId, {
138
+ pendingOnly,
139
+ regarding,
140
+ currentUserId,
141
+ });
142
+ const start = skip ?? 0;
143
+ const end = take !== undefined
144
+ ? Math.min(start + take, scan.matched.length)
145
+ : scan.matched.length;
146
+ const sliced = scan.matched.slice(start, end);
147
+ return {
148
+ content: [
149
+ {
150
+ type: "text",
151
+ text: JSON.stringify({
152
+ // Post-filter counts: the LLM's "totalResults" is the number of
153
+ // interruptions actually assigned to the user, not the unfiltered
154
+ // server total. The latter is surfaced under filteredAs for
155
+ // transparency.
156
+ totalResults: scan.matched.length,
157
+ itemsPerPage: sliced.length,
158
+ numberOfPages: 1,
159
+ lastPageNumber: 0,
160
+ filteredAs: {
161
+ userId: currentUserId,
162
+ serverTotalScanned: scan.serverScanned,
163
+ serverTotalAvailable: scan.serverTotal,
164
+ scanComplete: scan.scanComplete,
165
+ ...(scan.scanComplete
166
+ ? {}
167
+ : {
168
+ scanIncompleteHint: "Hit the safety cap before exhausting the server result set. " +
169
+ "Narrow the query (e.g. set regarding to a specific task, or keep pendingOnly: true) " +
170
+ "to ensure complete results.",
171
+ }),
172
+ },
173
+ items: sliced.map((interruption) => interruptionSummary(interruption, spaceName, configuration.instanceURL)),
174
+ }),
175
+ },
176
+ ],
177
+ };
178
+ }
179
+ // List mode (no per-user filter): pass server pagination through directly.
180
+ const response = await client.get("~/api/{spaceId}/interruptions{?skip,take,pendingOnly,regarding}", {
181
+ spaceId,
182
+ skip,
183
+ take,
184
+ pendingOnly,
185
+ regarding,
186
+ });
187
+ return {
188
+ content: [
189
+ {
190
+ type: "text",
191
+ text: JSON.stringify({
192
+ totalResults: response.TotalResults,
193
+ itemsPerPage: response.ItemsPerPage,
194
+ numberOfPages: response.NumberOfPages,
195
+ lastPageNumber: response.LastPageNumber,
196
+ items: (response.Items ?? []).map((interruption) => interruptionSummary(interruption, spaceName, configuration.instanceURL)),
197
+ }),
198
+ },
199
+ ],
200
+ };
201
+ }
202
+ /**
203
+ * Page through the unfiltered /interruptions result set, collecting items
204
+ * the authenticated user can act on. Octopus has no responsibleUserId query
205
+ * parameter, so post-filtering is the only correctness-preserving option.
206
+ *
207
+ * Safety cap: ASSIGNED_SCAN_MAX records inspected. Almost always hit only
208
+ * with pendingOnly: false on busy spaces with deep history; the assigned
209
+ * set under pendingOnly: true is virtually always small.
210
+ */
211
+ export const ASSIGNED_SCAN_PAGE_SIZE = 100;
212
+ export const ASSIGNED_SCAN_MAX = 500;
213
+ async function scanAssignedInterruptions(client, spaceId, params) {
214
+ const matched = [];
215
+ let serverScanned = 0;
216
+ let serverTotal = 0;
217
+ let scanComplete = false;
218
+ while (serverScanned < ASSIGNED_SCAN_MAX) {
219
+ const remaining = ASSIGNED_SCAN_MAX - serverScanned;
220
+ const pageTake = Math.min(ASSIGNED_SCAN_PAGE_SIZE, remaining);
221
+ const page = await client.get("~/api/{spaceId}/interruptions{?skip,take,pendingOnly,regarding}", {
222
+ spaceId,
223
+ skip: serverScanned,
224
+ take: pageTake,
225
+ pendingOnly: params.pendingOnly,
226
+ regarding: params.regarding,
227
+ });
228
+ serverTotal = page.TotalResults;
229
+ const items = page.Items ?? [];
230
+ for (const interruption of items) {
231
+ if (interruption.CanTakeResponsibility ||
232
+ interruption.HasResponsibility ||
233
+ interruption.ResponsibleUserId === params.currentUserId) {
234
+ matched.push(interruption);
235
+ }
236
+ }
237
+ serverScanned += items.length;
238
+ // Empty page (or short page) means the server has no more.
239
+ if (items.length === 0 || items.length < pageTake || serverScanned >= serverTotal) {
240
+ scanComplete = true;
241
+ break;
242
+ }
243
+ }
244
+ return { matched, serverTotal, serverScanned, scanComplete };
245
+ }
246
+ export function registerFindInterruptionsTool(server) {
247
+ server.registerTool("find_interruptions", {
248
+ title: "Find interruptions",
249
+ description: `Find interruptions (manual interventions, guided failures, deployment approvals) in an Octopus Deploy space.
250
+
251
+ Interruptions are the Octopus surface equivalent to pending approvals: a deployment or runbook run pauses and waits for a human to take action. Use this tool to enumerate them or to look up a single one.
252
+
253
+ Modes (picked by which arguments you supply):
254
+ - interruptionId → fetch the slim summary for that interruption.
255
+ - assignedToMe → list interruptions the authenticated user can act on; resolves /users/me (cached per session).
256
+ - regarding → list interruptions related to a specific entity (ServerTasks-…, Deployments-…). Native server-side filter.
257
+ - (none) → list all interruptions, optionally filtered by pendingOnly (default: true) and skip/take.
258
+
259
+ Each summary includes:
260
+ - resourceUri → octopus://spaces/{spaceName}/interruptions/{id} for the FULL body (form definition with Markdown instructions, button options, control types, and any already-submitted values). Dereference this when the user asks for details about a specific interruption.
261
+ - taskResourceUri → octopus://spaces/{spaceName}/tasks/{taskId} for the surrounding deployment/runbook task.
262
+ - publicUrl → Octopus portal deep link to take action.
263
+ - formElementNames → just the field names (e.g. Instructions, Notes, Result). Field values are NOT in the slim summary; fetch resourceUri for those.`,
264
+ inputSchema: findInterruptionsSchema,
265
+ annotations: { readOnlyHint: true },
266
+ }, findInterruptionsHandler);
267
+ }
268
+ registerToolDefinition({
269
+ toolName: "find_interruptions",
270
+ config: { toolset: "interruptions", readOnly: true },
271
+ registerFn: registerFindInterruptionsTool,
272
+ });
273
+ //# sourceMappingURL=findInterruptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findInterruptions.js","sourceRoot":"","sources":["../../src/tools/findInterruptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,cAAc,GAEf,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,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EACL,gBAAgB,EAChB,qBA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AM;QACR,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,MAAiB;IAC7D,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;QACE,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE;;;;;;;;;;;;;;qJAckI;QAC/I,WAAW,EAAE,uBAAuB;QACpC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;KACpC,EACD,wBAAwB,CACzB,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC;IACrB,QAAQ,EAAE,oBAAoB;IAC9B,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE;IACpD,UAAU,EAAE,6BAA6B;CAC1C,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"findReleases.d.ts","sourceRoot":"","sources":["../../src/tools/findReleases.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,QA6FzD"}
1
+ {"version":3,"file":"findReleases.d.ts","sourceRoot":"","sources":["../../src/tools/findReleases.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkFzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,QAsEzD"}