@mks2508/coolify-mks-cli-mcp 0.4.2 → 0.4.3

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.
@@ -17299,13 +17299,14 @@ class CoolifyService {
17299
17299
  const listResult = await this.request(`/applications/${appUuid}/envs`);
17300
17300
  const existing = listResult.data?.find((v) => v.key === key);
17301
17301
  if (existing) {
17302
- const patchResult = await this.request(`/applications/${appUuid}/envs/${existing.uuid}`, {
17303
- method: "PATCH",
17302
+ await this.request(`/applications/${appUuid}/envs/${existing.uuid}`, { method: "DELETE" });
17303
+ const repost = await this.request(`/applications/${appUuid}/envs`, {
17304
+ method: "POST",
17304
17305
  body: JSON.stringify({ key, value, is_preview: false })
17305
17306
  });
17306
- if (patchResult.error) {
17307
- log.error(`Failed to update env var ${key}: ${patchResult.error}`);
17308
- return err(new Error(`Failed to update ${key}: ${patchResult.error}`));
17307
+ if (repost.error) {
17308
+ log.error(`Failed to update env var ${key}: ${repost.error}`);
17309
+ return err(new Error(`Failed to update ${key}: ${repost.error}`));
17309
17310
  }
17310
17311
  log.debug(`Updated existing env var: ${key}`);
17311
17312
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mks2508/coolify-mks-cli-mcp",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "MCP server and CLI for Coolify deployment management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -372,17 +372,18 @@ export class CoolifyService {
372
372
  })
373
373
 
374
374
  if (result.error && result.error.includes('already exists')) {
375
- // Var exists — find its UUID and PATCH
375
+ // Var exists — DELETE + re-POST (Coolify PATCH on envs returns 404)
376
376
  const listResult = await this.request<Array<{ uuid: string; key: string }>>(`/applications/${appUuid}/envs`)
377
377
  const existing = listResult.data?.find((v) => v.key === key)
378
378
  if (existing) {
379
- const patchResult = await this.request(`/applications/${appUuid}/envs/${existing.uuid}`, {
380
- method: 'PATCH',
379
+ await this.request(`/applications/${appUuid}/envs/${existing.uuid}`, { method: 'DELETE' })
380
+ const repost = await this.request(`/applications/${appUuid}/envs`, {
381
+ method: 'POST',
381
382
  body: JSON.stringify({ key, value, is_preview: false }),
382
383
  })
383
- if (patchResult.error) {
384
- log.error(`Failed to update env var ${key}: ${patchResult.error}`)
385
- return err(new Error(`Failed to update ${key}: ${patchResult.error}`))
384
+ if (repost.error) {
385
+ log.error(`Failed to update env var ${key}: ${repost.error}`)
386
+ return err(new Error(`Failed to update ${key}: ${repost.error}`))
386
387
  }
387
388
  log.debug(`Updated existing env var: ${key}`)
388
389
  } else {