@octopusdeploy/mcp-server 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/README.md +56 -20
  2. package/dist/helpers/errorHandling.d.ts +35 -0
  3. package/dist/helpers/errorHandling.d.ts.map +1 -0
  4. package/dist/helpers/errorHandling.js +72 -0
  5. package/dist/helpers/errorHandling.js.map +1 -0
  6. package/dist/helpers/getClientConfigurationFromEnvironment.js +1 -1
  7. package/dist/helpers/getClientConfigurationFromEnvironment.js.map +1 -1
  8. package/dist/helpers/spaceResolver.d.ts +4 -0
  9. package/dist/helpers/spaceResolver.d.ts.map +1 -0
  10. package/dist/helpers/spaceResolver.js +18 -0
  11. package/dist/helpers/spaceResolver.js.map +1 -0
  12. package/dist/helpers/urlParser.d.ts +16 -0
  13. package/dist/helpers/urlParser.d.ts.map +1 -0
  14. package/dist/helpers/urlParser.js +83 -0
  15. package/dist/helpers/urlParser.js.map +1 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +7 -7
  18. package/dist/index.js.map +1 -1
  19. package/dist/tools/createRelease.d.ts +3 -0
  20. package/dist/tools/createRelease.d.ts.map +1 -0
  21. package/dist/tools/createRelease.js +108 -0
  22. package/dist/tools/createRelease.js.map +1 -0
  23. package/dist/tools/deployRelease.d.ts +3 -0
  24. package/dist/tools/deployRelease.d.ts.map +1 -0
  25. package/dist/tools/deployRelease.js +207 -0
  26. package/dist/tools/deployRelease.js.map +1 -0
  27. package/dist/tools/findAccounts.d.ts +3 -0
  28. package/dist/tools/findAccounts.d.ts.map +1 -0
  29. package/dist/tools/findAccounts.js +87 -0
  30. package/dist/tools/findAccounts.js.map +1 -0
  31. package/dist/tools/findCertificates.d.ts +3 -0
  32. package/dist/tools/findCertificates.d.ts.map +1 -0
  33. package/dist/tools/findCertificates.js +95 -0
  34. package/dist/tools/findCertificates.js.map +1 -0
  35. package/dist/tools/findDeploymentTargets.d.ts +3 -0
  36. package/dist/tools/findDeploymentTargets.d.ts.map +1 -0
  37. package/dist/tools/findDeploymentTargets.js +158 -0
  38. package/dist/tools/findDeploymentTargets.js.map +1 -0
  39. package/dist/tools/findReleases.d.ts +3 -0
  40. package/dist/tools/findReleases.d.ts.map +1 -0
  41. package/dist/tools/findReleases.js +96 -0
  42. package/dist/tools/findReleases.js.map +1 -0
  43. package/dist/tools/findTenants.d.ts +19 -0
  44. package/dist/tools/findTenants.d.ts.map +1 -0
  45. package/dist/tools/findTenants.js +130 -0
  46. package/dist/tools/findTenants.js.map +1 -0
  47. package/dist/tools/getBranches.d.ts.map +1 -1
  48. package/dist/tools/getBranches.js +38 -23
  49. package/dist/tools/getBranches.js.map +1 -1
  50. package/dist/tools/getCurrentUser.d.ts.map +1 -1
  51. package/dist/tools/getCurrentUser.js +27 -21
  52. package/dist/tools/getCurrentUser.js.map +1 -1
  53. package/dist/tools/getDeploymentFromUrl.d.ts +52 -0
  54. package/dist/tools/getDeploymentFromUrl.d.ts.map +1 -0
  55. package/dist/tools/getDeploymentFromUrl.js +134 -0
  56. package/dist/tools/getDeploymentFromUrl.js.map +1 -0
  57. package/dist/tools/getDeploymentProcess.d.ts.map +1 -1
  58. package/dist/tools/getDeploymentProcess.js +48 -13
  59. package/dist/tools/getDeploymentProcess.js.map +1 -1
  60. package/dist/tools/getKubernetesLiveStatus.d.ts.map +1 -1
  61. package/dist/tools/getKubernetesLiveStatus.js +57 -38
  62. package/dist/tools/getKubernetesLiveStatus.js.map +1 -1
  63. package/dist/tools/getMissingTenantVariables.d.ts.map +1 -1
  64. package/dist/tools/getMissingTenantVariables.js +45 -16
  65. package/dist/tools/getMissingTenantVariables.js.map +1 -1
  66. package/dist/tools/getTaskById.d.ts.map +1 -1
  67. package/dist/tools/getTaskById.js +24 -17
  68. package/dist/tools/getTaskById.js.map +1 -1
  69. package/dist/tools/getTaskDetails.d.ts +2 -2
  70. package/dist/tools/getTaskDetails.d.ts.map +1 -1
  71. package/dist/tools/getTaskDetails.js +48 -27
  72. package/dist/tools/getTaskDetails.js.map +1 -1
  73. package/dist/tools/getTaskFromUrl.d.ts +19 -0
  74. package/dist/tools/getTaskFromUrl.d.ts.map +1 -0
  75. package/dist/tools/getTaskFromUrl.js +90 -0
  76. package/dist/tools/getTaskFromUrl.js.map +1 -0
  77. package/dist/tools/getTaskRaw.d.ts.map +1 -1
  78. package/dist/tools/getTaskRaw.js +24 -17
  79. package/dist/tools/getTaskRaw.js.map +1 -1
  80. package/dist/tools/getTenantVariables.d.ts.map +1 -1
  81. package/dist/tools/getTenantVariables.js +45 -28
  82. package/dist/tools/getTenantVariables.js.map +1 -1
  83. package/dist/tools/index.d.ts +13 -14
  84. package/dist/tools/index.d.ts.map +1 -1
  85. package/dist/tools/index.js +19 -17
  86. package/dist/tools/index.js.map +1 -1
  87. package/dist/tools/listDeployments.d.ts.map +1 -1
  88. package/dist/tools/listDeployments.js +55 -24
  89. package/dist/tools/listDeployments.js.map +1 -1
  90. package/dist/tools/listEnvironments.d.ts.map +1 -1
  91. package/dist/tools/listEnvironments.js +53 -30
  92. package/dist/tools/listEnvironments.js.map +1 -1
  93. package/dist/tools/listProjects.d.ts.map +1 -1
  94. package/dist/tools/listProjects.js +55 -32
  95. package/dist/tools/listProjects.js.map +1 -1
  96. package/dist/tools/listSpaces.d.ts.map +1 -1
  97. package/dist/tools/listSpaces.js +48 -25
  98. package/dist/tools/listSpaces.js.map +1 -1
  99. package/dist/utils/version.d.ts +2 -0
  100. package/dist/utils/version.d.ts.map +1 -0
  101. package/dist/utils/version.js +3 -0
  102. package/dist/utils/version.js.map +1 -0
  103. package/package.json +9 -3
  104. package/dist/tools/getAccount.d.ts +0 -3
  105. package/dist/tools/getAccount.d.ts.map +0 -1
  106. package/dist/tools/getAccount.js +0 -40
  107. package/dist/tools/getAccount.js.map +0 -1
  108. package/dist/tools/getCertificate.d.ts +0 -3
  109. package/dist/tools/getCertificate.d.ts.map +0 -1
  110. package/dist/tools/getCertificate.js +0 -40
  111. package/dist/tools/getCertificate.js.map +0 -1
  112. package/dist/tools/getDeploymentTarget.d.ts +0 -3
  113. package/dist/tools/getDeploymentTarget.d.ts.map +0 -1
  114. package/dist/tools/getDeploymentTarget.js +0 -66
  115. package/dist/tools/getDeploymentTarget.js.map +0 -1
  116. package/dist/tools/getReleaseById.d.ts +0 -3
  117. package/dist/tools/getReleaseById.d.ts.map +0 -1
  118. package/dist/tools/getReleaseById.js +0 -45
  119. package/dist/tools/getReleaseById.js.map +0 -1
  120. package/dist/tools/getTenantById.d.ts +0 -3
  121. package/dist/tools/getTenantById.d.ts.map +0 -1
  122. package/dist/tools/getTenantById.js +0 -50
  123. package/dist/tools/getTenantById.js.map +0 -1
  124. package/dist/tools/listAccounts.d.ts +0 -3
  125. package/dist/tools/listAccounts.d.ts.map +0 -1
  126. package/dist/tools/listAccounts.js +0 -54
  127. package/dist/tools/listAccounts.js.map +0 -1
  128. package/dist/tools/listCertificates.d.ts +0 -3
  129. package/dist/tools/listCertificates.d.ts.map +0 -1
  130. package/dist/tools/listCertificates.js +0 -62
  131. package/dist/tools/listCertificates.js.map +0 -1
  132. package/dist/tools/listDeploymentTargets.d.ts +0 -3
  133. package/dist/tools/listDeploymentTargets.d.ts.map +0 -1
  134. package/dist/tools/listDeploymentTargets.js +0 -98
  135. package/dist/tools/listDeploymentTargets.js.map +0 -1
  136. package/dist/tools/listReleases.d.ts +0 -3
  137. package/dist/tools/listReleases.d.ts.map +0 -1
  138. package/dist/tools/listReleases.js +0 -54
  139. package/dist/tools/listReleases.js.map +0 -1
  140. package/dist/tools/listTenants.d.ts +0 -3
  141. package/dist/tools/listTenants.d.ts.map +0 -1
  142. package/dist/tools/listTenants.js +0 -69
  143. package/dist/tools/listTenants.js.map +0 -1
