WDIO_MCP_TOOLS=code: a fixed code-mode tool set (session, navigate, snapshot, query_docs, run_code)

Aperta
#212 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start with the tool-set selection behind WDIO_MCP_TOOLS and the run_code opt-in (--allow-code / WDIO_MCP_RUN_CODE), then read docs/architecture/run-code-proposal.md for decision 4. Done means code lists only the five listed tools, and it fails at startup with a clear message when the run_code opt-in is missing. The mobile and Electron question is still open, so check with maintainers before deciding it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Target: feature/v5. Status: proposal. Depends on: #197 and its decision-4 eval (docs/architecture/run-code-proposal.md, on the docs/run-code-proposal branch). Ship only if the eval beats #203.

Idea. A fixed, small tool set for clients that drive the session with run_code (#197): WDIO_MCP_TOOLS=code lists only

Tool Role
start_session / close_session lifecycle
navigate load a page
snapshot search the page: refs, roles, names
query_docs search the WebdriverIO API
run_code execute: loops, waits, assertions; returns only what it prints

This is the same shape as Cloudflare's Code Mode: a search tool and an execute tool, both taking code, with a fixed footprint however many operations exist. Here, snapshot and query_docs already cover the search half. Today src/toolsets.ts:54 knows only WDIO_MCP_TOOLS=all, so this set is not implemented.

Measured on the run_code branch, not main (tools/list, WDIO_MCP_RUN_CODE=1). The default (17 tools, 18,095 characters) and the full set match main:

Tool set Definitions
Every tool (all, 42) 46,666 chars (~13k tokens)
Default (17) 18,095 chars (~5k tokens)
code (6) 10,273 chars (~3k tokens)

start_session is 5,134 of the 10,273, so #205 reduces this set further. The definitions aren't where most of the saving is. Most of it is intermediate data that stays in run_code instead of passing through the model, which this set makes the main path.

Needs

  • Refuse at startup. WDIO_MCP_TOOLS=code without --allow-code or WDIO_MCP_RUN_CODE fails at startup with a clear message. It must not silently list a set with no run_code.
  • enable_tools isn't listed. The set is fixed by design.
  • Open decision, before implementation: mobile and Electron. Should the set include get_elements and the gesture tools (tap_element, swipe, …) for mobile and Electron sessions? Gestures are reachable from run_code through WebdriverIO, but agents may still benefit from get_elements. Pick one and state it here.

How to judge it. Add it as its own case in the decision-4 eval (#197) and compare it with listing every tool for tool search (#203). Count tokens, turns, success, and how often the model's run_code calls fail.

Security. Same as run_code: opt-in, because the code runs in the server process. See webdriverio/webdriverio#16495 (opt-in restricted context) and webdriverio/webdriverio#16496 (isolation as a session feature).

Lingua principale
TypeScript
Stelle
45
Fork
20
Merge medio
2g 9h
PR unite (30g)
16

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di webdriverio/mcp

Tutte le issue di webdriverio/mcp

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.