press_key
Presses keyboard keys the typing tools can't express: Escape, Enter, Tab, arrows, Backspace/Delete, F-keys, and modifier chords (cmd+a). Emulates default actions (Enter submits, Tab moves focus) unless the app prevents them.
How to use it
press_key is exposed by the Tauri Plugin MCP MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the press_key tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
Install Tauri Plugin MCP
npx tauri-plugin-mcp-serverOther tools in Tauri Plugin MCP (18)
Calls helpers the host app registered via window.MCPBRIDGE.register(name, fn, description) — list to discover, call to invoke (async supported, results serialized + truncated). The sanctioned path to app state instead of executejs against internals.
Clicks via selector (ref, id, class, css, tag, text) or at raw x/y coordinates. Selector-based left clicks dispatch synthetic pointer events at the element (no OS permissions needed); right/middle/double and raw x/y clicks use native clicking. scopeselector/match/nth disambiguate repeated matches.
Synthetic pointer/mouse gesture chains (click, dblclick, down, up, hover, drag) on the exact matched element, no retargeting. Element-relative offset for canvas hit-testing; drags interpolate moves on the element and document (d3-drag compatible). Events are isTrusted=false.
Runs arbitrary JavaScript in the webview. Returns the last expression's value; promises are awaited. The universal escape hatch.
Bounding rect, computed styles (default layout/color set or explicit styleprops), classList and attributes — for visual/layout QA without executejs getComputedStyle snippets.
Inserts begin/end markers into the log buffer so querylogs can return exactly the logs produced by an action.
Tauri IPC access: invoke any #[tauri::command] with JSON args through the app's real IPC path, inspect captured webview↔Rust invoke traffic (names, args/result previews, latency, error rates), and drive events — emit fires one, armevent registers a background listener before you act (arm → act → che
localStorage operations (get/set/remove/clear/keys) and cookie management (get/clear).
Window control (list/focus/minimize/maximize/close/position/size/fullscreen), zoom, devtools, and webview state management.
Non-click mouse actions: hover, scroll (by direction/amount/to element/to top/bottom), drag (start to end coordinates).
Webview navigation: goto (URL), back/forward (with optional delta), reload.
Queries buffered app logs (Rust log!() output, webview console. calls, and intercepted dialogs) with level/source/substring filters, pagination, and a summary mode.
Inspects the current page. Modes: map (structured element refs), html (raw DOM), state (URL/title/scroll/viewport), findelement (CSS pixel coordinates for clicking), appinfo (app metadata, windows, monitors).
Reads visible text of elements matching a CSS selector: per-element {tag, text, visible, attrs?}, whitespace-collapsed, output hard-capped with a truncated flag. The structured replacement for executejs text-scraping snippets.
Restarts the Tauri application and waits for it to come back online. Force-kills a frozen app (IPC mode only). Refuses under tauri dev — restarting would orphan the app outside the dev supervisor; reload the frontend with navigate instead.
Captures a screenshot of an application window. Saves full image to disk with small thumbnail inline (optimized for token efficiency).
Types text into the page. Supports a fields array for bulk form fill, selector targeting, or typing into the focused element. Selects options in <select> dropdowns by value or label, and attaches files to <input type="file"> via a files array. Works with inputs, textareas, contentEditable, React, Le
Waits for a condition: text appearing/disappearing, element visible/hidden/attached/detached. Useful after async content loads.