image_Build-on-Aipokit

Build on Aipokit

A REST API and a Workspace MCP surface over one governed core — the same operations behind Studios and Ask (the in-product AI assistant). Point a REST integration or an external agent at a workspace and it can author files, run processes, manage media, and publish — under the same risk tiers and approvals. WebDAV authoring mounts workspace folders for local tools; reindex so graph and search stay current. Self-hosted multi-user software, per-account isolation, no private back door for agents.

Inside the Aipokit platform
Architecture

A lean core, rich surfaces.

At the centre is a file-and-media kernel with a memory graph, an agent runtime, and a process engine. Studios are SPA authoring surfaces layered over the same service contracts — a clear shell over a truthful core. End-user output is published as static, SEO-safe pages that never depend on an authoring bundle to render.

Architecture

The Stack

LayerTechnology
LanguageRust (stable)
Web FrameworkAxum 0.8
TemplatesAskama 0.13 (SSR, type-safe)
DatabaseSQLite via sqlx (compile-time checked)
Sessionstower-sessions 0.14 + SQLite store
AuthOIDC (Casdoor recommended)
CSSTailwindCSS v4 + DaisyUI
VideoFFmpeg (HLS) + MediaMTX (RTMP)
ObservabilityOpenTelemetry 0.31 + OTLP/gRPC

Workspace Crate Architecture

Aipokit is a Cargo workspace with 34 crates organized by domain:

crates/
  common/              # Shared types, storage, database
  media-core/          # Media detection, EXIF extraction
  media-manager/       # Upload, serve, search, CRUD
  video-manager/       # HLS transcoding (8-stage pipeline)
  access-control/      # 4-layer permission model
  access-codes/        # Shareable access links
  access-groups/       # Team roles and invitations
  user-auth/           # OIDC + session management
  workspace-manager/   # Workspace browser and folder types
  vault-manager/       # Storage vault isolation
  site-generator/      # Astro site generation
  course/              # Course viewer + presentations
  ...and 22 more

The Dual-Use Pattern

Every app crate implements the FolderTypeRenderer trait for embedded mode (inside workspace browser) and exports a Router for standalone mode (own URL). Same logic, same templates, two deployment modes.

Storage Layout

storage/
  workspaces/{workspace_id}/     # File browser content
    folder-a/                    # Regular folder
    media-gallery/               # Typed folder (media-server)
  vaults/{vault_id}/             # Media pipeline storage
    media/
      images/{slug}.webp
      videos/{slug}/index.m3u8
      documents/{filename}
    thumbnails/
      images/{slug}_thumb.webp
      videos/{slug}_thumb.webp

Rate Limiting

Three tiers based on resource intensity:

TierLimitEndpoints
Default60 RPMMost API endpoints
Upload15 RPMFile upload, transcoding
Serving300 RPMMedia delivery, thumbnails
REST and Workspace MCP
API & MCP

REST is the contract surface

The REST API is the stable, versioned way to drive the platform from any language or integration. The Workspace MCP server is a thin agent adapter that maps directly onto the same operations — no parallel implementation, no drift. Whatever a Studio can do, the API can do; whatever the API can do, an agent can do over MCP.

External agents operating a workspace over MCP
Agent integration

Bring your own agent

External agents — Claude Desktop, a custom loop, or anything that speaks MCP — connect to a workspace and operate it directly: read and write files, run and supervise processes, manage media, and publish output. The agent works against the same governed operations people use, scoped to an account and its files, with the memory graph as context.

Quickstart

Three steps to your first workspace.

01
Get a workspace
Spin up a self-hosted node or an account on one, and provision a workspace — a per-account, isolated boundary for files, media, and processes.
02
Author or import files
Create content in a Studio or bring existing files in. The workspace is the shared substrate every surface — UI, REST, and MCP — reads and writes.
03
Point an agent at it
Connect an MCP client to the Workspace MCP server and let your agent operate: author, run processes, manage media, and publish.
Self-hosting and federation
Self-hosting

Runs on your infrastructure

Ship it as a single Docker image. Run one private authoring node plus any number of public delivery nodes, federated over a single code path and kept in sync. Every account is a database-per-account isolation boundary — data residency and sovereignty are the default, not an add-on.

1 Docker image
1+N authoring + delivery nodes

Start building.

Explore the architecture, connect an agent over MCP, and run a workspace on infrastructure you control.

↗ REST + MCP · self-managed on enterprise