operagx-connector-plus

operagx-connector-plus

Adds real browser interaction (click, type, form fill, drag, scroll) to Opera GX via CDP, complementing the read-only OperaGX connector.

Category
访问服务器

README

operagx-connector-plus

CI npm version npm downloads Node.js >=18 License: MIT Open issues

An MCP server that adds real browser interaction — click, type, keyboard, form-fill, drag, scroll, select — on top of the read-only OperaGX connector (go-to-page, list-tabs, tab-content, screenshot, close-tab, history). Run both MCP servers side by side; this one doesn't replace the original, it fills the gap between "read the page" and "act on it."

Why the Chrome DevTools Protocol, not OS-level input

Two ways exist to make an agent actually click/type in a browser:

  1. OS-level hardware events (SendInput on Windows, robotjs, xdotool) — simulate input at the operating system, blind to window coordinates, steal the real mouse cursor, need the window focused and on-screen, and need OS accessibility permissions.
  2. Chrome DevTools Protocol (Input.dispatchMouseEvent / Input.dispatchKeyEvent) — simulates input inside the browser's own input pipeline. Indistinguishable from real hardware input to the page (unlike element.click()/dispatchEvent() in JS, which skip native browser behavior and are trivially detectable by sites), works in the background, doesn't touch the real OS cursor, and needs no extra OS permissions.

Since Opera GX is Chromium-based, it already speaks CDP. This server uses playwright-core purely as a typed CDP client (chromium.connectOverCDP) — no Playwright-managed browser is launched; it attaches to your existing, already-running Opera GX.

Install

npm install
npm run build

Requires Node.js 18+.

Setup

  1. Launch Opera GX with a remote debugging port. Add a flag to wherever you launch it from:

    --remote-debugging-port=9222
    

    This applies to a shortcut's target, a Run-at-login entry, or any launcher — see docs/enabling-cdp.md for exact steps on Windows (taskbar pin, Start Menu shortcut, autostart registry entry).

  2. Register the server with your MCP client. For the Claude Code CLI, at user scope (available in every project):

    claude mcp add operagx-connector-plus -s user \
      -e OPERAGX_CDP_URL=http://localhost:9222 \
      -- node /absolute/path/to/operagx-connector-plus/dist/index.js
    

    For other clients, the equivalent JSON config is:

    {
      "mcpServers": {
        "operagx-connector-plus": {
          "command": "node",
          "args": ["/absolute/path/to/operagx-connector-plus/dist/index.js"],
          "env": { "OPERAGX_CDP_URL": "http://localhost:9222" }
        }
      }
    }
    
  3. Also register the base OperaGX connector (screenshot, tab-content, go-to-page, ...) — this server is designed to complement it, not replace it. See the section below for the recommended combined workflow.

The interaction loop

This server pairs with the base connector's screenshot tool for visual grounding ("set-of-marks" style):

  1. operagx_map_elements — scans the DOM for clickable/fillable elements, returns each with a small integer id, role, text, and coordinates, and draws numbered badges on the live page.
  2. Call the base connector's screenshot tool — the badges let you visually confirm which numbered id is which element.
  3. operagx_click / operagx_type_text / operagx_fill_form / operagx_select_option / operagx_drag_and_drop / etc., addressed by elementId (preferred), a raw CSS selector, or absolute x/y coordinates.
  4. operagx_clear_annotations when done, so badges don't linger in future screenshots.

Tools

Tool Does Read-only Idempotent
operagx_list_tabs Enumerate tabs with a stable tabId usable by every other tool here ✅ ✅
operagx_map_elements Map clickable/fillable elements to numbered ids + coordinates, annotate the page ✅ —
operagx_clear_annotations Remove the numbered overlay badges — ✅
operagx_click Real CDP mouse click (left/right/middle, single/double/triple) — —
operagx_hover Move the mouse over an element/point — ✅
operagx_type_text Focus + type real per-character key events — —
operagx_press_key Send a key or chord (Enter, Control+A, ...) — —
operagx_fill_form Fill multiple fields in one call, optional submit key — —
operagx_select_option Choose a <select> option by value/label/index — ✅
operagx_drag_and_drop Real mouse-down → move → mouse-up drag — —
operagx_scroll Mouse-wheel scroll, or scroll an element into view — —
operagx_wait_for Wait for a selector to reach a state (visible/hidden/attached/detached) ✅ ✅

Every tool accepts an optional tab selector (tabId, tabIndex, matchUrl, matchTitle); omitting it defaults to the first open tab. Every tool also declares MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) and a structured outputSchema, so clients that support structuredContent get typed results, not just text.

Evaluations

evaluations/eval.xml has 10 read-only, verifiable QA pairs for testing whether an LLM can use this server effectively, following the MCP evaluation guidelines. Since this server deliberately has no navigation tool (that's the base connector's job), each question assumes both servers are available, exactly as described above.

Security notes

  • This server can act on whatever page is open — treat it like giving a script mouse/keyboard access to the browser. Don't point an autonomous agent at a tab with an authenticated session you don't want touched.
  • There is no execute-script/arbitrary-JS tool by design, to keep the attack surface to well-defined interaction primitives.
  • CDP is unauthenticated by default on localhost — don't expose the debugging port beyond localhost/a trusted network. This server binds outbound to whatever OPERAGX_CDP_URL you configure; it does not open any listening port itself.
  • All inputs are validated with Zod .strict() schemas before any tool executes.

Development

npm run dev     # tsc --watch
npm run build   # one-shot build to dist/
npx @modelcontextprotocol/inspector node dist/index.js   # interactive testing

Contributing

See CONTRIBUTING.md.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选