feat: MCP Browser - servidor MCP para automação de navegador com Playwright

This commit is contained in:
2026-03-25 10:16:14 -03:00
commit c1d716bb84
24 changed files with 2803 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
const browser = require('../browser');
module.exports = async () => {
await browser.start();
const p = await browser.ensurePage();
const buttons = await p.evaluate(() => {
const elements = Array.from(document.querySelectorAll('button, input[type="submit"], input[type="button"], [role="button"], a.btn, a.button'));
return elements.map(el => ({
text: (el.innerText || el.value || el.getAttribute('aria-label') || '').trim(),
type: el.tagName.toLowerCase(),
id: el.id || null
})).filter(b => b.text !== '');
});
return {
success: true,
action: "get_buttons",
count: buttons.length,
buttons
};
};