Skip to main content
Glama
pulumi

@pulumi/mcp-server

Official
by pulumi

pulumi-cli-up

Execute pulumi up for a specific project and stack to deploy infrastructure updates. Define the working directory and stack name for targeted deployment.

Instructions

Run pulumi up for a given project and stack

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stackNameNoThe associated stack name. Defaults to 'dev'.
workDirYesThe working directory of the program.

Implementation Reference

  • Executes the pulumi up command using Pulumi's automation API: creates or selects a stack, runs stack.up(), summarizes resource changes, and returns formatted results.
        handler: async (args: UpArgs) => {
          const stackArgs: automation.LocalProgramArgs = {
            stackName: args.stackName ?? 'dev',
            workDir: args.workDir
          };
    
          const stack = await automation.LocalWorkspace.createOrSelectStack(stackArgs);
    
          // Run up
          const upResult = await stack.up();
    
          // Format the changes
          const changes = upResult.summary.resourceChanges!;
          const changesSummary = [
            `Create: ${changes.create}`,
            `Update: ${changes.update}`,
            `Delete: ${changes.delete}`,
            `Same: ${changes.same}`
          ].join('\n');
    
          return {
            description: 'Pulumi Up Results',
            content: [
              {
                type: 'text' as const,
                text: `
    Deployment Results for stack: ${stack.name}
    
    Changes:
    ${changesSummary}
    
    ${upResult.stdout || 'No additional output'}
    `
              }
            ]
          };
        }
  • Zod schema defining inputs for the tool: workDir (required string), stackName (optional string, defaults to 'dev').
    schema: {
      workDir: z.string().describe('The working directory of the program.'),
      stackName: z.string().optional().describe("The associated stack name. Defaults to 'dev'.")
    },
  • Registers the 'pulumi-cli-up' tool (and other CLI commands) by iterating over exported cliCommands from src/pulumi/cli.ts, constructing toolName as 'pulumi-cli-${commandName}' where commandName='up', and wrapping the handler with error handling.
      const toolName = `pulumi-cli-${commandName}`;
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      this.tool(toolName, command.description, command.schema, async (args: any) => {
        try {
          return await command.handler(args);
        } catch (error) {
          return handleError(error, toolName);
        }
      });
    });
Install Server

Other Tools

Related Tools

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/pulumi/mcp-server'

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