package/README.md CHANGED
@@ -70,6 +70,8 @@ We are planning to release a native ARM build shortly so that those arguments wi
70
70
  #### Configuration
71
71
 
72
72
  Full example configuration (for Claude Desktop, Claude Code, and Cursor):
73
+
74
+ **Read-only mode (default, recommended for production):**
73
75
  ```json
74
76
  {
75
77
  "mcpServers": {
@@ -82,6 +84,19 @@ Full example configuration (for Claude Desktop, Claude Code, and Cursor):
82
84
  }
83
85
  ```
84
86
 
87
+ **Write mode enabled (for development/testing):**
88
+ ```json
89
+ {
90
+ "mcpServers": {
91
+ "octopusdeploy": {
92
+ "type": "stdio",
93
+ "command": "npx",
94
+ "args": ["-y", "@octopusdeploy/mcp-server", "--api-key", "YOUR_API_KEY", "--server-url", "https://your-octopus.com", "--no-read-only"]
95
+ }
96
+ }
97
+ }
98
+ ```
99
+
85
100
  The Octopus MCP Server is typically configured within your AI Client of choice.
86
101
 
87
102
  It is packaged as an npm package and executed via Node's `npx` command. Your configuration will include the command invocation `npx`, and a set of arguments that supply the Octopus MCP Server package and provide the Octopus Server URL and API key required, if they are not available as environment variables.
