Overview
The management interface is the primary communication channel between the Mullvad daemon (system service) and the various frontends (GUI, CLI, Android app, iOS app). It uses gRPC with Protocol Buffers for efficient, type-safe, bidirectional communication. Reference:mullvad-management-interface/proto/management_interface.proto
Architecture
Transport Layer
The management interface uses different transport mechanisms depending on the platform:- Desktop (Windows, Linux, macOS): Unix domain socket or named pipe
- Android: JNI (Java Native Interface) bridge
- iOS: Direct integration (standalone implementation)
Protocol
The interface uses Protocol Buffers v3 with gRPC for:- Type safety and schema validation
- Efficient binary serialization
- Language-agnostic interface definitions
- Automatic client/server code generation
- Built-in streaming support
Service Definition
mullvad-management-interface/proto/management_interface.proto:10-153
Core RPC Categories
1. Tunnel Control
Manage VPN tunnel state and configuration:- Current state (Disconnected, Connecting, Connected, Disconnecting, Error)
- Relay information (endpoint, location, protocol)
- Feature indicators (quantum resistance, multihop, obfuscation, etc.)
- Error details if applicable
management_interface.proto:290-313
2. Event Streaming
Frontends subscribe to real-time daemon events:- Tunnel state changes
- Settings updates
- Relay list updates
- Version information
- Device events (login, logout, revoked)
- Access method changes
- Leak detection alerts
management_interface.proto:729-740
3. Settings Management
Comprehensive settings configuration:management_interface.proto:40-56
4. Relay Configuration
Relay and tunnel constraint management:- Location constraints (country, city, hostname)
- Provider filtering
- Ownership constraints (Mullvad-owned vs rented)
- WireGuard-specific constraints (IP version, multihop, entry location)
- Custom relay configurations
management_interface.proto:551-583
5. Account Management
Account and authentication operations:management_interface.proto:58-66
6. Device Management
Multi-device account management:- Current state (LoggedIn, LoggedOut, Revoked)
- Device ID and name
- WireGuard public key
- Creation timestamp
management_interface.proto:68-72, 807-815
7. WireGuard Key Management
Automatic key rotation and management:management_interface.proto:75-78
8. Custom Lists
User-defined relay groupings:- Named relay collections
- Geographic location specifications
- Quick access to favorite relay combinations
management_interface.proto:80-84, 435-446
9. API Access Methods
Censorship circumvention configuration:- Direct TLS connections
- Mullvad bridges (Shadowsocks)
- Encrypted DNS proxy
- Custom SOCKS5/Shadowsocks proxies
management_interface.proto:86-94
10. Split Tunneling
Platform-specific split tunneling control: Linux (process-based):management_interface.proto:99-115
11. App Upgrade
In-app update management:- Download starting/progress
- Verifying installer
- Completion or errors
management_interface.proto:145-149, 155-182
Communication Patterns
Request-Response
Most operations use simple request-response:- Frontend sends RPC request
- Daemon processes asynchronously
- Daemon returns response when complete
Server Streaming
Long-lived connections for real-time updates: EventsListen provides continuous state updates:Error Handling
Tunnel Errors
TheErrorState message provides detailed error information:
management_interface.proto:207-288
Authentication Errors
management_interface.proto:231-236
Relay Selection Errors
management_interface.proto:238-245
Feature Indicators
The management interface tracks active features:management_interface.proto:332-349
Platform-Specific Operations
Android
management_interface.proto:117-119
macOS
management_interface.proto:121-122
Windows
management_interface.proto:124-126
Settings Persistence
Settings can be managed individually or via JSON patches:management_interface.proto:128-132
Implementation
Server Side
The daemon implements theManagementService in Rust:
mullvad-daemon/src/management_interface.rs
Client Side
Desktop GUI (Electron/TypeScript):mullvad-cli/src/cmds/
Asynchronous Design
Non-Blocking Operations
The management interface is designed to never block:- All RPC handlers run asynchronously
- Commands are queued to the daemon’s actor system
- Responses are sent when operations complete
- No RPC can block another RPC from being processed
architecture.md:21-33
Actor System
The daemon uses an actor-based architecture:- Each component runs independently
- Communication via message passing
- No shared mutable state between actors
- Management interface acts as entry point for external commands
Security Considerations
Access Control
Desktop: Socket permissions restrict access to appropriate user/group- Unix domain socket with restrictive file permissions
- Only local processes can connect
- No network exposure
- App sandbox prevents unauthorized access
Input Validation
All RPC inputs are validated:- Protocol Buffers ensures type safety
- Additional validation in RPC handlers
- Malformed requests rejected before processing
Debugging and Monitoring
Logging
management_interface.proto:151-152
Relay Override
For testing and debugging:management_interface.proto:54-55, 138-139