@hanzo/platform-mcp 1.4.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 (83) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +534 -0
  3. package/build/http-server.js +286 -0
  4. package/build/index.js +35 -0
  5. package/build/mcp/tools/application/applicationCleanQueues.js +23 -0
  6. package/build/mcp/tools/application/applicationCreate.js +39 -0
  7. package/build/mcp/tools/application/applicationDelete.js +21 -0
  8. package/build/mcp/tools/application/applicationDeploy.js +21 -0
  9. package/build/mcp/tools/application/applicationMarkRunning.js +23 -0
  10. package/build/mcp/tools/application/applicationMove.js +22 -0
  11. package/build/mcp/tools/application/applicationOne.js +26 -0
  12. package/build/mcp/tools/application/applicationReadAppMonitoring.js +26 -0
  13. package/build/mcp/tools/application/applicationReadTraefikConfig.js +26 -0
  14. package/build/mcp/tools/application/applicationRedeploy.js +23 -0
  15. package/build/mcp/tools/application/applicationRefreshToken.js +23 -0
  16. package/build/mcp/tools/application/applicationReload.js +22 -0
  17. package/build/mcp/tools/application/applicationSaveBitbucketProvider.js +49 -0
  18. package/build/mcp/tools/application/applicationSaveBuildType.js +56 -0
  19. package/build/mcp/tools/application/applicationSaveDockerProvider.js +43 -0
  20. package/build/mcp/tools/application/applicationSaveEnvironment.js +33 -0
  21. package/build/mcp/tools/application/applicationSaveGitProvider.js +49 -0
  22. package/build/mcp/tools/application/applicationSaveGiteaProvider.js +43 -0
  23. package/build/mcp/tools/application/applicationSaveGithubProvider.js +51 -0
  24. package/build/mcp/tools/application/applicationSaveGitlabProvider.js +48 -0
  25. package/build/mcp/tools/application/applicationStart.js +21 -0
  26. package/build/mcp/tools/application/applicationStop.js +21 -0
  27. package/build/mcp/tools/application/applicationUpdate.js +319 -0
  28. package/build/mcp/tools/application/applicationUpdateTraefikConfig.js +26 -0
  29. package/build/mcp/tools/application/index.js +24 -0
  30. package/build/mcp/tools/compose/composeCreate.js +31 -0
  31. package/build/mcp/tools/compose/composeDeploy.js +26 -0
  32. package/build/mcp/tools/compose/composeOne.js +24 -0
  33. package/build/mcp/tools/compose/composeReload.js +28 -0
  34. package/build/mcp/tools/compose/composeRemove.js +26 -0
  35. package/build/mcp/tools/compose/composeSaveEnvironment.js +28 -0
  36. package/build/mcp/tools/compose/composeStart.js +26 -0
  37. package/build/mcp/tools/compose/composeStop.js +26 -0
  38. package/build/mcp/tools/compose/composeUpdate.js +34 -0
  39. package/build/mcp/tools/compose/index.js +9 -0
  40. package/build/mcp/tools/index.js +12 -0
  41. package/build/mcp/tools/mysql/index.js +13 -0
  42. package/build/mcp/tools/mysql/mysqlChangeStatus.js +24 -0
  43. package/build/mcp/tools/mysql/mysqlCreate.js +50 -0
  44. package/build/mcp/tools/mysql/mysqlDeploy.js +21 -0
  45. package/build/mcp/tools/mysql/mysqlMove.js +24 -0
  46. package/build/mcp/tools/mysql/mysqlOne.js +23 -0
  47. package/build/mcp/tools/mysql/mysqlRebuild.js +21 -0
  48. package/build/mcp/tools/mysql/mysqlReload.js +22 -0
  49. package/build/mcp/tools/mysql/mysqlRemove.js +21 -0
  50. package/build/mcp/tools/mysql/mysqlSaveEnvironment.js +26 -0
  51. package/build/mcp/tools/mysql/mysqlSaveExternalPort.js +25 -0
  52. package/build/mcp/tools/mysql/mysqlStart.js +21 -0
  53. package/build/mcp/tools/mysql/mysqlStop.js +21 -0
  54. package/build/mcp/tools/mysql/mysqlUpdate.js +103 -0
  55. package/build/mcp/tools/postgres/index.js +13 -0
  56. package/build/mcp/tools/postgres/postgresChangeStatus.js +26 -0
  57. package/build/mcp/tools/postgres/postgresCreate.js +48 -0
  58. package/build/mcp/tools/postgres/postgresDeploy.js +23 -0
  59. package/build/mcp/tools/postgres/postgresMove.js +26 -0
  60. package/build/mcp/tools/postgres/postgresOne.js +26 -0
  61. package/build/mcp/tools/postgres/postgresRebuild.js +23 -0
  62. package/build/mcp/tools/postgres/postgresReload.js +26 -0
  63. package/build/mcp/tools/postgres/postgresRemove.js +23 -0
  64. package/build/mcp/tools/postgres/postgresSaveEnvironment.js +28 -0
  65. package/build/mcp/tools/postgres/postgresSaveExternalPort.js +27 -0
  66. package/build/mcp/tools/postgres/postgresStart.js +23 -0
  67. package/build/mcp/tools/postgres/postgresStop.js +23 -0
  68. package/build/mcp/tools/postgres/postgresUpdate.js +97 -0
  69. package/build/mcp/tools/project/index.js +6 -0
  70. package/build/mcp/tools/project/projectAll.js +68 -0
  71. package/build/mcp/tools/project/projectCreate.js +30 -0
  72. package/build/mcp/tools/project/projectDuplicate.js +54 -0
  73. package/build/mcp/tools/project/projectOne.js +24 -0
  74. package/build/mcp/tools/project/projectRemove.js +21 -0
  75. package/build/mcp/tools/project/projectUpdate.js +39 -0
  76. package/build/mcp/tools/toolFactory.js +60 -0
  77. package/build/server.js +12 -0
  78. package/build/types/platform.js +3 -0
  79. package/build/utils/apiClient.js +126 -0
  80. package/build/utils/clientConfig.js +37 -0
  81. package/build/utils/logger.js +38 -0
  82. package/build/utils/responseFormatter.js +33 -0
  83. package/package.json +63 -0
