Skip to content

Repository files navigation

Fold

Fold (fold.run) is a developer platform that runs any Docker image as a microVM, on our own infrastructure across AWS and GCP — with scale-to-zero, an edge proxy, block volumes, a WireGuard 6PN private mesh, and OpenTelemetry-native observability. It's built to be the runtime for AI agents and MCP servers.

$ fold launch
$ fold deploy
$ curl https://my-app.fold.run     # wakes from zero in milliseconds

Why Fold

  • Scale-to-zero microVMs. Idle apps snapshot and drop to zero machines ($0), then restore on the first request. Real VMs and serverless economics.
  • OCI-native microVMs. Any Docker image boots as a Firecracker microVM via firecracker-containerd — no hand-rolled rootfs/init.
  • Multi-cloud. One Cloud interface; run on AWS, GCP, or your own account.
  • WASM fast-tier. A second runtime (wasmtime) for ~0ms function workloads.
  • OTel-native. Traces/metrics/logs (incl. GenAI token/cost spans) built in.
  • Agent-first. microVM isolation for untrusted agent code, a private mesh for A2A, and MCP-server hosting — see docs/agentic.md.

Components

Binary Role
fold CLI.
fold-control Control-plane daemon: REST API + scheduler + IPAM + scale-to-zero + identity/quotas + MCP.
fold-agent Per-host daemon: reconciles assigned machines via a Runtime (microvm / wasm / docker).
fold-proxy Edge daemon: host/SNI routing, load-balancing, wake-on-request.

The platform above provisioning is cloud-agnostic; only block volumes, image registry, ingress, and compute provisioning differ per cloud, behind internal/cloud.

Platform capabilities

  • Identity & access — users, orgs, workspaces, scoped API keys (PBKDF2), JWT sessions, audit log, and RBAC. Mutations are scope-gated. (fold auth, fold tokens, fold audit)
  • Quotas — per-org plans (free/pro/scale) with limits enforced on deploy/scale/create. (fold usage)
  • Custom domains — register → DNS-TXT verify → routed through the proxy with automatic TLS. (fold domains)
  • MCP — host MCP servers (kind = "mcp"), and operate Fold itself from any MCP client via POST /v1/mcp. (fold mcp, docs/agentic.md)
  • Triggers — wake-on-event work at $0 idle: cron (scheduled), webhook (on-demand), and queue (drains a durable message queue, delivering each message to the app). (fold triggers)
  • Operations — central per-machine log streaming (fold logs, aggregated + tailable), one-shot command exec into a running machine (fold exec), structured logs with a request id that correlates one action across all four binaries, and automatic host failover (a dead host's machines are drained onto healthy hosts).

The macOS reality

Firecracker needs Linux + /dev/kvm, so on a Mac the agent's docker runtime stands in for the microVM tier (and the wasm tier runs natively). This makes the entire control-plane, scheduler, proxy, scale-to-zero, and observability path runnable and verifiable locally. Firecracker, EBS/PD volumes, the host WireGuard mesh, anycast ingress, and Terraform are written prod-ready but run only on Linux + a real cloud — see docs/limitations.md.

Quickstart (local, no cloud account)

Prereqs: Go 1.26.4+ (see go.mod), Docker.

make dev-up    # control :5320, proxy :7000, state in ~/.fold

Or manually:

make build                                   # fold, fold-control, fold-agent, fold-proxy

./bin/fold-control &                                # control plane (prints agent + proxy tokens)

# The control plane writes separate agent/proxy tokens to ~/.fold on first run.
FOLD_AGENT_TOKEN=$(cat ~/.fold/agent-token) ./bin/fold-agent &   # one host (docker runtime)
FOLD_PROXY_TOKEN=$(cat ~/.fold/proxy-token) ./bin/fold-proxy &   # edge proxy on :7000

cd examples/hello-go
../../bin/fold deploy
curl -H 'Host: hello-go.fold.run' http://127.0.0.1:7000/

Stop with make dev-down or scripts/dev-down.sh.

Starting a new project? fold launch scaffolds a fold.toml, creates the app, and deploys it in one step (fold launch --no-deploy to scaffold only).

Then try fold status, fold scale count 3, fold hosts list, fold logs (app output; --system for activity), fold exec -- ps aux, fold secrets set DEMO_SECRET=xyz, and fold volumes create data --size 1.

Documentation

Topic Doc
CLI reference docs/cli.md
Manifest (fold.toml) docs/fold-toml.md
Scale-to-zero docs/scale-to-zero.md
Preview environments (per-PR) docs/preview-environments.md
Networking & 6PN mesh docs/networking.md
Observability & alerts docs/observability.md
Agents, MCP, triggers docs/agentic.md
Cloud deploy docs/cloud/aws-deploy.md
AWS / GCP E2E runbooks docs/cloud/aws-e2e.md, docs/cloud/gcp-e2e.md
Verified vs roadmap docs/limitations.md

Full index: docs/README.md. System overview: ARCHITECTURE.md.

Layout

cmd/            fold, fold-control, fold-agent, fold-proxy
internal/       config, store, api, control, scheduler, ipam, agent, proxy,
                imagebuild, cloud (local|gcp|aws), auth, quota, domains, mcp, alerts,
                cron, telemetry, logging, ratelimit, platformmode, client, cliui,
                secretbox, foldapi (wire types), foldhome (~/.fold), sourcepack
infra/          packer (gcp + aws host images), terraform/gcp (verified fleet + ingress)
experimental/   cloud/aws adapter, terraform/aws-fleet (verified AWS fleet + GA ingress)
scripts/        e2e-local.sh, aws-e2e-up.sh, gcp-e2e-up.sh
examples/       hello-go (microVM), hello-wasm (wasm tier), wake-demo, github-preview (PR previews)
docs/           per-topic guides — see docs/README.md

Make targets: make dev-up / make dev-down (local stack), make e2e-local (CI regression), make dev-wake-test (scale-to-zero smoke), make aws-e2e-up / make gcp-e2e-up (billable cloud). See docs/limitations.md for what's verified where.

About

Run any container as a Firecracker microVM — scale-to-zero with wake-on-request, block volumes, a WireGuard 6PN private mesh, and OpenTelemetry built in. The runtime for AI agents and MCP servers.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages