We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rudedoggg/DadJokeVisualizer'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
#!/usr/bin/env node
/**
* Test script for the Dad Joke Visualizer MCP Server
* This script tests the individual components without running the full MCP server
*/
import dotenv from 'dotenv';
import { generateDadJoke } from './dist/tools/jokeGenerator.js';
import { generateImage } from './dist/tools/imageGenerator.js';
import { createWebPage, startWebServer } from './dist/tools/webPageCreator.js';
dotenv.config();
async function testComponents() {
console.log('π§ͺ Testing Dad Joke Visualizer Components...\n');
try {
// Test 1: Generate a Dad Joke (now built-in, no API key needed!)
console.log('1οΈβ£ Testing Built-in Dad Joke Generation...');
const joke = await generateDadJoke('programming');
console.log(`β
Generated joke: "${joke}"\n`);
// Test 2: Generate Image (will use fallback placeholder if API key not available)
console.log('2οΈβ£ Testing Image Generation...');
const imageUrl = await generateImage(joke);
console.log(`β
Generated image URL: ${imageUrl}\n`);
// Test 3: Start Web Server
console.log('3οΈβ£ Testing Web Server...');
await startWebServer();
console.log('β
Web server started successfully\n');
// Test 4: Create Web Page
console.log('4οΈβ£ Testing Web Page Creation...');
const pageUrl = await createWebPage(joke, imageUrl);
console.log(`β
Created web page: ${pageUrl}\n`);
console.log('π All tests passed! Your Dad Joke Visualizer is ready to use.');
console.log(`\nπ Visit the web interface at: http://localhost:${process.env.PORT || 3000}`);
console.log(`π View your test joke at: ${pageUrl}`);
console.log('\nπ Note: No external API keys required! Dad jokes are built-in! πͺ');
} catch (error) {
console.error('β Test failed:', error);
process.exit(1);
}
}
// Run tests if this script is executed directly
if (import.meta.url === `file://${process.argv[1]}`) {
testComponents();
}