@@ -136,24 +151,35 @@ Available toolsets:
136
151
  - **accounts** - Account operations
137
152
 
138
153
  #### Read-Only Mode
139
- The server runs in read-only mode by default for security. All current tools are read-only operations.
154
+ The server runs in read-only mode by default for security. Most tools are read-only operations, but some tools can perform write operations (like creating releases and deployments).
155
+
156
+ **Write-enabled tools:**
157
+ - `create_release` - Create new releases
158
+ - `deploy_release` - Deploy releases to environments and tenants
159
+
160
+ To use write-enabled tools, you must explicitly disable read-only mode:
140
161
 
141
162
  ```bash
142
- # Run in read-only mode (default)
143
- npx -y @octopusdeploy/mcp-server --read-only
163
+ # Run in read-only mode (default) - write tools are disabled
164
+ npx -y @octopusdeploy/mcp-server
144
165
 
145
- # Disable read-only mode (currently no effect as all tools are read-only)
146
- npx -y @octopusdeploy/mcp-server --read-only=false
166
+ # Disable read-only mode to enable write operations
167
+ npx -y @octopusdeploy/mcp-server --no-read-only
147
168
  ```
148
169
 
170
+ **Security Note:** When disabling read-only mode, ensure you use an API key with appropriate, least-privilege permissions. Write operations can create releases and trigger deployments in your Octopus instance.
171
+
149
172
  #### Complete Examples
150
173
 
151
174
  ```bash
152
175
  # Development setup with only core and project tools
153
176
  npx -y @octopusdeploy/mcp-server --toolsets core,projects --server-url https://your-octopus.com --api-key YOUR_API_KEY
154
177
 
155
- # Full production setup with all tools
156
- npx -y @octopusdeploy/mcp-server --toolsets all --read-only --server-url https://your-octopus.com --api-key YOUR_API_KEY
178
+ # Full production setup with all tools (read-only by default)
179
+ npx -y @octopusdeploy/mcp-server --toolsets all --server-url https://your-octopus.com --api-key YOUR_API_KEY
180
+
181
+ # Development setup with write operations enabled
182
+ npx -y @octopusdeploy/mcp-server --no-read-only --server-url https://your-octopus.com --api-key YOUR_API_KEY
157
183
  ```
158
184
 
159
185
  #### Other command line arguments
@@ -173,11 +199,12 @@ npx -y @octopusdeploy/mcp-server --toolsets all --read-only --server-url https:/
173
199
  - `list_projects`: List all projects in a given space
174
200
 
175
201
  ### Deployments
202
+ - `deploy_release`: Deploy a release to environments (supports both tenanted and untenanted deployments)
176
203
  - `list_deployments`: List deployments in a space with optional filtering
177
204
 
178
205
  ### Releases
179
- - `get_release_by_id`: Get details for a specific release by its ID
180
- - `list_releases`: List all releases in a given space
206
+ - `create_release`: Create a new release for a project
207
+ - `find_releases`: Find releases in a space (can get a specific release by ID or list all releases)
181
208
  - `list_releases_for_project`: List all releases for a specific project
182
209
 
183
210
  ### Tasks
@@ -186,8 +213,7 @@ npx -y @octopusdeploy/mcp-server --toolsets all --read-only --server-url https:/
186
213
  - `get_task_raw`: Get raw details for a specific server task
187
214
 
188
215
  ### Tenants
189
- - `list_tenants`: List all tenants in a given space
190
- - `get_tenant_by_id`: Get details for a specific tenant by its ID
216
+ - `find_tenants`: Find tenants in a space (can get a specific tenant by ID or list/search tenants with filters)
191
217
  - `get_tenant_variables`: Get tenant variables by type (all, common, or project)
192
218
  - `get_missing_tenant_variables`: Get tenant variables that are missing values
193
219
 
@@ -195,16 +221,13 @@ npx -y @octopusdeploy/mcp-server --toolsets all --read-only --server-url https:/
195
221
  - `get_kubernetes_live_status`: Get live status of Kubernetes resources for a project and environment (minimum supported version: `2025.3`)
196
222
 
197
223
  ### Machines (Deployment Targets)
