TUUI (Tool Unitary User Interface) is a desktop Electron application that functions as a Model Context Protocol (MCP) client for orchestrating Large Language Model (LLM) interactions. This document provides a high-level architectural overview of the system, explaining how the main components interact and where key functionality resides in the codebase.
Scope: This page covers the overall system architecture, component organization, and fundamental data flows. For detailed information about specific subsystems, see:
TUUI is defined in package.json1-10 with the following identity:
| Property | Value |
|---|---|
| Name | tuui |
| App ID | com.tuui.app |
| Version | 1.3.8 |
| Schema Version | 1.3 |
| Description | Tool Unitary User Interface |
| Main Entry | dist/main/index.js |
| License | Apache-2.0 |
Sources: package.json1-10 README.md1-6
TUUI follows the standard Electron multi-process architecture with clear separation of concerns:
Key Separation Principles:
IPCs.ts and utils/index.tsSources: src/main/index.ts src/main/IPCs.ts src/renderer/utils/index.ts
TUUI is built on the following core technologies, as defined in package.json49-70:
| Technology | Version | Role |
|---|---|---|
| Electron | 39.2.7 | Desktop application framework |
| Vue 3 | 3.5.26 | Reactive UI framework |
| Vuetify | 3.11.6 | Material Design UI components |
| TypeScript | 5.9.3 | Type-safe development |
| Pinia | 3.0.4 | State management |
| Vue Router | 4.6.4 | Client-side routing |
| @modelcontextprotocol/sdk | 1.25.1 | MCP protocol implementation |
| @anthropic-ai/mcpb | 2.1.2 | MCP bundle support |
| Vite | 7.3.0 | Build tool and dev server |
Sources: package.json49-70 package.json72-99
Sources: src/main/ src/renderer/ src/preload/
The main process entry point src/main/index.ts manages:
app.whenReady())createWindow())Located in src/main/mcp/ the MCP subsystem handles:
Two-way communication bridge:
Utils class)Vue 3 application in src/renderer/:
ChatScreen, McpScreen, AgentScreen, SettingScreen)MarkdownCard, ConfigCards, ElicitationCard)useMcpStore, useMessageStore, useChatbotStore, useAgentStore)Configuration files in src/main/assets/config/:
Sources: src/main/assets/config/mcp.json src/main/assets/config/llm.json
Request Flow Example (Tool Call):
ChatScreen componentuseMessageStore updates conversation statechatCompletions.ts invokes via Utils.invoke('msgToolsCall', ...)IPCs.ts routes to appropriate MCP clientuseMessageStore updates with tool resultSources: src/renderer/utils/index.ts src/main/IPCs.ts src/renderer/stores/ src/renderer/composables/chatCompletions.ts
TUUI implements the following MCP capabilities as documented in README.md28-39:
| Feature | Status | Implementation Location |
|---|---|---|
| Tools | ✅ | src/main/mcp/client.ts - Tool discovery and execution |
| Prompts | ✅ | src/main/mcp/client.ts - Prompt template management |
| Resources | ✅ | src/main/mcp/client.ts - Resource access |
| Sampling | ✅ | src/renderer/components/SamplingCard.vue - LLM sampling requests |
| Elicitation | ✅ | src/renderer/components/ElicitationCard.vue - User input collection |
| Discovery | ✅ | src/renderer/screens/McpScreen.vue - MCP registry integration |
| MCPB | ✅ | src/main/mcp/dxt.ts - Bundle management |
| Roots | 🔲 | Not implemented (IDE-specific feature) |
Sources: README.md28-39 src/main/mcp/
Configuration Precedence:
LocalForage (IndexedDB) - Persisted across sessionsPersistence Plugin: package.json64 - pinia-plugin-state-persistence automatically syncs Pinia stores to IndexedDB
Sources: src/main/assets/config/ src/main/Constants.ts src/renderer/stores/ package.json64
The application uses Vite for development and production builds as configured in package.json24-44:
Development Mode:
Production Build:
Build Pipeline:
vue-tsc --noEmit - TypeScript type checkingvite build - Compile renderer process to dist/renderer/dist/main/electron-builder packages for target platformSources: package.json24-44 vite.config.ts buildAssets/builder/config.js
TUUI maintains security through Electron's process isolation:
Security Boundaries:
Utils class abstracts IPC complexity and enforces type contractsSources: src/preload/ src/renderer/utils/index.ts src/main/IPCs.ts
TUUI supports multiple languages through Vue I18n as configured in package.json67:
Locale Files: src/renderer/locales/
en.json - English translationszh.json - Chinese translationsTranslation Key Domains:
mcp.* - MCP management interfacedxt.* - DXT bundle systemchat.* - Chat interfaceagent.* - Agent configurationsetting.* - Settings panelssnackbar.* - Notification messagesDynamic Locale Switching: The vue-i18n plugin allows runtime language changes without page reload.
Sources: src/renderer/locales/ package.json67
This overview provides the foundation for understanding TUUI's architecture. For deeper exploration:
Sources: README.md package.json High-level system diagrams
Refresh this wiki
This wiki was recently refreshed. Please wait 6 days to refresh again.