Skip to main content
Glama

aem_install_package

Install content packages into Adobe Experience Manager to deploy code, configurations, and assets to AEM instances.

Instructions

Install a package in AEM

Input Schema

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

Implementation Reference

  • The primary handler function for the 'aem_install_package' tool. It processes input arguments, validates the package path, delegates to AEMClient for installation, and formats the response.
    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}`, }, ], }; }
  • Core helper function that handles the actual AEM package installation via HTTP POST to the CRX package manager endpoint, including file upload and authentication.
    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'}`); } }
  • Input schema and metadata definition for the 'aem_install_package' tool, registered 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'] } },
  • src/index.ts:355-356 (registration)
    Switch case in the CallToolRequest handler that routes execution to the tool's handler function.
    case 'aem_install_package': return await this.aemTools.installPackage(args);

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