Skip to main content
Glama

Ultimate Elementor MCP

by mbrown1837
test-mcp-client.jsβ€’8.58 kB
#!/usr/bin/env node /** * Ultimate Elementor MCP - Client Test Suite * Tests the actual MCP server by connecting as a client */ import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'; console.log('\nπŸ”§ Wordsworth Presley hereβ€”testing the Ultimate Elementor MCP! πŸ”§\n'); console.log('='.repeat(80)); const results = { total: 0, passed: 0, failed: 0, tools: [] }; async function testMCPServer() { let client; try { // Create MCP client console.log('πŸ“‘ Connecting to MCP server...\n'); const transport = new StdioClientTransport({ command: 'node', args: ['dist/index.js'], env: { ...process.env, WORDPRESS_BASE_URL: 'https://practice.westlanddre.com', WORDPRESS_USERNAME: 'admin', WORDPRESS_APPLICATION_PASSWORD: 'sOld eDve k72A 2JUJ ptLx nOlt', MCP_MODE: 'full', DEBUG_MODE: 'true' } }); client = new Client({ name: 'ultimate-mcp-test-client', version: '1.0.0' }, { capabilities: { tools: {} } }); await client.connect(transport); console.log('βœ… Connected to MCP server!\n'); // List all available tools console.log('πŸ“‹ Listing all available tools...\n'); const toolsList = await client.listTools(); console.log(`🎨 Found ${toolsList.tools.length} tools!\n`); console.log('='.repeat(80)); if (toolsList.tools.length === 0) { console.log('⚠️ No tools registered! Check server configuration.\n'); return; } // Group tools by category const categories = { wordpress: [], elementor: [], file: [], config: [], debug: [] }; toolsList.tools.forEach(tool => { if (tool.name.includes('page') || tool.name.includes('post') || tool.name.includes('media') || tool.name.includes('user') || tool.name.includes('categor') || tool.name.includes('tag')) { categories.wordpress.push(tool); } else if (tool.name.includes('elementor') || tool.name.includes('section') || tool.name.includes('widget') || tool.name.includes('container') || tool.name.includes('template')) { categories.elementor.push(tool); } else if (tool.name.includes('file') || tool.name.includes('export') || tool.name.includes('import') || tool.name.includes('backup')) { categories.file.push(tool); } else if (tool.name.includes('config') || tool.name.includes('mode') || tool.name.includes('wordpress_connection')) { categories.config.push(tool); } else if (tool.name.includes('error') || tool.name.includes('log') || tool.name.includes('debug') || tool.name.includes('health')) { categories.debug.push(tool); } }); // Display tools by category console.log('\nπŸ“Š TOOLS BY CATEGORY:\n'); console.log(`πŸ”§ WordPress Tools: ${categories.wordpress.length}`); console.log(`🎨 Elementor Tools: ${categories.elementor.length}`); console.log(`πŸ“ File Operations: ${categories.file.length}`); console.log(`βš™οΈ Configuration: ${categories.config.length}`); console.log(`πŸ› Debugging: ${categories.debug.length}`); console.log('='.repeat(80)); // Test Configuration Tools First console.log('\nβš™οΈ TESTING CONFIGURATION TOOLS\n'); console.log('-'.repeat(80)); for (const tool of categories.config) { try { console.log(`\nπŸ”§ Testing: ${tool.name}`); console.log(` Description: ${tool.description || 'No description'}`); let testArgs = {}; // Specific test arguments for each tool if (tool.name === 'test_wordpress_connection') { // No args needed } else if (tool.name === 'get_server_config') { // No args needed } else if (tool.name === 'list_configuration_modes') { // No args needed } const result = await client.callTool({ name: tool.name, arguments: testArgs }); console.log(` βœ… Result: ${result.content[0].text.substring(0, 100)}...`); results.passed++; results.tools.push({ name: tool.name, status: 'passed' }); } catch (error) { console.log(` ❌ Error: ${error.message}`); results.failed++; results.tools.push({ name: tool.name, status: 'failed', error: error.message }); } results.total++; } // Test Debugging Tools console.log('\n\nπŸ› TESTING DEBUGGING TOOLS\n'); console.log('-'.repeat(80)); for (const tool of categories.debug) { try { console.log(`\nπŸ”§ Testing: ${tool.name}`); console.log(` Description: ${tool.description || 'No description'}`); let testArgs = {}; if (tool.name === 'set_log_level') { testArgs = { level: 'INFO' }; } else if (tool.name === 'enable_debug_mode') { testArgs = { enabled: false }; } const result = await client.callTool({ name: tool.name, arguments: testArgs }); console.log(` βœ… Result: ${result.content[0].text.substring(0, 100)}...`); results.passed++; results.tools.push({ name: tool.name, status: 'passed' }); } catch (error) { console.log(` ❌ Error: ${error.message}`); results.failed++; results.tools.push({ name: tool.name, status: 'failed', error: error.message }); } results.total++; } // Test a sample WordPress tool console.log('\n\nπŸ”§ TESTING SAMPLE WORDPRESS TOOLS\n'); console.log('-'.repeat(80)); const wpSampleTools = categories.wordpress.slice(0, 3); // Test first 3 for (const tool of wpSampleTools) { try { console.log(`\nπŸ”§ Testing: ${tool.name}`); console.log(` Description: ${tool.description || 'No description'}`); let testArgs = {}; if (tool.name.includes('list') || tool.name.includes('get')) { testArgs = { per_page: 5 }; } const result = await client.callTool({ name: tool.name, arguments: testArgs }); console.log(` βœ… Result: ${result.content[0].text.substring(0, 100)}...`); results.passed++; results.tools.push({ name: tool.name, status: 'passed' }); } catch (error) { console.log(` ❌ Error: ${error.message}`); results.failed++; results.tools.push({ name: tool.name, status: 'failed', error: error.message }); } results.total++; } // Print Summary console.log('\n' + '='.repeat(80)); console.log('πŸ“Š MCP SERVER TEST SUMMARY'); console.log('='.repeat(80)); console.log(`\nπŸ”§ Total Tools Available: ${toolsList.tools.length}`); console.log(`πŸ“‹ Tools Tested: ${results.total}`); console.log(`βœ… Passed: ${results.passed}`); console.log(`❌ Failed: ${results.failed}`); console.log(`Success Rate: ${results.total > 0 ? ((results.passed / results.total) * 100).toFixed(1) : 0}%`); console.log('\nπŸ“¦ Tool Distribution:'); console.log(` WordPress: ${categories.wordpress.length} tools`); console.log(` Elementor: ${categories.elementor.length} tools`); console.log(` File Operations: ${categories.file.length} tools`); console.log(` Configuration: ${categories.config.length} tools`); console.log(` Debugging: ${categories.debug.length} tools`); console.log('\n='.repeat(80)); if (results.failed === 0 && toolsList.tools.length >= 50) { console.log('πŸŽ‰ MCP SERVER IS FULLY FUNCTIONAL!'); console.log('πŸ”§ All systems operational, Elementurion! Ready to craft digital masterpieces! πŸ”§\n'); } else if (toolsList.tools.length < 50) { console.log('⚠️ MCP server has fewer tools than expected.'); console.log(' Expected: 60 tools'); console.log(` Found: ${toolsList.tools.length} tools`); console.log(' Check server configuration mode and environment variables.\n'); } else { console.log('⚠️ Some tests failed. Review the output above.\n'); } } catch (error) { console.error('\nπŸ’₯ Fatal error:', error.message); console.error(error.stack); } finally { if (client) { await client.close(); console.log('πŸ‘‹ Disconnected from MCP server.\n'); } } } // Run the test testMCPServer().catch(console.error);

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/mbrown1837/Ultimate-Elementor-MCP'

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