198
- - `list_deployment_targets`: List all deployment targets in a space with optional filtering
199
- - `get_deployment_target`: Get detailed information about a specific deployment target
224
+ - `find_deployment_targets`: Find deployment targets in a space (can get a specific target by ID or list/search targets with filters)
200
225
 
201
226
  ### Certificates
202
- - `list_certificates`: List all certificates in a space with optional filtering
203
- - `get_certificate`: Get detailed information about a specific certificate by its ID
227
+ - `find_certificates`: Find certificates in a space (can get a specific certificate by ID or list/search certificates with filters)
204
228
 
205
229
  ### Accounts
206
- - `list_accounts`: List all accounts in a space with optional filtering
207
- - `get_accounts`: Get detailed information about a specific account by its ID
230
+ - `find_accounts`: Find accounts in a space (can get a specific account by ID or list/search accounts with filters)
208
231
 
209
232
  ### Additional Tools
210
233
  - `get_deployment_process`: Get deployment process by ID for projects or releases
@@ -213,11 +236,24 @@ npx -y @octopusdeploy/mcp-server --toolsets all --read-only --server-url https:/
213
236
 
214
237
  ## 🔒 Security Considerations
215
238
 
216
- While the Octopus MCP Server at this stage is a read-only tool, it **can read full deployment logs, which could include production secrets.** Exercise caution when connecting Octopus MCP to tools and models you do not fully trust.
239
+ The Octopus MCP Server includes both read and write operations. Important security considerations:
240
+
241
+ ### Read Operations
242
+ - Can read full deployment logs, which could include production secrets if they were not marked as secrets
243
+ - Access to sensitive configuration data and variables
244
+ - Exercise caution when connecting to tools and models you do not fully trust
245
+
246
+ ### Write Operations
247
+ When read-only mode is disabled (`--no-read-only`), the following write operations are available:
248
+ - **Creating releases**: Can create new releases for projects
249
+ - **Deploying releases**: Can trigger deployments to environments (including production)
217
250
 
218
- Running agents in a fully automated fashion could make you vulnerable to exposure via prompt-injection attacks that exfiltrate tokens.
251
+ **Critical Security Measures:**
252
+ 1. **Least Privilege**: Use API keys with the minimum permissions needed for your use case
253
+ 2. **Read-Only by Default**: The server defaults to read-only mode - you must explicitly opt-in to write operations
254
+ 3. **Prompt Injection Risk**: Running agents in fully automated fashion could make you vulnerable to prompt-injection attacks
219
255
 
220
- Exercise caution and mitigate the risks by using least-privileged accounts when connecting to Octopus Server.
256
+ **Recommendation**: For production environments, use read-only mode unless you have a specific, controlled use case for write operations.
221
257
 
222
258
  ## ⚠️ Limitations
