Introduction
Superset provides a comprehensive set of APIs for interacting with the desktop application, managing workspaces, controlling terminals, and integrating with external services through MCP servers.Architecture
Superset’s API architecture is built on three core layers:1. Electron IPC + tRPC
The desktop application uses tRPC over Electron IPC for type-safe communication between the main process and renderer process:- Main Process: Handles system operations, file access, git operations, terminal management
- Renderer Process: UI components that consume APIs via tRPC React hooks
- Transport:
trpc-electronpackage for IPC communication - Type Safety: Full TypeScript types shared between client and server
2. Cloud tRPC API
Separate tRPC routers for cloud services (authentication, analytics, integrations):- User management
- Organization/team management
- Cloud sync and backups
- Third-party integrations (GitHub, Linear, Slack)
3. MCP (Model Context Protocol) Servers
Extensible server architecture for AI agent capabilities:- Desktop MCP Server: Browser automation, DOM inspection, UI testing
- Superset MCP Server: Workspace management, device control, task orchestration
- Custom MCP servers via plugin system
Available APIs
Desktop API
Electron IPC APIs for workspace management, file operations, git, and terminals
tRPC Endpoints
Cloud tRPC procedures for authentication, analytics, and integrations
MCP Servers
Model Context Protocol servers for AI agent capabilities
Authentication
Desktop API
No authentication required - the desktop API runs in the trusted Electron main process.Cloud tRPC API
Authentication uses session-based auth with the following procedures:- Protected procedures: Require valid session (
protectedProcedure) - Admin procedures: Require admin email domain (
adminProcedure) - Public procedures: No authentication required (
publicProcedure)
MCP Server Authentication
MCP servers use the context pattern for authentication:Getting Started
Using Desktop APIs
- In Renderer Process (React components):
- Subscribe to Real-time Updates (using observables):
Using Cloud tRPC API
Using MCP Servers
MCP servers are typically consumed by AI agents via the MCP protocol:Error Handling
tRPC Errors
Error Codes
UNAUTHORIZED: Authentication requiredFORBIDDEN: Insufficient permissionsBAD_REQUEST: Invalid inputNOT_FOUND: Resource not foundINTERNAL_SERVER_ERROR: Server error
Observable Subscriptions (trpc-electron)
Type Safety
All APIs are fully typed with TypeScript:Next Steps
Desktop API Reference
Explore workspace, terminal, and file system APIs
tRPC Endpoints
Browse cloud API procedures
MCP Servers
Build custom MCP servers for agents
Contributing
Contribute to the Superset project