Logo Tauri MCP Server

Tauri MCP Server

Cộng đồng
dirvine

A server for testing and interacting with Tauri v2 applications, providing tools for process management, window manipulation, and debugging.

Nhà phát hànhdirvine
Kho mãtauri-mcp
Ngôn ngữRust
Bản fork
11
Sao
33
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Tauri MCP Server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    33 sao và 11 bản fork từ kho mã được liên kết.

Tauri MCP Server

A Model Context Protocol (MCP) server for testing and interacting with Tauri v2 applications. This tool enables AI assistants to better understand, debug, and interact with Tauri apps during development.

The MCP protocol provides a standardized way for AI assistants to interact with external tools and systems. This server implements the MCP specification to expose Tauri application testing and debugging capabilities.

MCP Compliance

This server is fully compliant with the Model Context Protocol specification. It implements:

  • ✅ JSON-RPC 2.0 transport over stdio
  • ✅ Initialize/shutdown handshake
  • ✅ Tools capability with 12 specialized Tauri testing tools
  • ✅ Proper error handling with descriptive messages
  • ✅ Tool schemas using JSON Schema format
  • ✅ Protocol version compatibility - Supports both "1.0" and date-based versions (e.g., "2024-11-05")

For more details about MCP:

Features

Core Tools

  • Process Management

    • launch_app - Launch Tauri applications with arguments
    • stop_app - Gracefully stop running apps
    • get_app_logs - Capture stdout/stderr output
    • monitor_resources - Track CPU, memory, and disk usage
  • Window Manipulation

    • take_screenshot - Capture app window screenshots
    • get_window_info - Get window dimensions, position, and state
  • Input Simulation

    • send_keyboard_input - Simulate keyboard input
    • send_mouse_click - Simulate mouse clicks
    • Mouse movement, dragging, and scrolling support
  • Debugging Tools

    • execute_js - Execute JavaScript in the webview
    • get_devtools_info - Get DevTools connection info
    • WebDriver integration for advanced testing
    • Console log capture
  • IPC Interaction

    • list_ipc_handlers - List registered Tauri commands
    • call_ipc_command - Call Tauri IPC commands
    • Event emission and listening

Installation

Using DXT (Recommended for Claude Desktop)

The easiest way to install tauri-mcp for use with Claude Desktop is via DXT (Desktop Extension):

  1. Download the latest tauri-mcp-node-*.dxt file from the releases page
  2. Double-click the .dxt file to install (or drag it onto Claude Desktop)
  3. The server will be automatically configured and ready to use

Note: Due to a known issue with Claude Desktop's DXT extraction, we provide a Node.js wrapper version (tauri-mcp-node-*.dxt) that works around this limitation.

Using Cargo

bash
cargo install tauri-mcp

Important Note for Rust-based MCP Servers: Claude Desktop currently has compatibility issues with Rust-based MCP servers, causing immediate disconnections after initialization. This is a known issue affecting all non-Node.js MCP servers. The cargo installation is suitable for:

  • Direct CLI usage
  • Integration with other tools
  • Development and testing

For use with Claude Desktop, please use the DXT package which includes a Node.js wrapper.

From Source

bash
# Clone the repository
git clone https://github.com/dirvine/tauri-mcp.git
cd tauri-mcp

# Build and install
cargo install --path .

Usage

As a Standalone Server

bash
# Start the MCP server
tauri-mcp serve

# With custom host and port
tauri-mcp serve --host 127.0.0.1 --port 3000

# With a specific Tauri app
tauri-mcp --app-path ./my-tauri-app

Configuration

Create a tauri-mcp.toml file for configuration:

toml
auto_discover = true
session_management = true
event_streaming = false
performance_profiling = false
network_interception = false

Environment Variables

  • TAURI_MCP_LOG_LEVEL - Set log level (trace, debug, info, warn, error)
  • TAURI_MCP_CONFIG - Path to config file (default: tauri-mcp.toml)

MCP Integration

Claude Desktop Configuration

Option 1: Using DXT Package (Recommended)

Install the tauri-mcp-node-*.dxt package by double-clicking it. The server will be automatically configured.

Option 2: Manual Configuration

If you need to configure manually or use the development version, add to your Claude Desktop configuration:

json
{
  "mcpServers": {
    "tauri-mcp": {
      "command": "node",
      "args": ["/path/to/tauri-mcp/server/index.js"],
      "env": {
        "TAURI_MCP_LOG_LEVEL": "info"
      }
    }
  }
}

Note: Direct Rust binary configuration ("command": "tauri-mcp") will not work with Claude Desktop due to compatibility issues. Use the Node.js wrapper approach shown above.

Available MCP Tools

All tools are exposed through the MCP protocol and can be called by AI assistants:

javascript
// Launch a Tauri app
await use_mcp_tool("tauri-mcp", "launch_app", {
  app_path: "/path/to/tauri-app",
  args: ["--debug"]
});

// Take a screenshot
await use_mcp_tool("tauri-mcp", "take_screenshot", {
  process_id: "uuid-here",
  output_path: "./screenshot.png"
});

// Execute JavaScript
await use_mcp_tool("tauri-mcp", "execute_js", {
  process_id: "uuid-here",
  javascript_code: "window.location.href"
});