@@ -0,0 +1,49 @@
1
+ import { z } from "zod";
2
+ import apiClient from "../../../utils/apiClient.js";
3
+ import { ResponseFormatter } from "../../../utils/responseFormatter.js";
4
+ import { createTool } from "../toolFactory.js";
5
+ export const applicationSaveBitbucketProvider = createTool({
6
+ name: "application-saveBitbucketProvider",
7
+ description: "Saves Bitbucket provider configuration for an application in Platform.",
8
+ schema: z.object({
9
+ applicationId: z
10
+ .string()
11
+ .describe("The ID of the application to save Bitbucket provider for."),
12
+ bitbucketRepository: z
13
+ .string()
14
+ .nullable()
15
+ .describe("The Bitbucket repository URL or name."),
16
+ bitbucketOwner: z
17
+ .string()
18
+ .nullable()
19
+ .describe("The Bitbucket repository owner."),
20
+ bitbucketBranch: z
21
+ .string()
22
+ .nullable()
23
+ .describe("The branch to use from the repository."),
24
+ bitbucketBuildPath: z
25
+ .string()
26
+ .nullable()
27
+ .describe("The path within the repository to build from."),
28
+ bitbucketId: z
29
+ .string()
30
+ .nullable()
31
+ .describe("The Bitbucket integration ID."),
32
+ watchPaths: z
33
+ .array(z.string())
34
+ .nullable()
35
+ .optional()
36
+ .describe("Array of paths to watch for changes."),
37
+ enableSubmodules: z.boolean().describe("Whether to enable submodules."),
38
+ }),
39
+ annotations: {
40
+ title: "Save Application Bitbucket Provider",
41
+ destructiveHint: true,
42
+ idempotentHint: false,
43
+ openWorldHint: true,
44
+ },
45
+ handler: async (input) => {
46
+ const response = await apiClient.post("/application.saveBitbucketProvider", input);
47
+ return ResponseFormatter.success(`Bitbucket provider for application "${input.applicationId}" saved successfully`, response.data);
48
+ },
49
+ });
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ import apiClient from "../../../utils/apiClient.js";
3
+ import { ResponseFormatter } from "../../../utils/responseFormatter.js";
4
+ import { createTool } from "../toolFactory.js";
5
+ export const applicationSaveBuildType = createTool({
6
+ name: "application-saveBuildType",
7
+ description: "Saves build type configuration for an application in Platform.",
8
+ schema: z.object({
9
+ applicationId: z
10
+ .string()
11
+ .describe("The ID of the application to save build type for."),
12
+ buildType: z
13
+ .enum([
14
+ "dockerfile",
15
+ "heroku_buildpacks",
16
+ "paketo_buildpacks",
17
+ "nixpacks",
18
+ "static",
19
+ "railpack",
20
+ ])
21
+ .describe("The build type for the application."),
22
+ dockerContextPath: z
23
+ .string()
24
+ .nullable()
25
+ .describe("Docker context path (required field)."),
26
+ dockerBuildStage: z
27
+ .string()
28
+ .nullable()
29
+ .describe("Docker build stage (required field)."),
30
+ dockerfile: z
31
+ .string()
32
+ .nullable()
33
+ .optional()
34
+ .describe("Dockerfile content or path."),
35
+ herokuVersion: z
36
+ .string()
37
+ .nullable()
38
+ .optional()
39
+ .describe("Heroku version for heroku_buildpacks build type."),
40
+ publishDirectory: z
41
+ .string()
42
+ .nullable()
43
+ .optional()
44
+ .describe("Directory to publish the built application."),
45
+ }),
46
+ annotations: {
47
+ title: "Save Application Build Type",
48
+ destructiveHint: true,
49
+ idempotentHint: false,
50
+ openWorldHint: true,
51
+ },
52
+ handler: async (input) => {
53
+ const response = await apiClient.post("/application.saveBuildType", input);
54
+ return ResponseFormatter.success(`Build type for application "${input.applicationId}" saved successfully`, response.data);
55
+ },
56
+ });
@@ -0,0 +1,43 @@
1
+ import { z } from "zod";
2
+ import apiClient from "../../../utils/apiClient.js";
3
+ import { ResponseFormatter } from "../../../utils/responseFormatter.js";
4
+ import { createTool } from "../toolFactory.js";
5
+ export const applicationSaveDockerProvider = createTool({
6
+ name: "application-saveDockerProvider",
7
+ description: "Saves Docker provider configuration for an application in Platform.",
8
+ schema: z.object({
9
+ applicationId: z
10
+ .string()
11
+ .describe("The ID of the application to save Docker provider for."),
12
+ dockerImage: z
13
+ .string()
14
+ .nullable()
15
+ .optional()
16
+ .describe("The Docker image to use for the application."),
17
+ username: z
18
+ .string()
19
+ .nullable()
20
+ .optional()
21
+ .describe("Username for Docker registry authentication."),
22
+ password: z
23
+ .string()
24
+ .nullable()
25
+ .optional()
26
+ .describe("Password for Docker registry authentication."),
27
+ registryUrl: z
28
+ .string()
29
+ .nullable()
30
+ .optional()
31
+ .describe("The Docker registry URL."),
32
+ }),
33
+ annotations: {
34
+ title: "Save Application Docker Provider",
35
+ destructiveHint: true,
36
+ idempotentHint: false,
37
+ openWorldHint: true,
38
+ },
39
+ handler: async (input) => {
40
+ const response = await apiClient.post("/application.saveDockerProvider", input);
41
+ return ResponseFormatter.success(`Docker provider for application "${input.applicationId}" saved successfully`, response.data);
42
+ },
43
+ });
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ import apiClient from "../../../utils/apiClient.js";
3
+ import { ResponseFormatter } from "../../../utils/responseFormatter.js";
4
+ import { createTool } from "../toolFactory.js";
5
+ export const applicationSaveEnvironment = createTool({
6
+ name: "application-saveEnvironment",
7
+ description: "Saves environment variables for an application in Platform.",
8
+ schema: z.object({
9
+ applicationId: z
10
+ .string()
11
+ .describe("The ID of the application to save environment for."),
12
+ env: z
13
+ .string()
14
+ .nullable()
15
+ .optional()
16
+ .describe("Environment variables to save for the application."),
17
+ buildArgs: z
18
+ .string()
19
+ .nullable()
20
+ .optional()
21
+ .describe("Build arguments for the application."),
22
+ }),
23
+ annotations: {
24
+ title: "Save Application Environment",
25
+ destructiveHint: true,
26
+ idempotentHint: false,
27
+ openWorldHint: true,
28
+ },
29
+ handler: async (input) => {
30
+ const response = await apiClient.post("/application.saveEnvironment", input);
31
+ return ResponseFormatter.success(`Environment variables for application "${input.applicationId}" saved successfully`, response.data);
32
+ },
33
+ });
@@ -0,0 +1,49 @@
1
+ import { z } from "zod";
2
+ import apiClient from "../../../utils/apiClient.js";
3
+ import { ResponseFormatter } from "../../../utils/responseFormatter.js";
4
+ import { createTool } from "../toolFactory.js";
5
+ export const applicationSaveGitProvider = createTool({
6
+ name: "application-saveGitProvider",
7
+ description: "Saves Git provider configuration for an application in Platform.",
8
+ schema: z.object({
9
+ applicationId: z
10
+ .string()
11
+ .describe("The ID of the application to save Git provider for."),
12
+ customGitUrl: z
13
+ .string()
14
+ .nullable()
15
+ .optional()
16
+ .describe("The custom Git repository URL."),
17
+ customGitBranch: z
18
+ .string()
19
+ .nullable()
20
+ .optional()
21
+ .describe("The branch to use from the repository."),
22
+ customGitBuildPath: z
23
+ .string()
24
+ .nullable()
25
+ .optional()
26
+ .describe("The path within the repository to build from."),
27
+ customGitSSHKeyId: z
28
+ .string()
29
+ .nullable()
30
+ .optional()
31
+ .describe("The SSH key ID for Git authentication."),
32
+ watchPaths: z
33
+ .array(z.string())
34
+ .nullable()
35
+ .optional()
36
+ .describe("Array of paths to watch for changes."),
37
+ enableSubmodules: z.boolean().describe("Whether to enable submodules."),
38
+ }),
39
+ annotations: {
40
+ title: "Save Application Git Provider",
41
+ destructiveHint: true,
42
+ idempotentHint: false,
43
+ openWorldHint: true,
44
+ },
45
+ handler: async (input) => {
46
+ const response = await apiClient.post("/application.saveGitProdiver", input);
47
+ return ResponseFormatter.success(`Git provider for application "${input.applicationId}" saved successfully`, response.data);
48
+ },
49
+ });
@@ -0,0 +1,43 @@
1
+ import { z } from "zod";
2
+ import apiClient from "../../../utils/apiClient.js";
3
+ import { ResponseFormatter } from "../../../utils/responseFormatter.js";
4
+ import { createTool } from "../toolFactory.js";
5
+ export const applicationSaveGiteaProvider = createTool({
6
+ name: "application-saveGiteaProvider",
7
+ description: "Saves Gitea provider configuration for an application in Platform.",
8
+ schema: z.object({
9
+ applicationId: z
10
+ .string()
11
+ .describe("The ID of the application to save Gitea provider for."),
12
+ giteaRepository: z
13
+ .string()
14
+ .nullable()
15
+ .describe("The Gitea repository URL or name."),
16
+ giteaOwner: z.string().nullable().describe("The Gitea repository owner."),
17
+ giteaBranch: z
18
+ .string()
19
+ .nullable()
20
+ .describe("The branch to use from the repository."),
21
+ giteaBuildPath: z
22
+ .string()
23
+ .nullable()
24
+ .describe("The path within the repository to build from."),
25
+ giteaId: z.string().nullable().describe("The Gitea integration ID."),
26
+ watchPaths: z
27
+ .array(z.string())
28
+ .nullable()
29
+ .optional()
30
+ .describe("Array of paths to watch for changes."),
31
+ enableSubmodules: z.boolean().describe("Whether to enable submodules."),
32
+ }),
33
+ annotations: {
34
+ title: "Save Application Gitea Provider",
35
+ destructiveHint: true,
36
+ idempotentHint: false,
37
+ openWorldHint: true,
38
+ },
39
+ handler: async (input) => {
40
+ const response = await apiClient.post("/application.saveGiteaProvider", input);
41
+ return ResponseFormatter.success(`Gitea provider for application "${input.applicationId}" saved successfully`, response.data);
42
+ },
43
+ });
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+ import apiClient from "../../../utils/apiClient.js";
3
+ import { ResponseFormatter } from "../../../utils/responseFormatter.js";
4
+ import { createTool } from "../toolFactory.js";
5
+ export const applicationSaveGithubProvider = createTool({
6
+ name: "application-saveGithubProvider",
7
+ description: "Saves GitHub provider configuration for an application in Platform.",
8
+ schema: z.object({
9
+ applicationId: z
10
+ .string()
11
+ .describe("The ID of the application to save GitHub provider for."),
12
+ repository: z
13
+ .string()
14
+ .nullable()
15
+ .optional()
16
+ .describe("The GitHub repository URL or name."),
17
+ branch: z
18
+ .string()
19
+ .nullable()
20
+ .optional()
21
+ .describe("The branch to use from the repository."),
22
+ owner: z.string().nullable().describe("The GitHub repository owner."),
23
+ buildPath: z
24
+ .string()
25
+ .nullable()
26
+ .optional()
27
+ .describe("The path within the repository to build from."),
28
+ githubId: z.string().nullable().describe("The GitHub integration ID."),
29
+ watchPaths: z
30
+ .array(z.string())
31
+ .nullable()
32
+ .optional()
33
+ .describe("Paths to watch for changes."),
34
+ enableSubmodules: z.boolean().describe("Whether to enable git submodules."),
35
+ triggerType: z
36
+ .enum(["push", "tag"])
37
+ .optional()
38
+ .default("push")
39
+ .describe("The trigger type for deployments."),
40
+ }),
41
+ annotations: {
42
+ title: "Save Application GitHub Provider",
43
+ destructiveHint: true,
44
+ idempotentHint: false,
45
+ openWorldHint: true,
46
+ },
47
+ handler: async (input) => {
48
+ const response = await apiClient.post("/application.saveGithubProvider", input);
49
+ return ResponseFormatter.success(`GitHub provider for application "${input.applicationId}" saved successfully`, response.data);
50
+ },
51
+ });
@@ -0,0 +1,48 @@
1
+ import { z } from "zod";
2
+ import apiClient from "../../../utils/apiClient.js";
3
+ import { ResponseFormatter } from "../../../utils/responseFormatter.js";
4
+ import { createTool } from "../toolFactory.js";
5
+ export const applicationSaveGitlabProvider = createTool({
6
+ name: "application-saveGitlabProvider",
7
+ description: "Saves GitLab provider configuration for an application in Platform.",
8
+ schema: z.object({
9
+ applicationId: z
10
+ .string()
11
+ .describe("The ID of the application to save GitLab provider for."),
12
+ gitlabBranch: z
13
+ .string()
14
+ .nullable()
15
+ .describe("The branch to use from the repository."),
16
+ gitlabBuildPath: z
17
+ .string()
18
+ .nullable()
19
+ .describe("The path within the repository to build from."),
20
+ gitlabOwner: z.string().nullable().describe("The GitLab repository owner."),
21
+ gitlabRepository: z
22
+ .string()
23
+ .nullable()
24
+ .describe("The GitLab repository URL or name."),
25
+ gitlabId: z.string().nullable().describe("The GitLab integration ID."),
26
+ gitlabProjectId: z.number().nullable().describe("The GitLab project ID."),
27
+ gitlabPathNamespace: z
28
+ .string()
29
+ .nullable()
30
+ .describe("The GitLab path namespace."),
31
+ watchPaths: z
32
+ .array(z.string())
33
+ .nullable()
34
+ .optional()
35
+ .describe("Paths to watch for changes."),
36
+ enableSubmodules: z.boolean().describe("Whether to enable git submodules."),
37
+ }),
38
+ annotations: {
39
+ title: "Save Application GitLab Provider",
40
+ destructiveHint: true,
41
+ idempotentHint: false,
42
+ openWorldHint: true,
43
+ },
44
+ handler: async (input) => {
45
+ const response = await apiClient.post("/application.saveGitlabProvider", input);
46
+ return ResponseFormatter.success(`GitLab provider for application "${input.applicationId}" saved successfully`, response.data);
47
+ },
48
+ });
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ import apiClient from "../../../utils/apiClient.js";
3
+ import { ResponseFormatter } from "../../../utils/responseFormatter.js";
4
+ import { createTool } from "../toolFactory.js";
5
+ export const applicationStart = createTool({
6
+ name: "application-start",
7
+ description: "Starts an application in Platform.",
8
+ schema: z.object({
9
+ applicationId: z.string().describe("The ID of the application to start."),
10
+ }),
11
+ annotations: {
12
+ title: "Start Application",
13
+ destructiveHint: false,
14
+ idempotentHint: false,
15
+ openWorldHint: true,
16
+ },
17
+ handler: async (input) => {
18
+ const response = await apiClient.post("/application.start", input);
19
+ return ResponseFormatter.success(`Application "${input.applicationId}" started successfully`, response.data);
20
+ },
21
+ });
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ import apiClient from "../../../utils/apiClient.js";
3
+ import { ResponseFormatter } from "../../../utils/responseFormatter.js";
4
+ import { createTool } from "../toolFactory.js";
5
+ export const applicationStop = createTool({
6
+ name: "application-stop",
7
+ description: "Stops an application in Platform.",
8
+ schema: z.object({
9
+ applicationId: z.string().describe("The ID of the application to stop."),
10
+ }),
11
+ annotations: {
12
+ title: "Stop Application",
13
+ destructiveHint: false,
14
+ idempotentHint: false,
15
+ openWorldHint: true,
16
+ },
17
+ handler: async (input) => {
18
+ const response = await apiClient.post("/application.stop", input);
19
+ return ResponseFormatter.success(`Application "${input.applicationId}" stopped successfully`, response.data);
20
+ },
21
+ });