Skip to main content
Glama

aem_install_package

Deploy Adobe Experience Manager (AEM) packages by specifying the package file path, host, port, and credentials. Supports optional forced installation for streamlined AEM management.

Instructions

Install a package in AEM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoForce installation (default: false)
hostNoAEM host (default: localhost)localhost
packagePathYesPath to the package file (.zip)
passwordNoAEM password (default: admin)admin
portNoAEM port (default: 4502)
usernameNoAEM username (default: admin)admin

Implementation Reference

  • src/index.ts:77-115 (registration)
    Registers the 'aem_install_package' tool including its name, description, and input schema in the ListTools response.
    { name: 'aem_install_package', description: 'Install a package in AEM', inputSchema: { type: 'object', properties: { packagePath: { type: 'string', description: 'Path to the package file (.zip)' }, host: { type: 'string', description: 'AEM host (default: localhost)', default: 'localhost' }, port: { type: 'number', description: 'AEM port (default: 4502)', default: 4502 }, username: { type: 'string', description: 'AEM username (default: admin)', default: 'admin' }, password: { type: 'string', description: 'AEM password (default: admin)', default: 'admin' }, force: { type: 'boolean', description: 'Force installation (default: false)', default: false } }, required: ['packagePath'] } },
  • Main handler for aem_install_package tool: validates input, calls AEMClient.installPackage, formats and returns the response as MCP content.
    async installPackage(args: any) { const config = this.getConfig(args); const { packagePath, force = false } = args; if (!packagePath) { throw new Error('Package path is required'); } const result = await this.aemClient.installPackage(config, packagePath, force); return { content: [ { type: 'text', text: `Package Installation Result: Success: ${result.success} Message: ${result.message} Package: ${packagePath} Force: ${force}`, }, ], }; }
  • src/index.ts:355-356 (registration)
    Registers the handler dispatch for 'aem_install_package' in the CallToolRequestSchema switch statement.
    case 'aem_install_package': return await this.aemTools.installPackage(args);
  • Core helper function that performs the actual AEM package installation by sending a multipart POST request to /crx/packmgr/service.jsp with authentication and file upload.
    async installPackage(config: AEMConfig, packagePath: string, force: boolean = false): Promise<any> { const baseUrl = this.getBaseUrl(config); const authHeader = this.getAuthHeader(config); const readFile = promisify(fs.readFile); const access = promisify(fs.access); try { // Check if file exists await access(packagePath, fs.constants.F_OK); } catch (error) { throw new Error(`Package file not found: ${packagePath}`); } try { // Read the file as buffer instead of using createReadStream const fileBuffer = await readFile(packagePath); const formData = new FormData(); formData.append('file', fileBuffer, { filename: packagePath.split(/[/\\]/).pop() || 'package.zip', contentType: 'application/zip' }); formData.append('force', force.toString()); formData.append('install', 'true'); const response = await this.axiosInstance.post( `${baseUrl}/crx/packmgr/service.jsp`, formData, { headers: { 'Authorization': authHeader, ...formData.getHeaders(), }, } ); if (response.status === 200) { return { success: true, message: 'Package installed successfully', response: response.data, }; } else { return { success: false, message: `Installation failed: HTTP ${response.status}`, response: response.data, }; } } catch (error) { throw new Error(`Package installation failed: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
  • Helper utility to extract and default AEM configuration from tool arguments.
    private getConfig(args: any): AEMConfig { return { host: args.host || 'localhost', port: args.port || 4506, username: args.username || 'admin', password: args.password || 'admin', }; }

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/pradeep-moolemane/aem-mcp'

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