Skip to main content
Glama
merajmehrabi

Puppeteer MCP Server

by merajmehrabi

puppeteer_hover

Simulate mouse hover interactions on web elements using CSS selectors to trigger dynamic content or reveal hidden menus during browser automation.

Instructions

Hover an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to hover

Implementation Reference

  • Handler implementation for the puppeteer_hover tool. Waits for the CSS selector to appear and then hovers over the element using Puppeteer's page.hover() method. Returns success or error message.
    case "puppeteer_hover": try { await page.waitForSelector(args.selector); await page.hover(args.selector); return { content: [{ type: "text", text: `Hovered ${args.selector}`, }], isError: false, }; } catch (error) { return { content: [{ type: "text", text: `Failed to hover ${args.selector}: ${(error as Error).message}`, }], isError: true, }; }
  • Tool schema definition specifying the name, description, and input schema requiring a CSS selector parameter.
    { name: "puppeteer_hover", description: "Hover an element on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to hover" }, }, required: ["selector"], }, },
  • src/server.ts:35-37 (registration)
    Server registration for listing available tools, including puppeteer_hover from the imported TOOLS array.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));
  • src/server.ts:39-41 (registration)
    Server registration for handling tool calls, delegating to handleToolCall which implements puppeteer_hover logic.
    server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}, state, server) );

Latest Blog Posts

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/merajmehrabi/puppeteer-mcp-server'

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