Skip to main content
Glama

MCP & Copilot Studio Learning Project

by sayedpfe
  • Apple
  • Linux
day1-simple-test.js1.97 kB
#!/usr/bin/env node /** * Simple Test for Day 1 * Tests if your greeting tool works */ import { spawn } from 'child_process'; async function testBasicServer() { console.log('🧪 Day 1 Simple Test\n'); console.log('🚀 Starting your MCP server...'); // Start the server and check output const serverProcess = spawn('node', ['build/index.js'], { stdio: ['pipe', 'pipe', 'pipe'], cwd: process.cwd() }); let output = ''; let errorOutput = ''; serverProcess.stdout.on('data', (data) => { output += data.toString(); }); serverProcess.stderr.on('data', (data) => { errorOutput += data.toString(); console.log(data.toString().trim()); }); // Wait a moment for server to start await new Promise(resolve => setTimeout(resolve, 2000)); // Stop the server serverProcess.kill(); console.log('\n📊 Test Results:'); // Check if server started successfully if (errorOutput.includes('mcp-learning-server v1.0.0 running on stdio')) { console.log('✅ Server started successfully'); } else { console.log('❌ Server failed to start'); } // Check if greeting tool is mentioned if (errorOutput.includes('greeting')) { console.log('✅ Greeting tool detected'); } else { console.log('❌ Greeting tool not found'); } // Check for errors if (errorOutput.includes('Error') || errorOutput.includes('error')) { console.log('⚠️ Some errors detected - check the output above'); } else { console.log('✅ No errors detected'); } console.log('\n🎯 Next Steps:'); console.log('1. If all tests passed: Continue to Claude Desktop setup in Day 1 exercise'); console.log('2. If tests failed: Check your code in src/index.ts'); console.log('3. Run "npm run build" if you made changes'); } // Run the test testBasicServer().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/sayedpfe/MCP'

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