Labby
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Labbywhat upstream MCP servers are connected and healthy?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Labby
Rust MCP gateway with Code Mode, authentication, setup, logs, CLI, HTTP API, and operator web UI.
Canonical remote: git@github.com:dinglebear-ai/labby.git.
The root README is the public entrypoint. The topic docs in docs/ own the detailed contracts; when this file and a topic doc disagree, fix the topic doc first and then refresh this summary.
Contents
Related MCP server: NyxID
What Labby Does
Labby is centered on the current gateway/operator surface:
MCP gateway - connect HTTP and stdio upstream MCP servers, inspect their tools/resources/prompts, apply exposure filters, publish protected MCP routes, and optionally collapse the upstream catalog into Code Mode
searchandexecute.Authentication and protected routes - run bearer or OAuth authentication, manage route-scoped access, authorize upstream OAuth connections, and publish protected MCP endpoints.
Code Mode snippets - author, store, and run reusable JavaScript snippets against the upstream catalog, with artifacts persisted under
$LABBY_HOME.Setup and doctor - bootstrap
~/.labby, provision the host service, and run a health audit across env, reachability, auth, and versions.Filesystem service - scoped, path-safety-checked file operations exposed through the same action dispatch as every other service.
Server logs - search and tail the local
labby servelog stream.Incus and bare-metal setup - provision and operate a dedicated Labby gateway host without introducing a separate fleet or deployment product.
Generated discovery - publish code-owned service, action, environment, API route, OpenAPI, MCP help, CLI help, and feature-matrix artifacts under docs/generated.
The registered services on this branch are exactly doctor, fs, gateway,
lab_admin, server_logs, setup, and snippets. The older
marketplace/stash/acp/nodes/deploy/logs/device product services
were removed by the "Slim labby gateway host" pass; their domain types survive
in labby-runtime/labby-apis but are no longer registered services and have
no CLI commands. Use the generated catalogs below for the current surface
instead of copying command or action lists by hand.
Quick Start
Install A Release
Linux/macOS:
curl -fsSL https://raw.githubusercontent.com/dinglebear-ai/labby/main/scripts/install.sh | sh
labby setup
labby serve --host 127.0.0.1 --port 8765MCP clients that prefer npm launchers can run Labby through the Node wrapper:
npx -y @dinglebear/labby-mcp mcpWindows PowerShell:
irm https://raw.githubusercontent.com/dinglebear-ai/labby/main/scripts/install.ps1 | iex
labby setup
labby serve --host 127.0.0.1 --port 8765The install scripts download the requested GitHub Release asset, verify its
checksum, and install labby onto the user PATH. They do not perform
operator provisioning or environment setup. The scripts only install the binary
(from a release or fallback source build); all first-run provisioning is handled
inside labby via labby serve bootstrap and labby setup.
Override install behavior with LABBY_INSTALL_DIR, LABBY_INSTALL_VERSION, or
LABBY_INSTALL_REPO.
Build From Source
Prerequisites:
Rust 1.97.1 or newer. CI/release verifies with Rust 1.97.1.
justfor repo commands.cargo-nextestfor the main test suite.pnpm 9.15.9for the Labby web UI. The repo pins this in .mise.toml and apps/gateway-admin/package.json.opensslif you want to generate a bearer token manually.
git clone git@github.com:dinglebear-ai/labby.git
cd labby
just install
just web-build
labby serve --host 127.0.0.1 --port 8765just install builds the all-features release binary and symlinks it to
~/.local/bin/labby.
First Run
For loopback development, labby serve can bootstrap a missing bearer token for
you. If LABBY_MCP_HTTP_TOKEN is absent and LABBY_AUTH_MODE is not oauth, it
generates a token, writes a minimal ~/.labby/.env, reloads it into the running
process, prints the setup URL, and continues. The token itself is stored in
~/.labby/.env rather than printed.
Bootstrap writes these required setup keys if no env exists yet:
LABBY_MCP_HTTP_TOKEN(generated random 64-character hex token)LABBY_MCP_TRANSPORT=httpLABBY_MCP_HTTP_HOST=127.0.0.1LABBY_MCP_HTTP_PORT=8765LABBY_AUTH_MODE=bearer
It also enforces secure file creation via Lab's env_merge path (0600 perms on
Unix) and then skips creating anything else until the web wizard runs.
For explicit setup:
mkdir -p ~/.labby
printf 'LABBY_AUTH_MODE=bearer\nLABBY_MCP_HTTP_TOKEN=%s\n' "$(openssl rand -hex 32)" > ~/.labby/.env
chmod 600 ~/.labby/.env
labby setup
labby serve --host 127.0.0.1 --port 8765Open http://127.0.0.1:8765/.
Build static Labby assets with just web-build first when running from a source
checkout.
Self-Host The Gateway
The recommended self-hosted gateway substrate is an amd64 Ubuntu 24.04 Incus system container. Bare metal is the secondary supported shape for a dedicated gateway host or VM. Docker is retained for explicit development/image smoke, but it is not the recommended production boundary for Labby because stdio MCP servers and agent CLIs are installed and launched at runtime.
scripts/incus-bootstrap.sh --version vX.Y.Z
incus exec labby -- systemctl status labby --no-pager
incus exec labby -- curl -fsS http://127.0.0.1:8765/readySee docs/runtime/INCUS.md for the full Incus
runbook, bare-metal variant, /dev/net/tun Tailscale passthrough, manual
claude/codex/gemini login checklist, and rollback commands.
Core Workflows
Start Labby
labby serve --host 127.0.0.1 --port 8765
labby mcplabby serve starts the hosted HTTP runtime: /v1 product APIs, /mcp
streamable HTTP MCP, auth routes, OAuth relay endpoints, and static Labby web
assets when an export is available. labby mcp is the stdio MCP entrypoint for
local MCP clients.
Manage Upstream MCP Gateways
labby gateway add \
--name github \
--url https://example.com/mcp \
--bearer-token-env GITHUB_MCP_TOKEN \
-y
labby gateway reload
labby gateway listStdio upstreams execute local commands when tested or reconciled, so gateway
tests and config mutations use the shared destructive-action confirmation gate.
The stdio spawn guard allows known runtimes such as npx, uvx, docker,
node, python, python3, deno, pipx, and dnx; customize it in
[gateway] inside config.toml.
Use Code Mode
When [code_mode].enabled = true, Labby hides raw proxied upstream tools from MCP
list_tools() and exposes the canonical synthetic codemode tool.
labby gateway code status
labby gateway code enable
labby gateway code exec --code 'async () => tools.length'MCP call shapes:
{ "code": "async () => (await codemode.search(\"github issues\")).results" }{ "code": "async () => callTool(\"github::search_issues\", {\"query\":\"repo:dinglebear-ai/labby gateway\"})" }{ "code": "async () => codemode.run(\"gateway-summary\", {\"includeHealth\": true})" }Code Mode can call exposed upstream MCP tools only. It cannot call Labby actions from inside the sandbox.
Work With Code Mode Snippets
labby snippets list
labby snippets get gateway-summary
labby snippets create --name my-snippet --file ./my-snippet.js
labby snippets validate my-snippet
labby snippets exec my-snippet
labby snippets test my-snippetSnippets are stored per-user under $LABBY_HOME and executed through the
gateway Code Mode runner, so they can reach exposed upstream tools but not Lab
actions. The snippets service is gateway-gated: it is unavailable in builds
without the gateway feature.
Audit Health And Logs
labby doctor # audit every configured service
labby doctor system # local env vars, Docker, disk, toolchain
labby doctor auth # auth/OAuth env vars, files, permissions
labby doctor proxy # public Lab and protected MCP proxy endpoints
labby doctor oauth-relay
labby health # lightweight liveness/readiness probe
labby logs # tail the active deployment's service journallabby doctor --json is the CI-friendly form; the exit code reflects the worst
severity found.
Removed surfaces. Earlier releases documented
labby marketplace,labby stash,labby nodes, andlabby deploy, along with ACP chat, the MCP Registry browser, and device/fleet runtimes. Those products have been deleted from source, manifests, packaging, and CI — not merely feature-gated.scripts/check-retired-features.shguards against reintroduction, and the historical designs are archived under docs/references/retired-labby. Plugin marketplace assets now live in the separate dendrite repo.
Drive The API
Generic action dispatch:
curl -s -X POST http://127.0.0.1:8765/v1/gateway \
-H "Authorization: Bearer $LABBY_MCP_HTTP_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"gateway.list","params":{}}'Dedicated product routes also exist for catalog discovery (/v1/{service}/actions),
setup, doctor, snippets, filesystem, server logs, gateway OAuth
(/v1/gateway/oauth/*), OAuth relay, auth allowlists (/v1/auth/allowed-emails),
/v1/openapi, and the browser session routes under /auth/*. See
generated API routes and
OpenAPI.
Runtime Surfaces
Surface | Entry Point | Notes |
CLI |
| Current commands are generated in docs/generated/cli-help.md. Use |
MCP stdio |
| Local editor/desktop MCP clients. |
MCP HTTP |
| Streamable HTTP MCP with bearer or OAuth JWT auth. |
HTTP API |
| Generic |
Web UI |
| Main routes are |
MCP service tools use the shared action shape:
{
"action": "mcp.list",
"params": { "search": "postgres", "limit": 10 }
}Every service tool also supports help and schema through the shared
dispatcher. Destructive MCP actions use elicitation when the client supports it;
headless clients pass "confirm": true inside params.
Configuration
Configuration is split deliberately:
Data | Location | Examples |
Secrets and endpoint values |
|
|
Preferences |
| transport, CORS, auth mode, workspace root, gateway spawn guard, and upstream behavior |
config.toml is searched in this order:
./config.toml~/.labby/config.toml~/.config/labby/config.toml
Startup loads the first config.toml, initializes tracing, then loads
~/.labby/.env and a CWD .env if present. Runtime precedence is:
CLI flags
Environment variables
config.tomlBuilt-in defaults
Useful environment variables:
Variable | Purpose |
| Static bearer token for protected admin/API/MCP routes. |
|
|
| Public base URL for OAuth metadata, issuer/audience, callbacks, and allowed-host derivation. |
| Google OAuth credentials for OAuth mode. |
| Bootstrap admin email; required in OAuth mode. |
| Base64 32-byte key required for encrypted upstream OAuth credentials. Rotation requires reauthorizing affected upstreams. |
| Override static Labby export directory. |
| Development-only browser auth bypass. |
| Tracing filter, text/json format, and non-TTY color policy. |
| Optional rolling JSON file log directory. |
| Stable secret for redacted actor correlation in logs. |
| Runtime opt-in for the |
Bearer auth is an operator/admin shortcut for Lab routes. Public protected MCP
routes validate route-scoped Lab OAuth JWTs; do not treat LABBY_MCP_HTTP_TOKEN as
a public resource credential.
When driving the web UI with automation while OAuth is enabled, pass the bearer
token as a same-origin header. /auth/session recognizes that token and returns a
synthetic admin session:
TOKEN=$(awk -F= '/^LABBY_MCP_HTTP_TOKEN=/{print $2}' ~/.labby/.env)
agent-browser open http://127.0.0.1:8765/gateways \
--headers "{\"Authorization\":\"Bearer $TOKEN\"}"See runtime configuration, environment variables, and OAuth.
Current Catalogs
Do not maintain action, feature, env, or coverage inventories by hand in this README. The generated artifacts are authoritative for the current branch:
Artifact | Purpose |
Registered services, exposure, features, categories, and surfaces. | |
Per-service actions and destructive metadata. | |
Env vars generated from service metadata. | |
Mounted HTTP routes. | |
OpenAPI 3.1 schema. | |
Cargo feature invariants. | |
MCP help projection. | |
Clap command help snapshot. |
Refresh and verify them with:
just docs-generate
just docs-checkdocs-check verifies generated-artifact freshness and invariants. It is not a
Markdown link checker, live health check, or onboarding policy audit.
Architecture
The workspace has 11 members and uses Rust 2024, resolver 3, a single
[workspace.package] version, shared [workspace.dependencies], and shared
[workspace.lints] (unsafe_code = "forbid", mod_module_files = "deny",
disallowed_macros = "deny"). The MCP SDK is pinned exactly as
rmcp = "=3.0.0-beta.2".
Path | Role |
Dependency-free leaf crate: | |
Shared SDK contracts for core HTTP behavior, setup, and doctor. | |
OAuth/JWT/session middleware, route support, and upstream OAuth runtime. | |
Surface-neutral contracts and helpers: | |
Client-neutral Code Mode runner kernel, broker, result shaping, snippets, and TypeScript descriptor generation. | |
Gateway manager, upstream MCP proxy pool, Code Mode host adapter, discovery/imports, virtual servers, protected routes, and OAuth lifecycle. | |
OpenAPI 3.1 schema assembly for the HTTP surface. | |
Embedded/filesystem web asset serving with symlink escape defense. | |
Product binary crate: CLI, MCP, HTTP API, config loading, gateway dispatch, logs, setup, snippets, filesystem access, and output rendering. | |
Windows Job Object process-tree support, isolated so the main workspace can keep | |
Repo automation tasks; not published. | |
Labby web UI, statically exported and served by | |
npm launcher wrapper behind | |
Claude/Codex plugin assets and skills. | |
Topic documentation and generated inventories. |
Shared behavior belongs in the shared execution layer. Upstream/domain logic
belongs in labby-apis; reusable gateway/runtime/code-mode behavior belongs in
the extracted labby-* crates; product dispatch belongs in
crates/labby/src/dispatch; CLI, MCP, HTTP, and web adapters stay thin. See
Architecture and Dispatch.
Development
Prefer the just aliases:
just check # cargo check --workspace --all-features
just test # cargo nextest run --workspace --all-features
just test-integration # cargo nextest run --workspace --all-features --run-ignored ignored-only
just lint # skill drift + cargo wrapper smoke + clippy -D warnings + fmt check
just deny # cargo deny check
just build # cargo build --workspace --all-features
just build-release # release build, bin/labby install, ~/.local/bin symlink
labby setup host-service install --install-self -y # install current binary + start system service
labby setup host-service restart --install-self -y # reinstall current binary + restart service
labby setup host-service status --json # inspect the host Labby gateway service
just host-sync # repo dev shortcut: rebuild + install binary + restart host service
just dev-container # explicit Docker compatibility/prod-like smoke path
just dev-container-debug # explicit Docker debug binary path
just web-build # cd apps/gateway-admin && pnpm build
just web-watch # rebuild web assets when frontend files change
just run -- help # cargo run --all-features -- <args>
just chat-local # local Labby admin UI workflow with browser auth disabled
just dev-up # start the explicit Docker compatibility stack
just dev # alias for just dev-container
just dev-debug # alias for just dev-container-debug
just install # build-release + symlink ~/.local/bin/labby
just prod-run # local prod-like image smoke on port 18765
just mcp-token # rotate LABBY_MCP_HTTP_TOKEN in .envAuthoritative Rust verification is all-features:
cargo check --workspace --all-features
cargo clippy --workspace --all-features -- -D warnings
cargo nextest run --workspace --all-features
cargo build --workspace --all-featuresCI uses the same posture and runs nextest with its CI profile. Use cargo test
only for narrow local slices or when a tool specifically requires it.
Frontend changes should also run the relevant pnpm scripts under
apps/gateway-admin, and just web-build when exported assets matter.
Host Gateway Runtime
The recommended self-hosted gateway runtime is the Incus system container
provisioned by scripts/incus-bootstrap.sh --version vX.Y.Z and converged
in-box with labby setup --provision. Bare metal uses the same provisioner and
system unit when the host or VM is dedicated to Labby. The default service is
/etc/systemd/system/labby.service, running as User=labby, Group=labby, with
ExecStart=/usr/local/bin/labby serve. From a source checkout, just host-sync
remains the rebuild-and-restart developer shortcut. Docker remains available
for prod-like image smoke and adapter-container work, but it is no longer the
recommended agent gateway runtime.
Dev Container
The Compose stack is a trusted local operator environment, not a hardened
generic deployment. It bind-mounts Labby state, the repository, and built web
assets; secrets are loaded from the mounted /home/labby/.labby/.env. The image
installs pinned Claude, Codex, and Gemini CLIs for stdio upstreams that invoke
provider tools. It does not install ACP adapters or mount ACP-specific state.
Releases
Release Please maintains the version/changelog pull request and creates the
stable tag plus draft GitHub release when that pull request merges. Publishing
the release triggers the heavy GitHub-hosted x86_64 workflows. They build Linux
and Windows archives with checksums, build and scan the GHCR image, build and
smoke the Incus image, publish the npm launcher, and publish Labby's
server.json metadata to the official MCP Registry.
Plugin Setup
The plugins/labby plugin ships skills, an MCP config, and userConfig — not a
labby binary, and no Claude Code hooks. The former
plugins/labby/hooks/hooks.json (SessionStart / ConfigChange shims) has been
removed; operators run labby setup themselves. Do not reintroduce a hooks/
directory, bundle a binary under plugins/labby/bin/, or add
Docker/systemd bootstrap logic to plugin assets.
labby setup plugin-hook remains a CLI command for on-demand audit and settings
sync (--no-repair for read-only), exercised by just validate-plugin.
Related Servers
soma - RMCP runtime for provider-backed MCP servers.
unifi-rmcp - UniFi controller REST API bridge.
tailscale-rmcp - Tailscale API bridge for devices, users, and tailnet operations.
unraid - Unraid monorepo; the Rust GraphQL bridge (
runraid) lives inunraid-rs/.apprise-rmcp - Apprise notification fan-out bridge for many delivery backends.
gotify-rmcp - Gotify push notification bridge for sends, messages, apps, and clients.
arcane-rmcp - Arcane Docker management bridge for containers and related resources.
ytdl-rmcp - Media download and metadata workflow server.
synapse-rmcp - Local Synapse workflow server for scout and flux actions.
cortex - Syslog and homelab log aggregation MCP server.
axon - RAG, crawl, scrape, extract, and semantic search project.
lumen - Local semantic code search MCP server.
Documentation
Start at docs/README.md. High-value entrypoints:
License
Workspace metadata declares MIT OR Apache-2.0.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceA unified gateway and web dashboard that aggregates multiple MCP servers into a single Streamable HTTP endpoint. It supports stdio, SSE, and HTTP protocols, featuring optimized tool exposure modes to reduce token consumption for AI clients.Last updated5MIT
- AlicenseAqualityBmaintenanceAgent Connectivity Gateway — turn any authenticated API into an MCP Server. Self-hosted reverse proxy with OAuth 2.0/OIDC credential injection, per-agent isolation, NAT traversal for localhost services, and REST-to-MCP auto-wrap from OpenAPI specs. Works with Claude Code, Cursor, Codex. Rust.Last updated434Apache 2.0
- Alicense-qualityBmaintenanceSelf-hosted MCP proxy and aggregation platform. Register multiple upstream MCP servers and expose them through a single unified endpoint with namespace routing, multi-transport support (HTTP/SSE, stdio, OpenAPI→MCP), per-tool overrides, and a web admin UI.Last updated15MIT
- Alicense-qualityCmaintenanceUnifies multiple MCP servers behind a single endpoint with lazy loading, auto-cleanup, Python plugins, and role-based filtering.Last updated2MIT
Related MCP Connectors
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
A MCP server built for developers enabling Git based project management with project and personal…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dinglebear-ai/labby'
If you have feedback or need assistance with the MCP directory API, please join our Discord server