Skip to main content
Glama

aem_replicate_content

Activate or deactivate content replication to AEM publish instances by specifying the content path, action, and host details using the MCP server.

Instructions

Replicate content to publish instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoReplication action (activate/deactivate)activate
hostNoAEM host (default: localhost)localhost
passwordNoAEM password (default: admin)admin
pathYesContent path to replicate
portNoAEM port (default: 4502)
usernameNoAEM username (default: admin)admin

Implementation Reference

  • The main handler function for the 'aem_replicate_content' tool. It extracts arguments, validates input, calls the AEMClient to perform replication, and returns formatted response content.
    async replicateContent(args: any) { const config = this.getConfig(args); const { path, action = 'activate' } = args; if (!path) { throw new Error('Content path is required'); } const result = await this.aemClient.replicateContent(config, path, action); return { content: [ { type: 'text', text: `Content Replication Result: Success: ${result.success} Message: ${result.message} Path: ${path} Action: ${action}`, }, ], }; }
  • Supporting utility in AEMClient that performs the actual HTTP POST request to AEM's /bin/replicate.json endpoint to activate or deactivate content.
    async replicateContent(config: AEMConfig, contentPath: string, action: string = 'activate'): Promise<any> { const baseUrl = this.getBaseUrl(config); const authHeader = this.getAuthHeader(config); const formData = new FormData(); formData.append('cmd', action); formData.append('path', contentPath); try { const response = await this.axiosInstance.post( `${baseUrl}/bin/replicate.json`, formData, { headers: { 'Authorization': authHeader, ...formData.getHeaders(), }, } ); if (response.status === 200) { return { success: true, message: `Content ${action}d successfully: ${contentPath}`, response: response.data, }; } else { return { success: false, message: `Replication failed: HTTP ${response.status}`, response: response.data, }; } } catch (error) { throw new Error(`Replication failed: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
  • The tool schema definition including inputSchema with properties, defaults, and required fields for the 'aem_replicate_content' tool.
    { name: 'aem_replicate_content', description: 'Replicate content to publish instance', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Content path to replicate' }, action: { type: 'string', description: 'Replication action (activate/deactivate)', enum: ['activate', 'deactivate'], default: 'activate' }, 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' } }, required: ['path'] } },
  • src/index.ts:361-362 (registration)
    Registration in the CallToolRequest handler switch statement, dispatching to the aemTools.replicateContent method.
    case 'aem_replicate_content': return await this.aemTools.replicateContent(args);

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