#!/usr/bin/env node
import { chromium } from 'playwright';
import fs from 'fs';
import path from 'path';
const screenshotsDir = './screenshots';
if (!fs.existsSync(screenshotsDir)) {
fs.mkdirSync(screenshotsDir, { recursive: true });
}
async function deployToSmitery() {
console.log('š Starting Smithery.ai deployment with manual intervention...');
const browser = await chromium.launch({
headless: false,
slowMo: 2000,
args: ['--no-sandbox', '--disable-setuid-sandbox']
});
const context = await browser.newContext({
viewport: { width: 1920, height: 1080 }
});
const page = await context.newPage();
try {
// Step 1: Navigate to Smithery.ai homepage
console.log('š Step 1: Navigating to Smithery.ai homepage...');
await page.goto('https://smithery.ai/', {
waitUntil: 'networkidle',
timeout: 30000
});
await page.waitForTimeout(3000);
await page.screenshot({ path: path.join(screenshotsDir, 'final_step1_homepage.png') });
console.log('ā
Homepage loaded, screenshot saved');
// Step 2: Click Deploy Server button
console.log('š Step 2: Clicking Deploy Server button...');
const deployServerButton = await page.waitForSelector('text=Deploy Server', { timeout: 10000 });
await deployServerButton.click();
await page.waitForTimeout(5000);
await page.screenshot({ path: path.join(screenshotsDir, 'final_step2_deploy_page.png') });
console.log('ā
Deploy page loaded, screenshot saved');
// Step 3: Authenticate with GitHub
console.log('š Step 3: Authenticating with GitHub...');
const continueWithGitHub = await page.waitForSelector('text=Continue with GitHub', { timeout: 10000 });
await continueWithGitHub.click();
console.log('ā³ Waiting for GitHub authentication...');
console.log('š¤ Please complete GitHub authentication in the browser window');
// Wait for user to complete authentication
await page.waitForTimeout(60000); // 60 seconds for auth
// Take screenshot after auth
await page.screenshot({ path: path.join(screenshotsDir, 'final_step3_post_auth.png') });
console.log('ā
Post-authentication screenshot saved');
// Step 4: Deploy wuolah-mcp
console.log('š Step 4: Deploying wuolah-mcp...');
// Navigate to deployment page
await page.goto('https://smithery.ai/new', {
waitUntil: 'networkidle',
timeout: 30000
});
await page.waitForTimeout(3000);
// Wait for and fill repository input
console.log('š Filling repository input for wuolah-mcp...');
const repoInput1 = await page.waitForSelector('input[type="text"]', { timeout: 10000 });
await repoInput1.fill('samihalawa/wuolah-mcp');
await page.waitForTimeout(2000);
// Press Enter or click deploy
console.log('š Initiating deployment...');
await page.keyboard.press('Enter');
await page.waitForTimeout(10000);
await page.screenshot({ path: path.join(screenshotsDir, 'final_step4_wuolah_deployed.png') });
console.log('ā
wuolah-mcp deployment screenshot saved');
// Step 5: Deploy huggingface-mcp
console.log('š Step 5: Deploying huggingface-mcp...');
// Navigate to fresh deployment page
await page.goto('https://smithery.ai/new', {
waitUntil: 'networkidle',
timeout: 30000
});
await page.waitForTimeout(3000);
// Fill repository input
console.log('š Filling repository input for huggingface-mcp...');
const repoInput2 = await page.waitForSelector('input[type="text"]', { timeout: 10000 });
await repoInput2.fill('samihalawa/huggingface-mcp');
await page.waitForTimeout(2000);
// Press Enter or click deploy
console.log('š Initiating deployment...');
await page.keyboard.press('Enter');
await page.waitForTimeout(10000);
await page.screenshot({ path: path.join(screenshotsDir, 'final_step5_huggingface_deployed.png') });
console.log('ā
huggingface-mcp deployment screenshot saved');
// Step 6: Verify deployments
console.log('š Step 6: Verifying deployments...');
const repos = [
{ name: 'wuolah-mcp', url: 'https://smithery.ai/server/@samihalawa/wuolah-mcp' },
{ name: 'huggingface-mcp', url: 'https://smithery.ai/server/@samihalawa/huggingface-mcp' }
];
const verificationResults = [];
for (const repo of repos) {
console.log(`š Verifying ${repo.name}...`);
try {
const response = await page.goto(repo.url, {
waitUntil: 'networkidle',
timeout: 30000
});
await page.waitForTimeout(5000);
const pageContent = await page.content();
const isSuccess = !pageContent.includes('404') && !pageContent.includes('Not Found');
await page.screenshot({ path: path.join(screenshotsDir, `final_verify_${repo.name}.png`) });
verificationResults.push({
name: repo.name,
url: repo.url,
status: isSuccess ? 'SUCCESS' : 'FAILED',
statusCode: response.status()
});
console.log(`${isSuccess ? 'ā
' : 'ā'} ${repo.name}: ${isSuccess ? 'DEPLOYED' : 'FAILED'}`);
} catch (error) {
console.log(`ā Error verifying ${repo.name}:`, error.message);
verificationResults.push({
name: repo.name,
url: repo.url,
status: 'ERROR',
error: error.message
});
}
}
// Generate comprehensive report
const finalReport = {
timestamp: new Date().toISOString(),
process: 'Smithery.ai MCP Server Deployment',
repositories: [
'samihalawa/wuolah-mcp',
'samihalawa/huggingface-mcp'
],
verificationResults: verificationResults,
deploymentUrls: {
wuolah: 'https://smithery.ai/server/@samihalawa/wuolah-mcp',
huggingface: 'https://smithery.ai/server/@samihalawa/huggingface-mcp'
},
summary: {
totalRepositories: 2,
successfulDeployments: verificationResults.filter(r => r.status === 'SUCCESS').length,
failedDeployments: verificationResults.filter(r => r.status !== 'SUCCESS').length,
screenshotsCaptured: 8,
deploymentComplete: verificationResults.filter(r => r.status === 'SUCCESS').length === 2
}
};
// Save report
fs.writeFileSync('./smithery_final_deployment_report.json', JSON.stringify(finalReport, null, 2));
console.log('\\nš DEPLOYMENT PROCESS COMPLETE!');
console.log('=====================================');
console.log(`š Summary:`);
console.log(` Total repositories: ${finalReport.summary.totalRepositories}`);
console.log(` Successful deployments: ${finalReport.summary.successfulDeployments}`);
console.log(` Failed deployments: ${finalReport.summary.failedDeployments}`);
console.log(` Screenshots captured: ${finalReport.summary.screenshotsCaptured}`);
console.log('');
console.log('š Deployment Results:');
verificationResults.forEach(result => {
console.log(` ${result.name}: ${result.status}`);
console.log(` URL: ${result.url}`);
if (result.statusCode) {
console.log(` Status Code: ${result.statusCode}`);
}
console.log('');
});
console.log('š Full report saved to: smithery_final_deployment_report.json');
console.log('šø All screenshots saved to: ./screenshots/');
} catch (error) {
console.error('š„ Error during deployment:', error);
await page.screenshot({ path: path.join(screenshotsDir, 'final_error.png') });
} finally {
console.log('\\nā³ Keeping browser open for manual verification...');
console.log('š Please verify the deployments manually in the browser');
console.log('āØļø Press Ctrl+C to close when ready');
// Keep browser open for manual verification
await page.waitForTimeout(120000); // 2 minutes
await browser.close();
}
}
deployToSmitery().catch(console.error);