Architecture
A modular C++23 platform built around the Model Context Protocol, designed for extensibility and real-time communication.
Server Core
The MCP server is a C++23 application using cinatra for high-performance async HTTP and WebSocket handling with C++20 coroutines. It implements JSON-RPC 2.0 for tool discovery, execution, and notifications. Plugins are loaded dynamically via dlopen and can be hot-reloaded without restarting the server.
Native Client
A desktop application built with SDL2 and OpenGL, using ImGui (docking branch) for the UI. Each plugin opens in its own dockable window. Client plugins follow hexagonal architecture: Domain, AppService/ViewModel, ServerProxy, and UI Panels.
Web Client
Angular applications connecting to MCP servers via WebSocket. Currently powers the BI Viewer (report visualization with ECharts). Supports SSR pre-rendering for static deployment.
Plugin System
Server Plugins
Shared libraries (.so) exposing tools via a C ABI factory. Each plugin registers tools in a ToolRegistry with JSON Schema validation. Plugins communicate in-process via IPluginResolver.
Client Plugins
Shared libraries loaded by the native client. Each renders its own ImGui window and communicates with the server via callTool. Follows SOLID/hexagonal architecture.
Hot-Reload
The server watches plugin .so files for changes. When detected, the plugin is unloaded and reloaded with state preservation. No server restart required.
Communication Protocol
All communication uses the Model Context Protocol over WebSocket with JSON-RPC 2.0. The server pushes CDC notifications to connected clients for real-time synchronization.
Tool Discovery
Clients query available tools with their JSON Schema input definitions, namespaced by plugin.
Session Management
RBAC authentication via rbac_login. Sessions are tied to WebSocket connections with user context injected into every tool call.
Change Data Capture
Write tools trigger notifications. Clients receive real-time updates to refresh their UI when server data changes.
