Skip to main content
Glama

Windows Automation MCP Server

browser_click

Automatically clicks web page elements using CSS selectors to perform browser interactions and automate web tasks through the Windows Automation MCP Server.

Instructions

点击元素

Input Schema

NameRequiredDescriptionDefault
selectorYesCSS 选择器
sessionIdNo会话 ID(可选)

Input Schema (JSON Schema)

{ "properties": { "selector": { "description": "CSS 选择器", "type": "string" }, "sessionId": { "description": "会话 ID(可选)", "type": "string" } }, "required": [ "selector" ], "type": "object" }

Implementation Reference

  • Executes the browser_click tool: waits for the CSS selector, clicks the element using Puppeteer page.click(), returns success or error.
    async click(selector, sessionId = 'default') { try { const page = this.pages.get(sessionId); if (!page) { return { success: false, error: '浏览器未启动' }; } await page.waitForSelector(selector, { timeout: 5000 }); await page.click(selector); return { success: true, selector, message: '点击成功' }; } catch (error) { return { success: false, error: error.message }; } }
  • Defines the input schema for browser_click tool: requires 'selector' (CSS selector), optional 'sessionId'.
    { name: 'browser_click', description: '点击元素', inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS 选择器' }, sessionId: { type: 'string', description: '会话 ID(可选)' }, }, required: ['selector'], }, },
  • src/server.js:43-52 (registration)
    Registers BrowserTools instance in the main tools object of the MCP server, enabling browser_click via getToolDefinitions() and executeTool().
    this.tools = { filesystem: new FileSystemTools(), process: new ProcessTools(), mouseKeyboard: new MouseKeyboardTools(), window: new WindowTools(), screen: new ScreenTools(), clipboard: new ClipboardTools(), powershell: new PowerShellTools(), browser: new BrowserTools(), };
  • src/server.js:97-101 (registration)
    Routes tool calls to the appropriate module (BrowserTools for browser_click) based on canHandle() check.
    for (const [category, toolModule] of Object.entries(this.tools)) { if (toolModule.canHandle(name)) { result = await toolModule.executeTool(name, args); break; }
  • src/server.js:23-23 (registration)
    Imports the BrowserTools class containing browser_click implementation.
    import { BrowserTools } from './tools/browser.js';

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/eva-wanxin-git/windows-automation-mcp'

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