# mcp-tauri-automation
## 基本信息
- Slug: `radek44-mcp-tauri-automation`
- Source: modelscope
- Publisher: @Radek44/mcp-tauri-automation
- Categories: testing-and-qa-tools / app-automation
- Hosted: No
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@Radek44/mcp-tauri-automation
## 简介
暂无描述。
## 安装提示

```bash
cargo install tauri-driver ``` **2. Install this MCP server**
```

## MCP Server 详情

# MCP Tauri Automation

> **Automate Tauri desktop apps with AI.** An MCP server that lets Claude Code test, debug, and interact with your Tauri applications through natural language.

## What is this?

Testing Tauri apps usually means:
-  Manually clicking through UIs for every change
-  Writing complex test scripts for simple interactions
-  Taking screenshots manually to debug visual issues
-  Switching between code editor and running app constantly

With this MCP server:
-  Ask Claude to "click the submit button and check the result"
-  Get instant screenshots of your app state
-  Test UI flows through natural language
-  Automate repetitive testing while you code

## Quick Start

**1. Install tauri-driver**
```bash
cargo install tauri-driver
```

**2. Install this MCP server**
```bash
git clone <repo-url>
cd mcp-tauri-automation
npm install && npm run build
```

**3. Add to your MCP config**

<details>
<summary><b>Claude Code (Recommended)</b></summary>

Use the Claude Code CLI to register the server:

```bash
# Simplest setup - works with any Tauri app
# (you'll specify which app to launch when you ask Claude)
claude mcp add --transport stdio tauri-automation \
  --scope user \
  -- node /absolute/path/to/mcp-tauri-automation/dist/index.js
```

Replace `/absolute/path/to/mcp-tauri-automation` with the actual path where you cloned this repo. For example:
- Linux/macOS: `~/projects/mcp-tauri-automation/dist/index.js`
- Windows: `C:/Users/YourName/projects/mcp-tauri-automation/dist/index.js`

**Optional: Set a default app path**

If you mainly work with one Tauri app, you can set it as the default:

```bash
claude mcp add --transport stdio tauri-automation \
  --env TAURI_APP_PATH=/path/to/your-app/src-tauri/target/debug/your-app \
  --scope user \
  -- node /absolute/path/to/mcp-tauri-automation/dist/index.js
```

> ** Can I test multiple apps?** Yes! The `TAURI_APP_PATH` is just a convenience default. You can still launch any other Tauri app by specifying its path when you ask Claude (e.g., "Launch my calculator app at ~/projects/calculator-app/target/debug/calculator").

**Advanced: Customize defaults**

```bash
claude mcp add --transport stdio tauri-automation \
  --env TAURI_SCREENSHOT_DIR=./my-screenshots \
  --env TAURI_DEFAULT_TIMEOUT=10000 \
  --scope user \
  -- node /absolute/path/to/mcp-tauri-automation/dist/index.js
```

All environment variables have sensible defaults and are optional:
- `TAURI_APP_PATH`: No default (specify when launching, or set here for convenience)
- `TAURI_SCREENSHOT_DIR`: `./screenshots` (relative to where you run Claude Code)
- `TAURI_WEBDRIVER_PORT`: `4444` (where tauri-driver listens)
- `TAURI_DEFAULT_TIMEOUT`: `5000` ms (how long to wait for UI elements)

**Managing servers:**
```bash
# List all configured servers
claude mcp list

# Get details for a specific server
claude mcp get tauri-automation

# Remove a server
claude mcp remove tauri-automation

# Inside Claude Code, check server status
/mcp
```

**Alternative: JSON format**

<details>
<summary>Click to see JSON configuration format</summary>

```bash
claude mcp add-json tauri-automation '{
  "type": "stdio",
  "command": "node",
  "args": ["/absolute/path/to/mcp-tauri-automation/dist/index.js"],
  "env": {
    "TAURI_APP_PATH": "/optional/default/app/path"
  }
}'
```

</details>

**Scope options:**
- `--scope user`: Available to you across all projects (recommended)
- `--scope local` (default): Available only to you in the current project
- `--scope project`: Shared with everyone in the project via `.mcp.json` file

</details>

<details>
<summary><b>Claude Desktop</b></summary>

Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "tauri-automation": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-tauri-automation/dist/index.js"]
    }
  }
}
```

**Optional: Add environment variables**

```json
{
  "mcpServers": {
    "tauri-automation": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-tauri-automation/dist/index.js"],
      "env": {
        "TAURI_APP_PATH": "/path/to/your/default/app"
      }
    }
  }
}
```

</details>

<details>
<summary><b>Claude Code (Manual Config)</b></summary>

Edit `~/.config/claude-code/mcp_config.json`:

```json
{
  "mcpServers": {
    "tauri-automation": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-tauri-automation/dist/index.js"]
    }
  }
}
```

**Optional: Add environment variables**

```json
{
  "mcpServers": {
    "tauri-automation": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-tauri-automation/dist/index.js"],
      "env": {
        "TAURI_APP_PATH": "/path/to/your/default/app"
      }
    }
  }
}
```

**Note**: Using the `claude mcp add` command (see "Claude Code (Recommended)" above) is easier and less error-prone than manual editing.

</details>

<details>
<summary><b>Other MCP Clients</b></summary>

Any MCP client that supports stdio transport can use this server. Pass the environment variables via the client's configuration mechanism.

</details>

**4. Start tauri-driver**

Before using the MCP server, start `tauri-driver` in a separate terminal:

```bash
# In a separate terminal, keep this running
tauri-driver
```

> **Why is tauri-driver separate?**
>
> `tauri-driver` is a standalone WebDriver server that controls Tauri apps. Keeping it separate means:
> -  You can restart your MCP server without losing app state
> -  Multiple tools can connect to the same driver instance
> -  It runs on a known port (4444) that's easy to configure
>
> **Future improvement**: This MCP server could be enhanced to auto-start tauri-driver if it's not running. Interested in contributing? See [Contributing](#development) below!

**5. Use with Claude**
```
Launch my Tauri app, click the "Start" button, and take a screenshot
```

Or if you didn't set a default app path:
```
Launch my calculator app at ~/projects/calculator/target/debug/calculato…

