Skip to main content
Glama

AEM MCP Server

test-server.jsโ€ข2.26 kB
#!/usr/bin/env node // Quick test script to verify the AEM MCP server starts correctly import { AEMConnector } from './dist/aem-connector.js'; import { MCPRequestHandler } from './dist/mcp-handler.js'; async function testServer() { console.log('๐Ÿงช Testing AEM MCP Server...'); try { // Test AEM Connector initialization console.log('1. Initializing AEM Connector...'); const aemConnector = new AEMConnector(); console.log('โœ… AEM Connector initialized successfully'); // Test MCP Handler initialization console.log('2. Initializing MCP Handler...'); const mcpHandler = new MCPRequestHandler(aemConnector); console.log('โœ… MCP Handler initialized successfully'); // Test available methods console.log('3. Testing available methods...'); const methods = mcpHandler.getAvailableMethods(); console.log(`โœ… Found ${methods.length} available methods:`); // List key methods that were improved const keyMethods = ['listChildren', 'listPages', 'activatePage', 'deactivatePage', 'bulkUpdateComponents']; keyMethods.forEach(method => { const found = methods.find(m => m.name === method); if (found) { console.log(` โœ… ${method} - ${found.description}`); } else { console.log(` โŒ ${method} - NOT FOUND`); } }); // Test connection (will fail without AEM but should not crash) console.log('4. Testing AEM connection...'); try { const connected = await aemConnector.testConnection(); if (connected) { console.log('โœ… AEM connection successful'); } else { console.log('โš ๏ธ AEM connection failed (expected if AEM is not running)'); } } catch (error) { console.log('โš ๏ธ AEM connection test failed (expected if AEM is not running):', error.message); } console.log('\n๐ŸŽ‰ All tests passed! The AEM MCP Server is ready to use.'); console.log('\nTo start the server:'); console.log(' npm start # Start the gateway server'); console.log(' npm run mcp # Start the MCP server'); } catch (error) { console.error('โŒ Test failed:', error.message); console.error(error.stack); process.exit(1); } } testServer();

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/udaykumarbpatel/aem-mcp-server'

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