import { chromium } from 'playwright';
async function deployToSmitery() {
const browser = await chromium.launch({ headless: false });
const context = await browser.newContext();
const page = await context.newPage();
try {
console.log('Step 1: Navigating to Smithery.ai...');
await page.goto('https://smithery.ai/', { waitUntil: 'networkidle' });
await page.waitForTimeout(3000);
// Take screenshot of homepage
await page.screenshot({ path: '/tmp/smithery_homepage.png' });
console.log('Screenshot saved: /tmp/smithery_homepage.png');
// Check login status
const loginButton = await page.$('text=Login');
const userAvatar = await page.$('[data-testid="user-avatar"]') || await page.$('.user-avatar') || await page.$('[class*="avatar"]');
if (loginButton && !userAvatar) {
console.log('Not logged in, attempting to login...');
await loginButton.click();
await page.waitForTimeout(2000);
await page.screenshot({ path: '/tmp/smithery_login.png' });
console.log('Login page screenshot saved: /tmp/smithery_login.png');
// Wait for manual login or automated login
await page.waitForURL('**/smithery.ai/**', { timeout: 60000 });
}
console.log('Step 2: Deploying wuolah-mcp...');
await page.goto('https://smithery.ai/new', { waitUntil: 'networkidle' });
await page.waitForTimeout(2000);
await page.screenshot({ path: '/tmp/smithery_new_deployment.png' });
// Look for Deploy Server button
const deployButton = await page.$('text=Deploy Server') || await page.$('[data-testid="deploy-server"]');
if (deployButton) {
await deployButton.click();
await page.waitForTimeout(2000);
}
// Select GitHub repository
const githubOption = await page.$('text=GitHub') || await page.$('[data-testid="github-option"]');
if (githubOption) {
await githubOption.click();
await page.waitForTimeout(1000);
}
// Look for repository input or selection
const repoInput = await page.$('input[placeholder*="repository"]') || await page.$('input[name="repository"]');
if (repoInput) {
await repoInput.fill('samihalawa/wuolah-mcp');
await page.waitForTimeout(1000);
}
// Look for wuolah-mcp repository option
const wuolahRepo = await page.$('text=wuolah-mcp') || await page.$('[data-testid="wuolah-mcp"]');
if (wuolahRepo) {
await wuolahRepo.click();
await page.waitForTimeout(1000);
}
await page.screenshot({ path: '/tmp/smithery_wuolah_deploy.png' });
console.log('Wuolah-mcp deployment screenshot saved: /tmp/smithery_wuolah_deploy.png');
// Click final Deploy button
const finalDeployButton = await page.$('button:has-text("Deploy")') || await page.$('[data-testid="deploy-button"]');
if (finalDeployButton) {
await finalDeployButton.click();
await page.waitForTimeout(5000);
}
await page.screenshot({ path: '/tmp/smithery_wuolah_deployed.png' });
console.log('Wuolah-mcp deployment result screenshot saved: /tmp/smithery_wuolah_deployed.png');
console.log('Step 3: Deploying huggingface-mcp...');
await page.goto('https://smithery.ai/new', { waitUntil: 'networkidle' });
await page.waitForTimeout(2000);
// Repeat process for huggingface-mcp
const deployButton2 = await page.$('text=Deploy Server') || await page.$('[data-testid="deploy-server"]');
if (deployButton2) {
await deployButton2.click();
await page.waitForTimeout(2000);
}
const githubOption2 = await page.$('text=GitHub') || await page.$('[data-testid="github-option"]');
if (githubOption2) {
await githubOption2.click();
await page.waitForTimeout(1000);
}
const repoInput2 = await page.$('input[placeholder*="repository"]') || await page.$('input[name="repository"]');
if (repoInput2) {
await repoInput2.fill('samihalawa/huggingface-mcp');
await page.waitForTimeout(1000);
}
const huggingfaceRepo = await page.$('text=huggingface-mcp') || await page.$('[data-testid="huggingface-mcp"]');
if (huggingfaceRepo) {
await huggingfaceRepo.click();
await page.waitForTimeout(1000);
}
await page.screenshot({ path: '/tmp/smithery_huggingface_deploy.png' });
console.log('Huggingface-mcp deployment screenshot saved: /tmp/smithery_huggingface_deploy.png');
const finalDeployButton2 = await page.$('button:has-text("Deploy")') || await page.$('[data-testid="deploy-button"]');
if (finalDeployButton2) {
await finalDeployButton2.click();
await page.waitForTimeout(5000);
}
await page.screenshot({ path: '/tmp/smithery_huggingface_deployed.png' });
console.log('Huggingface-mcp deployment result screenshot saved: /tmp/smithery_huggingface_deployed.png');
console.log('Step 4: Verifying deployments...');
await page.goto('https://smithery.ai/server/@samihalawa/wuolah-mcp', { waitUntil: 'networkidle' });
await page.waitForTimeout(2000);
await page.screenshot({ path: '/tmp/smithery_wuolah_status.png' });
await page.goto('https://smithery.ai/server/@samihalawa/huggingface-mcp', { waitUntil: 'networkidle' });
await page.waitForTimeout(2000);
await page.screenshot({ path: '/tmp/smithery_huggingface_status.png' });
console.log('All deployment steps completed!');
} catch (error) {
console.error('Error during deployment:', error);
await page.screenshot({ path: '/tmp/smithery_error.png' });
} finally {
await browser.close();
}
}
deployToSmitery().catch(console.error);