aem_status
Check the status of Adobe Experience Manager instances to verify connectivity and operational state using host, port, and authentication parameters.
Instructions
Check the status of AEM instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | AEM host (default: localhost) | localhost |
| port | No | AEM port (default: 4502) | |
| username | No | AEM username (default: admin) | admin |
| password | No | AEM password (default: admin) | admin |
Implementation Reference
- src/aem-tools.ts:15-33 (handler)The main handler function for the 'aem_status' tool. It extracts configuration from input arguments, calls the AEMClient to check the instance status, and returns a formatted text response.async checkStatus(args: any) { const config = this.getConfig(args); const status = await this.aemClient.checkStatus(config); return { content: [ { type: 'text', text: `AEM Instance Status: Host: ${config.host}:${config.port} Status: ${status.status} ${status.version ? `Version: ${status.version}` : ''} ${status.totalBundles ? `Total Bundles: ${status.totalBundles}` : ''} ${status.activeBundles ? `Active Bundles: ${status.activeBundles}` : ''} ${status.message ? `Message: ${status.message}` : ''}`, }, ], }; }
- src/index.ts:48-76 (registration)Registers the 'aem_status' tool in the MCP server's ListTools response, providing name, description, and input schema.{ name: 'aem_status', description: 'Check the status of AEM instance', inputSchema: { type: 'object', properties: { 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' } } } },
- src/index.ts:51-75 (schema)Input schema definition for the 'aem_status' tool, specifying optional parameters for AEM connection with defaults.inputSchema: { type: 'object', properties: { 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' } } }
- src/aem-tools.ts:6-13 (helper)Helper method to extract and provide default values for 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', }; }
- src/aem-client.ts:34-66 (helper)Core helper implementing the AEM status check via HTTP request to bundles endpoint, computing bundle counts and status, asynchronously fetching version.async checkStatus(config: AEMConfig): Promise<any> { const baseUrl = this.getBaseUrl(config); const authHeader = this.getAuthHeader(config); try { const response = await this.axiosInstance.get(`${baseUrl}/system/console/bundles.json`, { headers: { 'Authorization': authHeader, }, }); if (response.status === 200) { const data = response.data; console.log('AEM Status Data:', data); return { status: 'running', totalBundles: data.s?.length || 0, activeBundles: data.s?.filter((bundle: any) => bundle.state === 'Active').length || 0, version: await this.getAEMVersion(config), }; } else { return { status: 'error', message: `HTTP ${response.status}: ${response.statusText}`, }; } } catch (error) { return { status: 'offline', message: error instanceof Error ? error.message : 'Unknown error', }; } }