Skip to main content
Glama
akuity

argocd-mcp

Official
by akuity

create_application

Deploy applications to Kubernetes clusters by creating ArgoCD application resources with specified source repositories, sync policies, and destination targets.

Instructions

create_application creates a new ArgoCD application in the specified namespace. The application.metadata.namespace field determines where the Application resource will be created (e.g., "argocd", "argocd-apps", or any custom namespace).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applicationYes

Implementation Reference

  • Core implementation of application creation: performs HTTP POST to ArgoCD API /api/v1/applications with the application manifest.
    public async createApplication(application: V1alpha1Application) {
      const { body } = await this.client.post<V1alpha1Application, V1alpha1Application>(
        `/api/v1/applications`,
        null,
        application
      );
      return body;
    }
  • Zod schema defining the input structure for the 'application' parameter, used for validation in the tool registration.
    export const ApplicationSchema = z.object({
      metadata: z.object({
        name: z.string(),
        namespace: ApplicationNamespaceSchema
      }),
      spec: z.object({
        project: z.string(),
        source: z.object({
          repoURL: z.string(),
          path: z.string(),
          targetRevision: z.string()
        }),
        syncPolicy: z.object({
          syncOptions: z.array(z.string()),
          automated: z.object({
            prune: z.boolean(),
            selfHeal: z.boolean()
          }).optional(),
          retry: z
            .object({
              limit: z.number(),
              backoff: z.object({
                duration: z.string(),
                maxDuration: z.string(),
                factor: z.number()
              })
            })
        }),
        destination: z.object({
          server: z.string().optional(),
          namespace: z.string().optional(),
          name: z.string().optional()
        })
          .refine(
            (data: { server?: string; name?: string }) =>
              (!data.server && !!data.name) || (!!data.server && !data.name),
            {
              message: "Only one of server or name must be specified in destination"
            }
          )
          .describe(
            `The destination of the application.
             Only one of server or name must be specified.`
          )
      })
    });
  • Registers the MCP tool 'create_application' with name, description, input schema {application: ApplicationSchema}, and handler that delegates to ArgoCDClient.createApplication.
    this.addJsonOutputTool(
      'create_application',
      'create_application creates a new ArgoCD application in the specified namespace. The application.metadata.namespace field determines where the Application resource will be created (e.g., "argocd", "argocd-apps", or any custom namespace).',
      { application: ApplicationSchema },
      async ({ application }) =>
        await this.argocdClient.createApplication(application as V1alpha1Application)
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/akuity/argocd-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server