mcp-tauri-webdriver
v0.2.2
Published
Tauri WebDriver MCP Server
Maintainers
Readme
MCP Tauri WebDriver Server
A Model Context Protocol (MCP) server implementation for Tauri applications using tauri-driver, enabling desktop application automation through standardized MCP clients.
Attribution
This project is based on MCP Selenium Server by Angie Jones. The original codebase provided the foundation and MCP protocol implementation, which has been adapted for Tauri desktop application automation using tauri-driver.
Features
- Start Tauri application sessions with customizable options
- Navigate within applications
- Find elements using various locator strategies
- Click, type, and interact with elements
- Perform mouse actions (hover, drag and drop)
- Handle keyboard input
- Take screenshots
- Upload files
Prerequisites
Before using this MCP server, you need to install tauri-driver:
cargo install tauri-driver --lockedFor more information, see the tauri-driver documentation.
Use with other MCP clients (e.g. Claude Desktop, etc)
{
"mcpServers": {
"tauri": {
"command": "npx",
"args": ["-y", "mcp-tauri-webdriver"]
}
}
}Development
To work on this project:
- Clone the repository
- Install dependencies:
npm install - Run the server:
npm start
Installation
Manual Installation
npm install -g mcp-tauri-webdriverUsage
Start the server by running:
mcp-tauri-webdriverOr use with NPX in your MCP configuration:
{
"mcpServers": {
"tauri": {
"command": "npx",
"args": [
"-y",
"mcp-tauri-webdriver"
]
}
}
}Tools
start_app
Launches a Tauri application session.
Parameters:
app_path(required): Path to the Tauri application- Type: string
options: Application configuration options- Type: object
- Properties:
arguments: Additional application arguments- Type: array of strings
Example:
{
"tool": "start_app",
"parameters": {
"app_path": "/path/to/tauri/app",
"options": {
"arguments": ["--debug"]
}
}
}navigate
Navigates to a URL within the application.
Parameters:
url(required): URL to navigate to- Type: string
Example:
{
"tool": "navigate",
"parameters": {
"url": "https://localhost:1420/dashboard"
}
}find_element
Finds an element on the page.
Parameters:
by(required): Locator strategy- Type: string
- Enum: ["id", "css", "xpath", "name", "tag", "class"]
value(required): Value for the locator strategy- Type: string
timeout: Maximum time to wait for element in milliseconds- Type: number
- Default: 10000
Example:
{
"tool": "find_element",
"parameters": {
"by": "id",
"value": "search-input",
"timeout": 5000
}
}click_element
Clicks an element.
Parameters:
by(required): Locator strategy- Type: string
- Enum: ["id", "css", "xpath", "name", "tag", "class"]
value(required): Value for the locator strategy- Type: string
timeout: Maximum time to wait for element in milliseconds- Type: number
- Default: 10000
Example:
{
"tool": "click_element",
"parameters": {
"by": "css",
"value": ".submit-button"
}
}send_keys
Sends keys to an element (typing).
Parameters:
by(required): Locator strategy- Type: string
- Enum: ["id", "css", "xpath", "name", "tag", "class"]
value(required): Value for the locator strategy- Type: string
text(required): Text to enter into the element- Type: string
timeout: Maximum time to wait for element in milliseconds- Type: number
- Default: 10000
Example:
{
"tool": "send_keys",
"parameters": {
"by": "name",
"value": "username",
"text": "testuser"
}
}get_element_text
Gets the text() of an element.
Parameters:
by(required): Locator strategy- Type: string
- Enum: ["id", "css", "xpath", "name", "tag", "class"]
value(required): Value for the locator strategy- Type: string
timeout: Maximum time to wait for element in milliseconds- Type: number
- Default: 10000
Example:
{
"tool": "get_element_text",
"parameters": {
"by": "css",
"value": ".message"
}
}hover
Moves the mouse to hover over an element.
Parameters:
by(required): Locator strategy- Type: string
- Enum: ["id", "css", "xpath", "name", "tag", "class"]
value(required): Value for the locator strategy- Type: string
timeout: Maximum time to wait for element in milliseconds- Type: number
- Default: 10000
Example:
{
"tool": "hover",
"parameters": {
"by": "css",
"value": ".dropdown-menu"
}
}drag_and_drop
Drags an element and drops it onto another element.
Parameters:
by(required): Locator strategy for source element- Type: string
- Enum: ["id", "css", "xpath", "name", "tag", "class"]
value(required): Value for the source locator strategy- Type: string
targetBy(required): Locator strategy for target element- Type: string
- Enum: ["id", "css", "xpath", "name", "tag", "class"]
targetValue(required): Value for the target locator strategy- Type: string
timeout: Maximum time to wait for elements in milliseconds- Type: number
- Default: 10000
Example:
{
"tool": "drag_and_drop",
"parameters": {
"by": "id",
"value": "draggable",
"targetBy": "id",
"targetValue": "droppable"
}
}double_click
Performs a double click on an element.
Parameters:
by(required): Locator strategy- Type: string
- Enum: ["id", "css", "xpath", "name", "tag", "class"]
value(required): Value for the locator strategy- Type: string
timeout: Maximum time to wait for element in milliseconds- Type: number
- Default: 10000
Example:
{
"tool": "double_click",
"parameters": {
"by": "css",
"value": ".editable-text"
}
}right_click
Performs a right click (context click) on an element.
Parameters:
by(required): Locator strategy- Type: string
- Enum: ["id", "css", "xpath", "name", "tag", "class"]
value(required): Value for the locator strategy- Type: string
timeout: Maximum time to wait for element in milliseconds- Type: number
- Default: 10000
Example:
{
"tool": "right_click",
"parameters": {
"by": "css",
"value": ".context-menu-trigger"
}
}press_key
Simulates pressing a keyboard key.
Parameters:
key(required): Key to press (e.g., 'Enter', 'Tab', 'a', etc.)- Type: string
Example:
{
"tool": "press_key",
"parameters": {
"key": "Enter"
}
}upload_file
Uploads a file using a file input element.
Parameters:
by(required): Locator strategy- Type: string
- Enum: ["id", "css", "xpath", "name", "tag", "class"]
value(required): Value for the locator strategy- Type: string
filePath(required): Absolute path to the file to upload- Type: string
timeout: Maximum time to wait for element in milliseconds- Type: number
- Default: 10000
Example:
{
"tool": "upload_file",
"parameters": {
"by": "id",
"value": "file-input",
"filePath": "/path/to/file.pdf"
}
}take_screenshot
Captures a screenshot of the current page.
Parameters:
outputPath(optional): Path where to save the screenshot. If not provided, returns base64 data.- Type: string
Example:
{
"tool": "take_screenshot",
"parameters": {
"outputPath": "/path/to/screenshot.png"
}
}close_session
Closes the current application session and cleans up resources.
Parameters: None required
Example:
{
"tool": "close_session",
"parameters": {}
}License
MIT
