Skip to main content
Glama

Firefox MCP Server

by JediLuke
demo-tibia.js3.45 kB
#!/usr/bin/env node import { firefox } from 'playwright'; async function demoTibia() { console.log('🦎 Demo: Visiting tibia.com with Firefox automation...\n'); try { // Launch Firefox (visible so you can see it working) console.log('📱 Launching Firefox browser...'); const browser = await firefox.launch({ headless: false, slowMo: 1000 // Add delay to see actions }); const page = await browser.newPage(); console.log('🌐 Navigating to tibia.com...'); await page.goto('https://tibia.com', { waitUntil: 'networkidle' }); // Get basic page info console.log('📄 Getting page information...'); const title = await page.title(); const url = page.url(); console.log(`Title: ${title}`); console.log(`URL: ${url}\n`); // Take a screenshot console.log('📸 Taking screenshot...'); await page.screenshot({ path: 'tibia-demo.png', fullPage: false }); // Get page text content to describe what's visible console.log('👀 Analyzing page content...'); // Get main heading const mainHeadings = await page.$$eval('h1, h2', elements => elements.map(el => el.textContent.trim()).filter(text => text.length > 0) ); // Get navigation links const navLinks = await page.$$eval('nav a, .nav a, header a', elements => elements.map(el => el.textContent.trim()).filter(text => text.length > 0) ); // Get any prominent text/descriptions const paragraphs = await page.$$eval('p', elements => elements.map(el => el.textContent.trim()).filter(text => text.length > 20).slice(0, 3) ); console.log('\n=== TIBIA.COM CONTENT ANALYSIS ==='); if (mainHeadings.length > 0) { console.log('\n🏷️ Main Headings:'); mainHeadings.slice(0, 5).forEach(heading => console.log(` • ${heading}`)); } if (navLinks.length > 0) { console.log('\n🧭 Navigation Links:'); navLinks.slice(0, 8).forEach(link => console.log(` • ${link}`)); } if (paragraphs.length > 0) { console.log('\n📝 Content Snippets:'); paragraphs.forEach(para => console.log(` • ${para.substring(0, 100)}...`)); } // Check for any game-related content const gameElements = await page.$$eval('*', elements => { const keywords = ['download', 'play', 'game', 'character', 'world', 'premium', 'tibia']; return elements .map(el => el.textContent?.trim()) .filter(text => text && keywords.some(keyword => text.toLowerCase().includes(keyword) )) .filter(text => text.length > 10 && text.length < 100) .slice(0, 5); }); if (gameElements.length > 0) { console.log('\n🎮 Game-related Content:'); gameElements.forEach(element => console.log(` • ${element}`)); } console.log('\n📸 Screenshot saved as "tibia-demo.png"'); // Wait a bit so you can see the browser console.log('\n⏱️ Keeping browser open for 5 seconds so you can see it...'); await page.waitForTimeout(5000); console.log('🔒 Closing browser...'); await browser.close(); console.log('\n✅ Demo completed! The Firefox MCP server will work the same way once VSCode is restarted.'); } catch (error) { console.error('❌ Demo failed:', error.message); process.exit(1); } } demoTibia();

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/JediLuke/firefox-mcp-server'

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