Skip to main content
Glama

create-composition

Generate a new composition in Adobe After Effects with customizable settings, including name, dimensions, pixel aspect ratio, duration, frame rate, and background color, for streamlined project creation.

Instructions

Create a new composition in After Effects with specified parameters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
backgroundColorNoBackground color of the composition (RGB values 0-255)
durationNoDuration in seconds (default: 10.0)
frameRateNoFrame rate in frames per second (default: 30.0)
heightYesHeight of the composition in pixels
nameYesName of the composition
pixelAspectNoPixel aspect ratio (default: 1.0)
widthYesWidth of the composition in pixels

Implementation Reference

  • The handler function for the 'create-composition' tool. It writes the command 'createComposition' with parameters to a temp file for After Effects to execute and returns a confirmation message.
    async (params) => {
      try {
        // Write command to file for After Effects to pick up
        writeCommandFile("createComposition", params);
        
        return {
          content: [
            {
              type: "text",
              text: `Command to create composition "${params.name}" has been queued.\n` +
                    `Please ensure the "MCP Bridge Auto" panel is open in After Effects.\n` +
                    `Use the "get-results" tool after a few seconds to check for results.`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error queuing composition creation: ${String(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the create-composition tool, including name, dimensions, duration, frame rate, and background color.
    {
      name: z.string().describe("Name of the composition"),
      width: z.number().int().positive().describe("Width of the composition in pixels"),
      height: z.number().int().positive().describe("Height of the composition in pixels"),
      pixelAspect: z.number().positive().optional().describe("Pixel aspect ratio (default: 1.0)"),
      duration: z.number().positive().optional().describe("Duration in seconds (default: 10.0)"),
      frameRate: z.number().positive().optional().describe("Frame rate in frames per second (default: 30.0)"),
      backgroundColor: z.object({
        r: z.number().int().min(0).max(255),
        g: z.number().int().min(0).max(255),
        b: z.number().int().min(0).max(255)
      }).optional().describe("Background color of the composition (RGB values 0-255)")
    },
  • src/index.ts:431-474 (registration)
    The server.tool() call that registers the 'create-composition' tool with its description, schema, and handler function.
    server.tool(
      "create-composition",
      "Create a new composition in After Effects with specified parameters",
      {
        name: z.string().describe("Name of the composition"),
        width: z.number().int().positive().describe("Width of the composition in pixels"),
        height: z.number().int().positive().describe("Height of the composition in pixels"),
        pixelAspect: z.number().positive().optional().describe("Pixel aspect ratio (default: 1.0)"),
        duration: z.number().positive().optional().describe("Duration in seconds (default: 10.0)"),
        frameRate: z.number().positive().optional().describe("Frame rate in frames per second (default: 30.0)"),
        backgroundColor: z.object({
          r: z.number().int().min(0).max(255),
          g: z.number().int().min(0).max(255),
          b: z.number().int().min(0).max(255)
        }).optional().describe("Background color of the composition (RGB values 0-255)")
      },
      async (params) => {
        try {
          // Write command to file for After Effects to pick up
          writeCommandFile("createComposition", params);
          
          return {
            content: [
              {
                type: "text",
                text: `Command to create composition "${params.name}" has been queued.\n` +
                      `Please ensure the "MCP Bridge Auto" panel is open in After Effects.\n` +
                      `Use the "get-results" tool after a few seconds to check for results.`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error queuing composition creation: ${String(error)}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • Supporting utility function that writes the command name and arguments to a JSON file in the system temp directory, which is monitored by the After Effects MCP bridge script.
    function writeCommandFile(command: string, args: Record<string, any> = {}): void {
      try {
        const commandFile = path.join(process.env.TEMP || process.env.TMP || '', 'ae_command.json');
        const commandData = {
          command,
          args,
          timestamp: new Date().toISOString(),
          status: "pending"  // pending, running, completed, error
        };
        fs.writeFileSync(commandFile, JSON.stringify(commandData, null, 2));
        console.error(`Command "${command}" written to ${commandFile}`);
      } catch (error) {
        console.error("Error writing command file:", error);
      }
    }
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/Dakkshin/after-effects-mcp'

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