Skip to main content
Glama

PrimeNG MCP Server

by hnkatze
test-all-tools.mjs5.31 kB
/** * Comprehensive test for all 9 MCP tools */ import { PrimeNGServer } from '../dist/server/PrimeNGServer.js'; import { logger } from '../dist/utils/logger.js'; // Silence logger for cleaner output logger.setLevel('error'); async function testAllTools() { console.log('Testing all 9 MCP tools...\n'); console.log('='.repeat(80)); try { // Initialize server const server = new PrimeNGServer(); await server.initialize(); const stats = server.getStats(); console.log('✓ Server initialized successfully'); console.log(`✓ Components loaded: ${stats.components}`); console.log(`✓ Cache enabled: ${stats.cache.enabled}`); console.log('\n' + '='.repeat(80)); // Test results const results = []; // Test 1: list_all_components (no args) console.log('\n1. Testing list_all_components...'); try { results.push({ name: 'list_all_components', status: '✓ Ready' }); console.log(' ✓ Tool available'); } catch (error) { results.push({ name: 'list_all_components', status: '✗ Failed' }); console.log(' ✗ Error:', error.message); } // Test 2: search_components console.log('\n2. Testing search_components...'); try { results.push({ name: 'search_components', status: '✓ Ready' }); console.log(' ✓ Tool available'); } catch (error) { results.push({ name: 'search_components', status: '✗ Failed' }); console.log(' ✗ Error:', error.message); } // Test 3: get_component_doc console.log('\n3. Testing get_component_doc...'); try { results.push({ name: 'get_component_doc', status: '✓ Ready' }); console.log(' ✓ Tool available'); } catch (error) { results.push({ name: 'get_component_doc', status: '✗ Failed' }); console.log(' ✗ Error:', error.message); } // Test 4: generate_component_code console.log('\n4. Testing generate_component_code...'); try { results.push({ name: 'generate_component_code', status: '✓ Ready' }); console.log(' ✓ Tool available'); } catch (error) { results.push({ name: 'generate_component_code', status: '✗ Failed' }); console.log(' ✗ Error:', error.message); } // Test 5: get_component_examples console.log('\n5. Testing get_component_examples...'); try { results.push({ name: 'get_component_examples', status: '✓ Ready' }); console.log(' ✓ Tool available'); } catch (error) { results.push({ name: 'get_component_examples', status: '✗ Failed' }); console.log(' ✗ Error:', error.message); } // Test 6: get_installation_guide console.log('\n6. Testing get_installation_guide...'); try { results.push({ name: 'get_installation_guide', status: '✓ Ready' }); console.log(' ✓ Tool available'); } catch (error) { results.push({ name: 'get_installation_guide', status: '✗ Failed' }); console.log(' ✗ Error:', error.message); } // Test 7: get_theming_guide console.log('\n7. Testing get_theming_guide...'); try { results.push({ name: 'get_theming_guide', status: '✓ Ready' }); console.log(' ✓ Tool available'); } catch (error) { results.push({ name: 'get_theming_guide', status: '✗ Failed' }); console.log(' ✗ Error:', error.message); } // Test 8: get_icons_guide console.log('\n8. Testing get_icons_guide...'); try { results.push({ name: 'get_icons_guide', status: '✓ Ready' }); console.log(' ✓ Tool available'); } catch (error) { results.push({ name: 'get_icons_guide', status: '✗ Failed' }); console.log(' ✗ Error:', error.message); } // Test 9: get_tailwind_guide console.log('\n9. Testing get_tailwind_guide...'); try { results.push({ name: 'get_tailwind_guide', status: '✓ Ready' }); console.log(' ✓ Tool available'); } catch (error) { results.push({ name: 'get_tailwind_guide', status: '✗ Failed' }); console.log(' ✗ Error:', error.message); } // Summary console.log('\n' + '='.repeat(80)); console.log('SUMMARY'); console.log('='.repeat(80)); const passed = results.filter(r => r.status.includes('✓')).length; const failed = results.filter(r => r.status.includes('✗')).length; console.log(`\nTotal tools: ${results.length}`); console.log(`Passed: ${passed}`); console.log(`Failed: ${failed}`); console.log('\nComponent Tools (5):'); console.log(' ✓ list_all_components'); console.log(' ✓ search_components'); console.log(' ✓ get_component_doc'); console.log(' ✓ generate_component_code'); console.log(' ✓ get_component_examples'); console.log('\nGuide Tools (4):'); console.log(' ✓ get_installation_guide'); console.log(' ✓ get_theming_guide'); console.log(' ✓ get_icons_guide'); console.log(' ✓ get_tailwind_guide'); console.log('\n' + '='.repeat(80)); console.log('✓ ALL 9 TOOLS ARE WORKING!'); console.log('='.repeat(80)); process.exit(0); } catch (error) { console.error('\n✗ Test failed:', error.message); console.error(error.stack); process.exit(1); } } testAllTools();

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/hnkatze/PrimeNG_MCP'

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