import { chromium } from 'playwright';
async function deployAfterAuth() {
console.log('Starting deployment after authentication...');
const browser = await chromium.launch({
headless: false,
slowMo: 1000
});
const context = await browser.newContext();
const page = await context.newPage();
try {
// Navigate to the deployment page
console.log('Navigating to deployment page...');
await page.goto('https://smithery.ai/new', { waitUntil: 'networkidle' });
await page.waitForTimeout(3000);
// Take screenshot of current state
await page.screenshot({ path: './screenshots/step1_deployment_page.png' });
console.log('Screenshot saved: ./screenshots/step1_deployment_page.png');
// Check if "Continue with GitHub" button exists (not authenticated)
const githubButton = await page.$('text=Continue with GitHub');
if (githubButton) {
console.log('\\n=== AUTHENTICATION REQUIRED ===');
console.log('Please click "Continue with GitHub" to authenticate');
console.log('Then return to this terminal and press Enter to continue...');
// Wait for user input
await new Promise(resolve => {
process.stdin.once('data', () => {
resolve();
});
});
// Wait for navigation after authentication
await page.waitForTimeout(5000);
await page.screenshot({ path: './screenshots/step2_after_auth.png' });
console.log('Screenshot saved: ./screenshots/step2_after_auth.png');
}
// Deploy wuolah-mcp
console.log('\\n=== DEPLOYING WUOLAH-MCP ===');
// Look for repository input or GitHub connect button
const repoInput = await page.$('input[placeholder*="repository"]') ||
await page.$('input[name="repository"]') ||
await page.$('input[type="text"]');
if (repoInput) {
console.log('Found repository input, entering wuolah-mcp...');
await repoInput.click();
await repoInput.fill('samihalawa/wuolah-mcp');
await page.waitForTimeout(2000);
// Look for deploy button
const deployButton = await page.$('button:has-text("Deploy")') ||
await page.$('button:has-text("Create")') ||
await page.$('[data-testid="deploy-button"]');
if (deployButton) {
console.log('Clicking deploy button...');
await deployButton.click();
await page.waitForTimeout(5000);
await page.screenshot({ path: './screenshots/step3_wuolah_deploying.png' });
console.log('Screenshot saved: ./screenshots/step3_wuolah_deploying.png');
// Wait for deployment to complete
console.log('Waiting for deployment to complete...');
await page.waitForTimeout(10000);
await page.screenshot({ path: './screenshots/step4_wuolah_deployed.png' });
console.log('Screenshot saved: ./screenshots/step4_wuolah_deployed.png');
}
}
// Navigate to new deployment page for second repo
console.log('\\n=== DEPLOYING HUGGINGFACE-MCP ===');
await page.goto('https://smithery.ai/new', { waitUntil: 'networkidle' });
await page.waitForTimeout(3000);
const repoInput2 = await page.$('input[placeholder*="repository"]') ||
await page.$('input[name="repository"]') ||
await page.$('input[type="text"]');
if (repoInput2) {
console.log('Found repository input, entering huggingface-mcp...');
await repoInput2.click();
await repoInput2.fill('samihalawa/huggingface-mcp');
await page.waitForTimeout(2000);
const deployButton2 = await page.$('button:has-text("Deploy")') ||
await page.$('button:has-text("Create")') ||
await page.$('[data-testid="deploy-button"]');
if (deployButton2) {
console.log('Clicking deploy button...');
await deployButton2.click();
await page.waitForTimeout(5000);
await page.screenshot({ path: './screenshots/step5_huggingface_deploying.png' });
console.log('Screenshot saved: ./screenshots/step5_huggingface_deploying.png');
// Wait for deployment to complete
console.log('Waiting for deployment to complete...');
await page.waitForTimeout(10000);
await page.screenshot({ path: './screenshots/step6_huggingface_deployed.png' });
console.log('Screenshot saved: ./screenshots/step6_huggingface_deployed.png');
}
}
// Verify deployments
console.log('\\n=== VERIFYING DEPLOYMENTS ===');
// Check wuolah-mcp
console.log('Checking wuolah-mcp deployment...');
await page.goto('https://smithery.ai/server/@samihalawa/wuolah-mcp', { waitUntil: 'networkidle' });
await page.waitForTimeout(3000);
await page.screenshot({ path: './screenshots/step7_wuolah_status.png' });
console.log('Screenshot saved: ./screenshots/step7_wuolah_status.png');
// Check huggingface-mcp
console.log('Checking huggingface-mcp deployment...');
await page.goto('https://smithery.ai/server/@samihalawa/huggingface-mcp', { waitUntil: 'networkidle' });
await page.waitForTimeout(3000);
await page.screenshot({ path: './screenshots/step8_huggingface_status.png' });
console.log('Screenshot saved: ./screenshots/step8_huggingface_status.png');
console.log('\\n=== DEPLOYMENT COMPLETE ===');
console.log('All screenshots saved in ./screenshots/');
console.log('Check the status screenshots to verify successful deployment.');
} catch (error) {
console.error('Error during deployment:', error);
await page.screenshot({ path: './screenshots/error_deployment.png' });
} finally {
console.log('Deployment process finished. Press Enter to close browser...');
await new Promise(resolve => {
process.stdin.once('data', () => {
resolve();
});
});
await browser.close();
}
}
deployAfterAuth().catch(console.error);