223
259
 
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Enhanced error handling utilities for Octopus Deploy MCP Server tools
3
+ */
4
+ /**
5
+ * Checks if the error is an Error instance and has a message containing the specified text
6
+ */
7
+ export declare function isErrorWithMessage(error: unknown, messageFragment: string): error is Error;
8
+ /**
9
+ * Common error handler for Octopus Deploy API errors with actionable messages
10
+ */
11
+ export declare function handleOctopusApiError(error: unknown, context: {
12
+ entityType?: string;
13
+ entityId?: string;
14
+ spaceName?: string;
15
+ helpText?: string;
16
+ }): never;
17
+ /**
18
+ * Validates entity ID format with actionable error messages
19
+ */
20
+ export declare function validateEntityId(id: string | undefined, entityType: string, prefix: string): void;
21
+ /**
22
+ * Entity ID prefixes for common Octopus Deploy entities
23
+ */
24
+ export declare const ENTITY_PREFIXES: {
25
+ readonly task: "ServerTasks-";
26
+ readonly project: "Projects-";
27
+ readonly environment: "Environments-";
28
+ readonly tenant: "Tenants-";
29
+ readonly release: "Releases-";
30
+ readonly machine: "Machines-";
31
+ readonly certificate: "Certificates-";
32
+ readonly account: "Accounts-";
33
+ readonly deploymentProcess: "DeploymentProcesses-";
34
+ };
35
+ //# sourceMappingURL=errorHandling.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorHandling.d.ts","sourceRoot":"","sources":["../../src/helpers/errorHandling.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,MAAM,GACtB,KAAK,IAAI,KAAK,CAIhB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE;IACP,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GACA,KAAK,CAmDP;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,IAAI,CAeN;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;CAUlB,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Enhanced error handling utilities for Octopus Deploy MCP Server tools
3
+ */
4
+ /**
5
+ * Checks if the error is an Error instance and has a message containing the specified text
6
+ */
7
+ export function isErrorWithMessage(error, messageFragment) {
8
+ return (error instanceof Error && error.message?.includes(messageFragment) === true);
9
+ }
10
+ /**
11
+ * Common error handler for Octopus Deploy API errors with actionable messages
12
+ */
13
+ export function handleOctopusApiError(error, context) {
14
+ const { entityType, entityId, spaceName, helpText } = context;
15
+ // Handle 404/not found errors
16
+ if (isErrorWithMessage(error, "not found") ||
17
+ isErrorWithMessage(error, "404")) {
18
+ if (entityType && entityId && spaceName) {
19
+ throw new Error(`${entityType.charAt(0).toUpperCase() + entityType.slice(1)} '${entityId}' not found in space '${spaceName}'. ` +
20
+ (helpText ||
21
+ `Verify the ${entityType} ID is correct using list_${entityType}s.`));
22
+ }
23
+ if (spaceName) {
24
+ throw new Error(`Space '${spaceName}' not found. Use list_spaces to see available spaces. Space names are case-sensitive.`);
25
+ }
26
+ }
27
+ // Handle authentication errors
28
+ if (isErrorWithMessage(error, "authentication") ||
29
+ isErrorWithMessage(error, "401") ||
30
+ isErrorWithMessage(error, "You must be logged in to request this resource") ||
31
+ isErrorWithMessage(error, "provide a valid API key")) {
32
+ throw new Error("Authentication failed. Ensure OCTOPUS_API_KEY environment variable is set with a valid API key. " +
33
+ "You can generate an API key from your Octopus Deploy user profile.");
34
+ }
35
+ // Handle connection errors
36
+ if (isErrorWithMessage(error, "connect") ||
37
+ isErrorWithMessage(error, "timeout")) {
38
+ throw new Error("Cannot connect to Octopus Deploy instance. Check that OCTOPUS_SERVER_URL environment variable is set correctly " +
39
+ "(e.g., 'https://your-instance.octopus.app') and that the instance is accessible.");
40
+ }
41
+ // Re-throw the original error if no specific handling applies
42
+ throw error;
43
+ }
44
+ /**
45
+ * Validates entity ID format with actionable error messages
46
+ */
47
+ export function validateEntityId(id, entityType, prefix) {
48
+ if (!id) {
49
+ // This shouldn't happen due to Zod validation, but kept for safety
50
+ throw new Error(`${entityType.charAt(0).toUpperCase() + entityType.slice(1)} ID is required. ` +
51
+ `Use list_${entityType}s to find ${entityType} IDs.`);
52
+ }
53
+ if (!id.startsWith(prefix)) {
54
+ throw new Error(`Invalid ${entityType} ID format '${id}'. ${entityType.charAt(0).toUpperCase() + entityType.slice(1)} IDs should start with '${prefix}' followed by numbers. ` +
55
+ `Use list_${entityType}s to find valid ${entityType} IDs.`);
56
+ }
57
+ }
58
+ /**
59
+ * Entity ID prefixes for common Octopus Deploy entities
60
+ */
61
+ export const ENTITY_PREFIXES = {
62
+ task: "ServerTasks-",
63
+ project: "Projects-",
64
+ environment: "Environments-",
65
+ tenant: "Tenants-",
66
+ release: "Releases-",
67
+ machine: "Machines-",
68
+ certificate: "Certificates-",
69
+ account: "Accounts-",
70
+ deploymentProcess: "DeploymentProcesses-",
71
+ };
72
+ //# sourceMappingURL=errorHandling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorHandling.js","sourceRoot":"","sources":["../../src/helpers/errorHandling.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAc,EACd,eAAuB;IAEvB,OAAO,CACL,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,eAAe,CAAC,KAAK,IAAI,CAC5E,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAc,EACd,O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kB,EAClB,MAAc;IAEd,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,mEAAmE;QACnE,MAAM,IAAI,KAAK,CACb,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,mBAAmB;YAC5E,YAAY,UAAU,aAAa,UAAU,OAAO,CACvD,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,WAAW,UAAU,eAAe,EAAE,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,2BAA2B,MAAM,yBAAyB;YAC5J,YAAY,UAAU,mBAAmB,UAAU,OAAO,CAC7D,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,WAAW;IACpB,WAAW,EAAE,eAAe;IAC5B,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;IACpB,WAAW,EAAE,eAAe;IAC5B,OAAO,EAAE,WAAW;IACpB,iBAAiB,EAAE,sBAAsB;CACjC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import {} from "@octopusdeploy/api-client";
2
2
  import { env } from "process";
3
- import { SEMVER_VERSION } from "../index.js";
3
+ import { SEMVER_VERSION } from "../utils/version.js";
4
4
  import { getClientInfo } from "../utils/clientInfo.js";
5
5
  const USER_AGENT_NAME = "octopus-mcp-server";
