Lab Docs
August 3, 2026 · View on GitHub
This directory is the documentation entrypoint for lab.
The docs are split by topic so contributors do not have to recover architecture, protocol rules, product behavior, and operator workflows from one large design document.
Start Here
- Read ARCH.md to understand the crate split, runtime surfaces, and shared contracts.
- Use crate-extract/README.md for the reusable crate/package extraction spec, contract, execution strategy, and open questions.
- Use adr/README.md for accepted architecture decision records.
- Read CONVENTIONS.md before changing implementation patterns or core APIs.
- Use SERVICES.md, CLI.md, and MCP.md for current surface-specific behavior. MCP_CONFORMANCE.md records the rmcp 3.1.0 and MCP 2026-07-28 conformance contract. TUI.md records deferred TUI status.
- Use design/CLI_DESIGN_SYSTEM.md for the human-readable CLI output language and shared color policy.
- Use design/component-development.md and design/design-system-contract.md when building or revising Labby web UI components.
- Use CONFIG.md, INCUS.md, HOST_GATEWAY.md, and OPERATIONS.md for setup, recommended Incus deployment, gateway runtime choices, and operator workflows.
- Use guides/STDIO_MCP_PROXY.md to expose one stdio MCP server directly over loopback or an owned Tailscale Serve port.
- Refer to OAUTH.md for bearer vs OAuth mode selection, Google-backed authorization flow, lab-issued JWT behavior, and callback-forwarding constraints.
- Use CALLBACK_RELAY.md for the public OAuth callback relay cutover and rollback runbook.
- Use GATEWAY.md when managing upstream MCP gateways over CLI, MCP,
/v1/gateway, or Gateway-managed OAuth protected MCP routes. - Use coverage/README.md, upstream-api/README.md, generated/README.md, and features/README.md for directory-level indexes.
- Use UNRAID.md for the native Unraid
.plgplugin packaging (unraid/), an alternative to the Incus/Docker deployment targets. - See UPSTREAM.md for upstream MCP gateway setup, configuration, tool merging, circuit breaker behavior, and resource proxying.
- Consult TRANSPORT.md for stdio and streamable HTTP transport configuration, middleware stack, stateless discovery, and subscriptions.
- Use OBSERVABILITY.md for the mandatory logging, correlation, redaction, and verification contract.
- Use ERRORS.md for the shared error taxonomy, envelope shapes, and status mapping contract.
- Use design/SERIALIZATION.md for the shared serde, envelope, and output-boundary contract.
- Use DISPATCH.md for the shared surface-neutral dispatch-layer contract and dependency rules.
- Use SERVICE_LAYER_MIGRATION.md for the current status of the older service-layer migration plan.
- Use SERVICE_ONBOARDING.md when you are bringing a new service online end to end.
- Use SCAFFOLD_AND_AUDIT.md for the deferred scaffold/audit command contract.
Reading Paths
If You Are Adding or Refactoring Code
- ARCH.md
- CONVENTIONS.md
- SERVICES.md
- Then the surface doc you are touching: CLI.md, MCP.md, or the relevant HTTP/web docs
If You Are Working on Product Behavior
- CLI.md for command behavior
- design/CLI_DESIGN_SYSTEM.md for human-readable output language
- MCP.md for tool and envelope behavior
- TRANSPORT.md and the service docs for HTTP/web behavior
- CONFIG.md for config and env implications
- OBSERVABILITY.md for logging, request tracing, and redaction rules
- ERRORS.md for stable kinds and structured error behavior
- design/SERIALIZATION.md for serde and output-boundary rules
- DISPATCH.md for layer ownership and adapter direction
- SERVICE_LAYER_MIGRATION.md for the current status of the older migration plan
If You Are Working on a Service Integration
- SERVICES.md
- ARCH.md
- CONVENTIONS.md
- MCP.md and CLI.md for the public surfaces
- OBSERVABILITY.md for instrumentation and verification requirements
- ERRORS.md and design/SERIALIZATION.md for transport and envelope consistency
- DISPATCH.md for shared operation ownership across CLI, MCP, and API
- SERVICE_LAYER_MIGRATION.md for the refactor sequence if you are migrating existing services
If You Are Operating the Project
- CONFIG.md
- guides/STDIO_MCP_PROXY.md (if directly exposing a stdio server)
- INCUS.md
- HOST_GATEWAY.md
- TRANSPORT.md
- OAUTH.md (if deploying with OAuth)
- GATEWAY.md (if managing upstream MCP gateways)
- UPSTREAM.md (if proxying upstream MCP servers)
- CALLBACK_RELAY.md (when operating the public OAuth relay)
- REVERSE_PROXY.md
- OPERATIONS.md
- CLI.md
Topic Map
- ARCH.md System shape, crate boundaries, shared contracts, and runtime flow.
- TECH.md Stack choices, toolchain, feature posture, verification surfaces, and release tooling.
- crate-extract/README.md Architecture, contract, dependency map, execution strategy, and verification plan for extracting Lab into reusable Rust crates, TypeScript packages, and standalone binaries.
- adr/README.md Accepted architecture decision records.
- MCP.md Transport model, prompts/completions/logging capabilities, one-tool-per-service design, discovery, envelopes, and destructive-op elicitation.
- RMCP.md RMCP SDK integration contract: transports, feature posture, handler patterns, auth ownership, and capability rules.
- OAUTH.md HTTP auth modes: static bearer compatibility, internal Google-backed OAuth, lab-issued JWTs, JWKS, RFC 9728 metadata, and redirect/callback forwarding rules.
- CALLBACK_RELAY.md Public OAuth callback relay cutover, relay-state import, validation, and rollback.
- REVERSE_PROXY.md Reverse-proxy requirements and examples for the web UI, OAuth, native MCP, and protected routes.
- GATEWAY.md Gateway control plane: CRUD, reload/test flows, runtime views, tool exposure policy, and Gateway-managed OAuth protected MCP routes.
- UPSTREAM.md Upstream MCP proxy gateway: config, discovery, tool collision handling, circuit breaker, resource proxying.
- TRANSPORT.md Stdio and streamable HTTP transport: middleware stack, stateless discovery, subscriptions, DNS rebinding protection, CORS.
- guides/STDIO_MCP_PROXY.md Direct stdio-to-Streamable-HTTP proxy quickstart, configuration, auth, Tailscale ownership, security, cleanup, and troubleshooting.
apps/gateway-admin/README.mdLabby admin UI: local frontend workflow, static export, and same-origin deployment model.- design/component-development.md Web UI component workflow: feature specs, render iteration, design-system review, and browser verification.
- design/design-system-contract.md Labby web UI design-system contract: Aurora tokens, typography, surfaces, components, page patterns, accessibility, and approval rules.
- SERVICES.md Service inventory, feature gates, plugin metadata, multi-instance support, coverage docs, and add-a-service workflow.
- coverage/README.md Service coverage doc index.
- upstream-api/README.md Upstream API/spec reference index.
- generated/README.md Generated CLI/MCP catalog docs and refresh notes.
- features/README.md Focused feature docs and implementation artifacts.
- design/README.md Design contract and artifact index.
- SERVICE_ONBOARDING.md End-to-end checklist for adding a new service, from upstream spec to verification.
- SCAFFOLD_AND_AUDIT.md Deferred scaffold/audit command contract.
- CLI.md
Command structure, output rules, confirmation rules, setup/install surfaces, operator commands, and
labby oauth relay-local. - design/CLI_DESIGN_SYSTEM.md Human-readable CLI output language, semantic tokens, status hierarchy, and pipe-safe color policy.
- design/CLI_OUTPUT_THEME_API.md Proposed Rust API for CLI semantic styling, color policy resolution, and renderer integration.
- TUI.md Deferred TUI status.
- CONFIG.md Env and TOML config ownership, load order, secrets handling, and instance naming.
- INCUS.md Recommended amd64 Ubuntu 24.04 Incus gateway deployment, bare-metal variant, in-box provisioning, Tailscale TUN passthrough, rollback, and dependency diagnostics.
- HOST_GATEWAY.md Gateway runtime choice overview: Incus recommended, bare metal secondary, Docker explicit smoke/dev path.
- ENV.md Deployment-ready env examples and auth-mode variables.
- OBSERVABILITY.md Mandatory logging boundaries, required fields, correlation rules, redaction, and verification gates.
- ERRORS.md
Shared error taxonomy, stable
kindvalues, MCP and HTTP error envelopes, and status mapping. - design/SERIALIZATION.md Serde ownership, stable envelope shapes, CLI output boundaries, and naming rules.
- DISPATCH.md Surface-neutral dispatch ownership, dependency direction, operation metadata, and adapter responsibilities.
- SERVICE_LAYER_MIGRATION.md Phase-by-phase guide and checklist for moving existing services into the shared dispatch layer.
- CONVENTIONS.md Locked engineering rules around async, HTTP, testing, docs, API surface, and privacy.
- OPERATIONS.md Repo helpers, doctor/health workflows, CI expectations, release behavior, and update rules.
- CICD.md GitHub Actions check matrix and release behavior.
- TESTING.md Test runner contract and verification expectations.
- MARKETPLACE.md Marketplace service, plugin workspace mirrors, save/deploy flows.
Canonical Source Policy
These topic docs are the source of truth for the project.
When updating behavior or decisions:
- edit the topic doc that owns that concern
- do not recreate a monolithic “master design” file
- update multiple docs only when a decision genuinely crosses boundaries
Edit Guide
Use the smallest correct doc:
- architecture or boundaries: ARCH.md
- implementation rules: CONVENTIONS.md
- service model or inventory: SERVICES.md
- CLI UX or command behavior: CLI.md
- CLI output language or color policy: design/CLI_DESIGN_SYSTEM.md
- MCP tool, discovery, or envelope behavior: MCP.md
- RMCP SDK integration, feature posture, and server-shape rules: RMCP.md
- HTTP auth modes, JWKS, and JWT validation: OAUTH.md
- gateway control plane, exposure policy, and protected MCP routes: GATEWAY.md
- ACP service architecture and chat/backend boundary: acp/README.md
- mirrored MCP Registry metadata contract: MCPREGISTRY_METADATA.md
- node runtime roles, fleet ingest, and master gating: DEVICE_RUNTIME.md
- controller/node runtime split and node artifact contract: NODE_RUNTIME_CONTRACT.md
- deployment topology and rollout guidance: DEPLOY.md
- upstream MCP proxy, circuit breaker, resource proxying: UPSTREAM.md
- transport configuration, middleware, stateless discovery: TRANSPORT.md
- deferred TUI status: TUI.md
- config, env, secrets, instance naming: CONFIG.md
- observability, request tracing, redaction: OBSERVABILITY.md
- error taxonomy and envelope rules: ERRORS.md
- serialization and output-shape rules: design/SERIALIZATION.md
- dispatch-layer ownership and adapter rules: DISPATCH.md
- service-layer migration execution plan: SERVICE_LAYER_MIGRATION.md
- retired/extracted stash versioning service and provider sync model: STASH.md
- retired/extracted marketplace service and plugin workspace flows: MARKETPLACE.md
- retired/extracted deploy-service actions: DEPLOY_SERVICE.md
- node CLI/API behavior: NODES.md
- fleet WebSocket methods: FLEET_METHODS.md
- env examples: ENV.md
- testing contract: TESTING.md
- CI/CD behavior: CICD.md
- operator workflows, CI, releases: OPERATIONS.md
- stack and toolchain choices: TECH.md
Common Questions
- “Where does business logic belong?” See ARCH.md.
- “What is the canonical MCP response/error shape?” See MCP.md.
- “How should
labuse the RMCP SDK itself?” See RMCP.md. - “How do multi-instance services work?” See CONFIG.md and SERVICES.md.
- “How should a new service be added?” See SERVICES.md.
- “What rules are locked and review-enforced?” See CONVENTIONS.md.
- “What is the expected CI and release behavior?” See OPERATIONS.md and TECH.md.
- “How do we extract Lab into reusable crates/packages?” See crate-extract/README.md.