create_app
Create a new Heroku application with customizable settings, including name, region, private space, or team association. Automatically generate app names if not specified and receive detailed app information upon creation.
Instructions
Create a new Heroku application with customizable settings. Use this tool when a user wants to: 1) Create a new app with a specific name, 2) Create an app in a particular region (US/EU), 3) Create an app within a team, or 4) Create an app in a private space. The tool handles name generation if not specified and returns the new app's details.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | Specifies the desired name for the new Heroku app. If omitted, Heroku will auto-generate a random name. Best practice: Provide a meaningful, unique name that reflects your application's purpose. | |
| region | No | Determines the geographical region where your app will run. Options: "us" (United States) or "eu" (Europe). Defaults to "us" if not specified. Note: Cannot be used with space parameter. | |
| space | No | Places the app in a specific private space, which provides enhanced security and networking features. Specify the private space name. Note: When used, the app inherits the region from the private space and the region parameter cannot be used. | |
| team | No | Associates the app with a specific team for collaborative development and management. Provide the team name to set ownership. The app will be created under the team's account rather than your personal account. |
Implementation Reference
- src/tools/apps.ts:116-128 (handler)The core handler function that constructs a CommandBuilder for the 'apps:create' CLI command using provided options and executes it via the HerokuREPL, returning the processed output.async (options: CreateAppOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.CREATE_APP) .addPositionalArguments({ app: options.app }) .addFlags({ region: options.region, space: options.space, team: options.team }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); }
- src/tools/apps.ts:93-98 (schema)Zod schema defining the input parameters for the create_app tool, including optional app name, region, space, and team.export const createAppOptionsSchema = z.object({ app: z.string().optional().describe('App name. Auto-generated if omitted'), region: z.enum(['us', 'eu']).optional().describe('Region: us/eu. Default: us. Excludes space param'), space: z.string().optional().describe('Private space name. Inherits region. Excludes region param'), team: z.string().optional().describe('Team name for ownership') });
- src/tools/apps.ts:111-130 (registration)Module-level registration function that registers the 'create_app' tool on the MCP server with schema and handler.export const registerCreateAppTool = (server: McpServer, herokuRepl: HerokuREPL): void => { server.tool( 'create_app', 'Create app: custom name, region (US/EU), team, private space', createAppOptionsSchema.shape, async (options: CreateAppOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.CREATE_APP) .addPositionalArguments({ app: options.app }) .addFlags({ region: options.region, space: options.space, team: options.team }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); } ); };
- src/index.ts:52-52 (registration)Top-level application registration call for the create_app tool.apps.registerCreateAppTool(server, herokuRepl);
- src/utils/tool-commands.ts:8-8 (helper)Helper constant mapping the CREATE_APP tool to the Heroku CLI command 'apps:create'.CREATE_APP: 'apps:create',