// Send keyboard input
await use_mcp_tool("tauri-mcp", "send_keyboard_input", {
  process_id: "uuid-here",
  keys: "cmd+a"
});

Platform Support

  • macOS - Full support including window management
  • Windows - Full support with native window APIs
  • Linux - X11 support (Wayland in progress)

Development

Building

bash
# Debug build
cargo build

# Release build
cargo build --release

# Run tests
cargo test

Building DXT Packages

The project includes build scripts for creating DXT (Desktop Extension) packages for different platforms.

Prerequisites

  • Rust toolchain installed
  • Node.js 18+ (for the Node.js wrapper)
  • zip command available in PATH

Building on macOS/Linux

bash
# Build the Node.js wrapper version (recommended)
./build-dxt-node.sh

# The DXT package will be created as tauri-mcp-node-*.dxt

Building on Windows

powershell
# Create a Windows build script or use WSL
# Ensure you have zip.exe available or use PowerShell's Compress-Archive

# Build release binary
cargo build --release

# Create package directory structure
mkdir dxt-package-node
mkdir dxt-package-node\server

# Copy files
copy target\release\tauri-mcp.exe dxt-package-node\
copy server\*.* dxt-package-node\server\
copy manifest-node.json dxt-package-node\manifest.json

# Install Node dependencies
cd dxt-package-node\server
npm install --production
cd ..\..

# Create DXT archive (using PowerShell)
Compress-Archive -Path dxt-package-node\* -DestinationPath tauri-mcp-node.zip
Rename-Item tauri-mcp-node.zip tauri-mcp-node-0.1.8.dxt

DXT Package Structure

The DXT package includes:

  • manifest.json - Extension metadata and configuration
  • tauri-mcp - The compiled Rust binary
  • server/ - Node.js wrapper and dependencies
    • index.js - Node.js MCP server that spawns the Rust binary
    • package.json - Node.js dependencies
    • node_modules/ - MCP SDK and dependencies

Important Notes

  1. Use --no-dir-entries flag: When creating the zip file, use the --no-dir-entries flag to avoid extraction issues:

    bash
    zip -r package.dxt . --no-dir-entries
  2. Binary permissions: Ensure the Rust binary has executable permissions before packaging:

    bash
    chmod +x tauri-mcp
  3. Cross-platform builds: For distributing to other platforms, you'll need to build the Rust binary on each target platform or use cross-compilation.

Project Structure

tauri-mcp/
├── src/
│   ├── main.rs          # Entry point
│   ├── server.rs        # MCP server implementation
│   ├── tools/           # Tool implementations
│   │   ├── process.rs   # Process management
│   │   ├── window.rs    # Window manipulation
│   │   ├── input.rs     # Input simulation
│   │   ├── debug.rs     # Debugging tools
│   │   └── ipc.rs       # IPC interaction
│   └── utils/           # Utility modules
├── examples/            # Example Tauri apps
└── tests/              # Integration tests

Examples

Testing a Tauri App

bash
# Launch the server
tauri-mcp serve

# In your AI assistant:
# 1. Launch the app
# 2. Take a screenshot
# 3. Send some input
# 4. Check the logs
# 5. Stop the app

Automated Testing Script

python
import asyncio
from mcp import Client

async def test_tauri_app():
    client = Client("tauri-mcp")
    
    # Launch app
    result = await client.call_tool("launch_app", {
        "app_path": "./my-app",
        "args": ["--test-mode"]
    })
    process_id = result["process_id"]
    
    # Wait for app to start
    await asyncio.sleep(2)
    
    # Take screenshot
    await client.call_tool("take_screenshot", {
        "process_id": process_id,
        "output_path": "./test-screenshot.png"
    })
    
    # Send input
    await client.call_tool("send_keyboard_input", {
        "process_id": process_id,
        "keys": "Hello, Tauri!"
    })
    
    # Get logs
    logs = await client.call_tool("get_app_logs", {
        "process_id": process_id,
        "lines": 50
    })
    print("App logs:", logs)
    
    # Stop app
    await client.call_tool("stop_app", {
        "process_id": process_id
    })

asyncio.run(test_tauri_app())

Troubleshooting

Common Issues

  1. Permission Denied on macOS

    • Grant accessibility permissions in System Preferences
    • Required for input simulation
  2. Screenshot Fails

    • Ensure screen recording permissions are granted
    • Check if the app window is visible
  3. WebDriver Connection Failed

    • Ensure the Tauri app has DevTools enabled
    • Check if ChromeDriver is installed for WebDriver support

Debug Mode

Enable debug logging:

bash
TAURI_MCP_LOG_LEVEL=debug tauri-mcp serve

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Dùng MCP Tauri MCP Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Tauri MCP Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Tauri MCP Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Tauri MCP Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "tauri-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Tauri MCP Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Tauri MCP Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Tauri MCP Server giúp tôi làm việc này không?
Tauri MCP Server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Tauri MCP Server.

Câu hỏi thường gặp

Máy chủ MCP Tauri MCP Server dùng để làm gì?

Tauri MCP Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Tauri MCP Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Tauri MCP Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Tauri MCP Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Tauri MCP Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Tauri MCP Server với TypingMind?

Tauri MCP Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Tauri MCP Server cung cấp những công cụ nào trong TypingMind?

Tauri MCP Server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Tauri MCP Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Tauri MCP Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