#!/usr/bin/env node
/**
* Interactive MCP Server Test
* Quick way to test your MCP server functionality
*/
import { execSync } from 'child_process';
import { readFileSync, writeFileSync, existsSync } from 'fs';
console.log('π§ͺ Google Business Profile Review MCP Server - Interactive Test\n');
// Ensure we're in mock mode
const envPath = '.env';
const envContent = `# Test Environment Configuration
NODE_ENV=development
ENABLE_MOCK_MODE=true
LOG_LEVEL=info
# Mock Google OAuth (required for config validation)
GOOGLE_CLIENT_ID=mock_client_id_for_testing
GOOGLE_CLIENT_SECRET=mock_client_secret_for_testing
GOOGLE_REDIRECT_URI=http://localhost:3000/auth/callback
# Server Configuration
PORT=3000
`;
console.log('π Setting up test environment...');
writeFileSync(envPath, envContent);
console.log('β
Created .env file with mock configuration\n');
// Build the project
console.log('π¨ Building project...');
try {
execSync('npm run build', { stdio: 'inherit' });
console.log('β
Build completed successfully\n');
} catch (error) {
console.error('β Build failed:', error.message);
process.exit(1);
}
// Run comprehensive tests
console.log('π§ͺ Running comprehensive test suite...');
try {
execSync('npm run test:dev', { stdio: 'inherit' });
console.log('\nβ
All tests passed!\n');
} catch (error) {
console.error('β Tests failed:', error.message);
process.exit(1);
}
console.log('π Your MCP Server is ready for testing!\n');
console.log('π Next Steps:');
console.log('==============');
console.log('1. π₯οΈ Test with Claude Desktop:');
console.log(' - Add server to Claude Desktop config');
console.log(' - Ask: "Can you list my business locations?"');
console.log('');
console.log('2. π Test with HTTP client:');
console.log(' npm run start:http');
console.log(' # Then use curl or Postman to test endpoints');
console.log('');
console.log('3. π§ Test with MCP Inspector:');
console.log(' npx @modelcontextprotocol/inspector node build/index.js');
console.log('');
console.log('4. π± Manual STDIO test:');
console.log(' npm run start:mock');
console.log(' # Server runs in STDIO mode for MCP clients');
console.log('');
console.log('π Mock Data Available:');
console.log('======================');
console.log('β
2 Business Locations');
console.log('β
5 Customer Reviews (1-5 stars)');
console.log('β
AI Reply Generation');
console.log('β
Review Sentiment Analysis');
console.log('β
Business Profile Information');
console.log('β
Response Templates');
console.log('');
console.log('π Test Commands You Can Try:');
console.log('=============================');
console.log('β’ "List all my business locations"');
console.log('β’ "Show me recent reviews for my coffee shop"');
console.log('β’ "Generate a reply to this review: Great coffee but slow service"');
console.log('β’ "What\'s the sentiment of this review: Terrible experience, won\'t return"');
console.log('β’ "Show me my business profile information"');
console.log('');
console.log('π Your Google Business Profile Review MCP Server is ready!');
console.log(' No Google API access required - everything runs with mock data!');