sudo-elia/dom-analyzer-mcp
A simple dom mcp server analyzer made by AI
Platform-specific configuration:
{
"mcpServers": {
"dom-analyzer-mcp": {
"command": "npx",
"args": [
"-y",
"dom-analyzer-mcp"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
Il progetto dom-analyzer-mcp è un DOM Analyzer/E2E server MCP basato su Puppeteer per controllare un'app frontend in un URL configurabile.
server.ts---
File: config.json
Esempio:
{
"targetUrl": "http://localhost:4200",
"headless": true
}targetUrl: URL dell'app da esplorare (es. server dev locale)headless: booleano per avvio Puppeteer headless---
Variabili di stato globali:
browser: Browser (Puppeteer)page: Page (Puppeteer)networkRequests: {url, method, status?, response?}[]consoleErrors: string[]Core:
initBrowser(url = 'http://localhost:4200'): inizializza Puppeteer con retry, intercetta request/response.main(): avvia il server MCP, registra console errors e connette StdioServerTransport.---
take_screenshotScatta uno screenshot della pagina o elemento selezionato.
Input:
selector (opzionale): CSS selector dell'elemento.navigateTo (opzionale): URL da visitare prima di catturare.Output:
content con text e image (base64 PNG).---
read_domRestituisce l'HTML (outerHTML) del body o elemento specificato.
Input:
selector (opzionale): CSS selector.Output:
content[0].text = HTML.---
get_computed_stylesRecupera gli stili computati di un elemento.
Input:
selector (required)properties (array di string, opzionale)Output:
---
get_network_requestsLista chiamate HTTP intercettate.
Input:
filterUrl (opzionale)filterMethod (opzionale, GET/POST/PUT/DELETE/PATCH)limit (opzionale, default 50)Output:
---
execute_jsEsegue JS nella pagina e ritorna il risultato.
Input:
Loading reviews...