Building for Desktop OS
Relevant source files
The following files were used as context for generating this wiki page:
Building the Agent Studio MCP Engine for desktop operating systems involves using the Tauri v2 framework to package a Vite-based web application into native executables. The process generates installers for Windows (x64 and ARM64) and macOS (Intel, Apple Silicon, and Universal).
This system integrates a React frontend with a Rust-based backend to provide local filesystem access and Model Context Protocol (MCP) tool support. The build pipeline transforms web assets into .msi, .exe, .dmg, or .app formats depending on the target platform.
Sources: BUILDING.md:1-12, src-tauri/tauri.conf.json:7-13
Environment Prerequisites
Specific toolchains are required to compile the Rust core and the TypeScript frontend.
- Node.js: Requires version 18 or higher (v24.18.0 is verified).
- Rust: Installed via
rustup. Windows users require Visual Studio C++ Build Tools, while macOS users require Xcode Command Line Tools. - Package Manager:
npmversion 9 or higher is used for dependency management and script execution.
Sources: BUILDING.md:16-25, package.json:44-60
Build Configuration
The desktop application is configured via tauri.conf.json. This file defines the window properties, security settings, and bundle targets.
Desktop Window Properties
| Property | Value | Description |
|---|---|---|
| Product Name | Agent Studio | The display name of the application. |
| Width | 1280 | Initial window width. |
| Height | 800 | Initial window height. |
| Resizable | true | Allows users to change window dimensions. |
| Dev URL | http://localhost:3000 | The address of the Vite development server. |
Sources: src-tauri/tauri.conf.json:3-28
Build Process Flow
The following diagram illustrates the sequence of commands and transformations during a production build:
The build process first compiles the React frontend into static assets in the dist folder before the Tauri CLI invokes the Rust compiler to wrap these assets in a native shell.
Sources: BUILDING.md:46-52, package.json:7-12
Platform Specific Commands
The project uses specific npm scripts to target different architectures and operating systems.
Development Mode
Run npm run tauri:dev to open a native window with live-reloading capabilities. This starts the Vite server at port 3000 and connects the Tauri backend to it.
Sources: package.json:13, src-tauri/tauri.conf.json:9
Production Building
- Standard Build:
npm run tauri:buildgenerates the installer for the current host OS. - macOS Universal:
npm run tauri:build -- --target universal-apple-darwincreates a fat binary supporting both Intel and Apple Silicon. - Windows ARM64:
npm run tauri:build -- --target aarch64-pc-windows-msvctargets ARM-based Windows devices.
Sources: BUILDING.md:52-64, package.json:14
Asset Preparation
Before building, you must prepare application icons and environment variables.
Icon Generation
The application reads a source icon from public/icon.png (1024x1024) and generates a platform-compliant icon set using the command npm run tauri:icon. This populates src-tauri/icons/ with .ico, .icns, and various .png sizes.
Sources: BUILDING.md:67-68, src-tauri/tauri.conf.json:33-39
Secrets and API Keys
The application requires a GEMINI_API_KEY to function. For desktop builds, this key is retrieved from OS environment variables or a configuration dialog within the app.
Sources: BUILDING.md:100-103, README.md:14
Application UI Components
The desktop version includes a custom TitleBar component that mocks Windows 11 Fluent App controls for window management (minimize, maximize, close). It also features a "Background Process" mode where closing the window minimizes the app to the system tray to maintain local MCP mappings and sync subscriptions.
Sources: src/components/TitleBar.tsx:39-95
Window State Architecture
When the user clicks the close (X) button, the application core process remains active to ensure filesystem drivers stay online.
Sources: src/components/TitleBar.tsx:83-100
Summary
Building for Desktop OS transforms the Agent Studio web application into a high-performance native tool using Tauri and Rust. By configuring tauri.conf.json and utilizing the provided npm scripts, you can generate secure, platform-specific installers that support advanced features like local filesystem MCP drivers and system tray persistence.