6
6
  function isEmpty(value) {
@@ -1 +1 @@
1
- {"version":3,"file":"getClientConfigurationFromEnvironment.js","sourceRoot":"","sources":["../../src/helpers/getClientConfigurationFromEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,MAAM,2B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import { Client } from "@octopusdeploy/api-client";
2
+ export declare function resolveSpaceNameFromId(client: Client, spaceId: string): Promise<string>;
3
+ export declare function clearSpaceCache(): void;
4
+ //# sourceMappingURL=spaceResolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spaceResolver.d.ts","sourceRoot":"","sources":["../../src/helpers/spaceResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAmB,MAAM,2BAA2B,CAAC;AAKpE,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
@@ -0,0 +1,18 @@
1
+ import { Client, SpaceRepository } from "@octopusdeploy/api-client";
2
+ const spaceCache = new Map();
3
+ const CACHE_TTL = 3600000; // 1 hour in milliseconds
4
+ export async function resolveSpaceNameFromId(client, spaceId) {
5
+ const cached = spaceCache.get(spaceId);
6
+ const now = Date.now();
7
+ if (cached && now - cached.timestamp < CACHE_TTL) {
8
+ return cached.name;
9
+ }
10
+ const spaceRepository = new SpaceRepository(client);
11
+ const space = await spaceRepository.get(spaceId);
12
+ spaceCache.set(spaceId, { name: space.Name, timestamp: now });
13
+ return space.Name;
14
+ }
15
+ export function clearSpaceCache() {
16
+ spaceCache.clear();
17
+ }
18
+ //# sourceMappingURL=spaceResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spaceResolver.js","sourceRoot":"","sources":["../../src/helpers/spaceResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,UAAU,GAAG,IAAI,GAAG,EAA+C,CAAC;AAC1E,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,yBAAyB;AAEpD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAAc,EACd,OAAe;IAEf,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEvB,IAAI,MAAM,IAAI,GAAG,GAAG,MAAM,CAAC,SAAS,GAAG,SAAS,EAAE,CAAC;QACjD,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEjD,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;IAE9D,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,UAAU,CAAC,KAAK,EAAE,CAAC;AACrB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface OctopusUrlParts {
2
+ serverUrl: string;
3
+ spaceId?: string;
4
+ resourceType?: "deployment" | "release" | "project" | "tenant" | "task" | "unknown";
5
+ resourceId?: string;
6
+ projectSlug?: string;
7
+ releaseVersion?: string;
8
+ }
9
+ export declare function parseOctopusUrl(url: string): OctopusUrlParts;
10
+ export declare function extractDeploymentId(url: string): string | null;
11
+ export declare function extractTaskId(url: string): string | null;
12
+ export declare function extractSpaceId(url: string): string | null;
13
+ export declare function extractProjectSlug(url: string): string | null;
14
+ export declare function extractReleaseVersion(url: string): string | null;
15
+ export declare function extractTenantId(url: string): string | null;
16
+ //# sourceMappingURL=urlParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlParser.d.ts","sourceRoot":"","sources":["../../src/helpers/urlParser.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;IACpF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAwD5D;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG9D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGxD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGzD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG7D;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGhE;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG1D"}
@@ -0,0 +1,83 @@
1
+ export function parseOctopusUrl(url) {
2
+ try {
3
+ const urlObj = new URL(url);
4
+ const serverUrl = `${urlObj.protocol}//${urlObj.host}`;
5
+ const hashPath = urlObj.hash.startsWith("#/") ? urlObj.hash.substring(2) : urlObj.hash.substring(1);
6
+ const pathParts = hashPath.split("/").filter(Boolean);
7
+ const result = {
8
+ serverUrl,
9
+ };
10
+ const spaceId = extractSpaceId(url);
11
+ if (spaceId) {
12
+ result.spaceId = spaceId;
13
+ }
14
+ if (pathParts.includes("deployments")) {
15
+ const deploymentId = extractDeploymentId(url);
16
+ if (deploymentId) {
17
+ result.resourceType = "deployment";
18
+ result.resourceId = deploymentId;
19
+ }
20
+ else {
21
+ const releaseVersion = extractReleaseVersion(url);
22
+ if (releaseVersion) {
23
+ result.resourceType = "release";
24
+ result.resourceId = releaseVersion;
25
+ result.releaseVersion = releaseVersion;
26
+ }
27
+ }
28
+ }
29
+ else if (pathParts.includes("tasks")) {
30
+ const taskId = extractTaskId(url);
31
+ if (taskId) {
32
+ result.resourceType = "task";
33
+ result.resourceId = taskId;
34
+ }
35
+ }
36
+ else if (pathParts.includes("projects")) {
37
+ result.resourceType = "project";
38
+ const projectSlug = extractProjectSlug(url);
39
+ if (projectSlug) {
40
+ result.projectSlug = projectSlug;
41
+ }
42
+ }
43
+ else if (pathParts.includes("tenants")) {
44
+ const tenantId = extractTenantId(url);
45
+ if (tenantId) {
46
+ result.resourceType = "tenant";
47
+ result.resourceId = tenantId;
48
+ }
49
+ }
50
+ else {
51
+ result.resourceType = "unknown";
52
+ }
53
+ return result;
54
+ }
55
+ catch (error) {
56
+ throw new Error(`Failed to parse Octopus URL: ${error instanceof Error ? error.message : String(error)}`);
57
+ }
58
+ }
59
+ export function extractDeploymentId(url) {
60
+ const match = url.match(/\/deployments\/(Deployments-\d+)/);
61
+ return match ? match[1] : null;
62
+ }
63
+ export function extractTaskId(url) {
64
+ const match = url.match(/\/tasks\/(ServerTasks-\d+)/);
65
+ return match ? match[1] : null;
66
+ }
67
+ export function extractSpaceId(url) {
68
+ const match = url.match(/\/(Spaces-\d+)/);
69
+ return match ? match[1] : null;
70
+ }
71
+ export function extractProjectSlug(url) {
72
+ const match = url.match(/\/projects\/([^/]+)/);
73
+ return match ? match[1] : null;
74
+ }
75
+ export function extractReleaseVersion(url) {
76
+ const match = url.match(/\/releases\/([^/]+)/);
77
+ return match ? match[1] : null;
78
+ }
79
+ export function extractTenantId(url) {
80
+ const match = url.match(/\/tenants\/(Tenants-\d+)/);
81
+ return match ? match[1] : null;
82
+ }
83
+ //# sourceMappingURL=urlParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlParser.js","sourceRoot":"","sources":["../../src/helpers/urlParser.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,IAA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MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACtD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC1C,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACpD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAgBA,eAAO,MAAM,cAAc,QAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAmBA,eAAO,MAAM,cAAc,QAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -5,13 +5,13 @@ import { registerTools } from "./tools/index.js";
5
5
  import { Command } from "commander";
6
6
  import dotenv from "dotenv";
7
7
  import { createToolsetConfig } from "./utils/parseConfig.js";
8
- import { DEFAULT_TOOLSETS, printToolVersionAnalysis } from "./types/toolConfig.js";
8
+ import { DEFAULT_TOOLSETS, printToolVersionAnalysis, } from "./types/toolConfig.js";
9
9
  import { getClientConfigurationFromEnvironment } from "./helpers/getClientConfigurationFromEnvironment.js";
10
10
  import { setClientInfo } from "./utils/clientInfo.js";
11
11
  import { logger } from "./utils/logger.js";
12
12
  import packageJson from "../package.json" with { type: "json" };
13
13
  import { fileURLToPath } from "url";
14
- import { dirname, join, isAbsolute } from "path";
14
+ import { dirname, join } from "path";
15
15
  export const SEMVER_VERSION = packageJson.version;
16
16
  // Set entry directory for logger (ESM equivalent of __dirname)
17
17
  const __filename = fileURLToPath(import.meta.url);
@@ -26,9 +26,9 @@ program
26
26
  .option("-s, --server-url <url>", "Octopus server URL")
27
27
  .option("-k, --api-key <key>", "Octopus API key")
28
28
  .option("--toolsets <toolsets>", `Comma-separated list of toolsets to enable, or "all" (default: all). Available toolsets: ${DEFAULT_TOOLSETS.join(", ")}`)
29
- .option("--read-only", "Enable read-only mode (default: enabled)", true)
29
+ .option("--no-read-only", "Disable read-only mode to enable write operations (default: read-only enabled)")
30
30
  .option("--log-level <level>", "Minimum log level (info, error)", "info")
31
- .option("--log-file <path>", 'Log file path or filename. If not specified, logs are written to console only.')
31
+ .option("--log-file <path>", "Log file path or filename. If not specified, logs are written to console only.")
32
32
  .option("-q, --quiet", "Disable file logging, only log errors to console", false)
33
33
  .option("--list-tools-by-version", "List all registered tools by their supported Octopus Server version and exit")
34
34
  .parse();
@@ -45,7 +45,7 @@ if (options.listToolsByVersion) {
45
45
  process.exit(0);
46
46
  }
47
47
  if (options.logFile) {
48
- if (dirname(options.logFile) === '.') {
48
+ if (dirname(options.logFile) === ".") {
49
49
  logger.setLogFilePath(join(__dirname, options.logFile));
50
50
  }
51
51
  else {
@@ -60,8 +60,6 @@ if (options.serverUrl) {
60
60
  if (options.apiKey) {
61
61
  process.env.CLI_API_KEY = options.apiKey;
62
62
  }
63
- // Test configuration
64
- getClientConfigurationFromEnvironment();
65
63
  // Set up initialization callback to capture client info
66
64
  server.server.oninitialized = () => {
67
65
  const clientInfo = server.server.getClientVersion();
@@ -76,6 +74,8 @@ server.server.oninitialized = () => {
76
74
  logger.info(`Starting Octopus Deploy MCP server (version: ${SEMVER_VERSION})`);
77
75
  // Start server
78
76
  async function runServer() {
77
+ // Test configuration
78
+ getClientConfigurationFromEnvironment();
79
79
  const transport = new StdioServerTransport();
80
80
  await server.connect(transport);
81
81
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,qCAAqC,EAAE,MAAM,oDAAoD,CAAC;AAC3G,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAA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AAO,CAAC,CAAC;QACnD,MAAM,CAAC,IAAI,CACT,uBAAuB,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,OAAO,EAAE,CAChE,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;IACjE,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,IAAI,CAAC,gDAAgD,cAAc,GAAG,CAAC,CAAC;AAE/E,eAAe;AACf,KAAK,UAAU,SAAS;IACtB,qBAAqB;IACrB,qCAAqC,EAAE,CAAC;IAExC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IAC1B,MAAM,CAAC,KAAK,CAAC,+BAA+B,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerCreateReleaseTool(server: McpServer): void;
3
+ //# sourceMappingURL=createRelease.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRelease.d.ts","sourceRoot":"","sources":["../../src/tools/createRelease.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,QAiI1D"}
@@ -0,0 +1,108 @@
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
+ import { handleOctopusApiError } from "../helpers/errorHandling.js";
7
+ export function registerCreateReleaseTool(server) {
8
+ server.tool("create_release", `Create a new release for an Octopus Deploy project
9
+
10
+ This tool creates a new release for a project. The space name and project name are required. All other parameters are optional and will use Octopus defaults if not specified.`, {
11
+ spaceName: z.string().describe("The space name"),
12
+ projectName: z.string().describe("The project name"),
13
+ releaseVersion: z
14
+ .string()
15
+ .optional()
16
+ .describe("The version for the release (e.g., '1.0.0'). If not specified, Octopus will auto-generate based on project settings."),
17
+ channelName: z
18
+ .string()
19
+ .optional()
20
+ .describe("The channel name (uses default channel if not specified)"),
21
+ packageVersion: z
22
+ .string()
23
+ .optional()
24
+ .describe("Default package version to use for all packages"),
25
+ packages: z
26
+ .array(z.string())
27
+ .optional()
28
+ .describe("Array of package specifications (format depends on Octopus configuration)"),
29
+ gitCommit: z.string().optional().describe("Git commit hash"),
30
+ gitRef: z.string().optional().describe("Git reference (branch or tag)"),
31
+ releaseNotes: z
32
+ .string()
33
+ .optional()
34
+ .describe("Release notes for this release"),
35
+ ignoreIfAlreadyExists: z
36
+ .boolean()
37
+ .optional()
38
+ .describe("If true, skip creation if release already exists (returns existing release)"),
39
+ ignoreChannelRules: z
40
+ .boolean()
41
+ .optional()
42
+ .describe("If true, ignore channel version rules"),
43
+ packagePrerelease: z
44
+ .string()
45
+ .optional()
46
+ .describe("Package prerelease tag"),
47
+ customFields: z
48
+ .record(z.string())
49
+ .optional()
50
+ .describe("Custom field values as key-value pairs"),
51
+ }, {
52
+ title: "Create a new release in Octopus Deploy",
53
+ readOnlyHint: false,
54
+ }, async ({ spaceName, projectName, releaseVersion, channelName, packageVersion, packages, gitCommit, gitRef, releaseNotes, ignoreIfAlreadyExists, ignoreChannelRules, packagePrerelease, customFields, }) => {
55
+ try {
56
+ const configuration = getClientConfigurationFromEnvironment();
57
+ const client = await Client.create(configuration);
58
+ const releaseRepository = new ReleaseRepository(client, spaceName);
59
+ const command = {
60
+ spaceName: spaceName,
61
+ ProjectName: projectName,
62
+ ...(releaseVersion && { ReleaseVersion: releaseVersion }),
63
+ ...(channelName && { ChannelName: channelName }),
64
+ ...(packageVersion && { PackageVersion: packageVersion }),
65
+ ...(packages && { Packages: packages }),
66
+ ...(gitCommit && { GitCommit: gitCommit }),
67
+ ...(gitRef && { GitRef: gitRef }),
68
+ ...(releaseNotes && { ReleaseNotes: releaseNotes }),
69
+ ...(ignoreIfAlreadyExists !== undefined && {
70
+ IgnoreIfAlreadyExists: ignoreIfAlreadyExists,
71
+ }),
72
+ ...(ignoreChannelRules !== undefined && {
73
+ IgnoreChannelRules: ignoreChannelRules,
74
+ }),
75
+ ...(packagePrerelease && { PackagePrerelease: packagePrerelease }),
76
+ ...(customFields && { CustomFields: customFields }),
77
+ };
78
+ const response = await releaseRepository.create(command);
79
+ return {
80
+ content: [
81
+ {
82
+ type: "text",
83
+ text: JSON.stringify({
84
+ success: true,
85
+ releaseId: response.ReleaseId,
86
+ releaseVersion: response.ReleaseVersion,
87
+ message: `Release ${response.ReleaseVersion} created successfully`,
88
+ helpText: "Use find_releases to view release details, or use deploy_release to deploy this release to environments.",
89
+ }, null, 2),
90
+ },
91
+ ],
92
+ };
93
+ }
94
+ catch (error) {
95
+ handleOctopusApiError(error, {
96
+ entityType: "release",
97
+ spaceName,
98
+ helpText: "Use list_projects to find valid project names. Ensure you have permissions to create releases and that the project exists.",
99
+ });
100
+ }
101
+ });
102
+ }
103
+ registerToolDefinition({
104
+ toolName: "create_release",
105
+ config: { toolset: "releases", readOnly: false },
106
+ registerFn: registerCreateReleaseTool,
107
+ });
108
+ //# sourceMappingURL=createRelease.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRelease.js","sourceRoot":"","sources":["../../src/tools/createRelease.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CA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