briq
Run code in isolated briq microVMs and launch databases, apps, and other services with connection strings and HTTPS previews.
briq
briq runs services and sandboxes for agents, each on its own microVM, through one MCP server:
https://api.briq.cloud/mcp (Streamable HTTP, OAuth). Every answer about a briq shows its cost so
far and when it goes to sleep.
Connect, if the briq tools are missing
You have the tools when briq_run, briq_exec and briq_quota are available. If not:
- Add the MCP server for all projects (user scope): name
briq, URLhttps://api.briq.cloud/mcp. Your client's exact steps: https://briq.cloud/docs/setup/clients.md - Get the user signed in. They pick the team you work for and your budget; you never handle a
password or a token.
- On their computer: start your client's sign-in (
claude mcp login briq,codex mcp login briq,/mcpthen Authenticate), or call any briq tool. - On a server, in a container or a chat app: use your client's device-code login
(Hermes:
hermes mcp login briq --flow device), then send the user the link it prints: "Open this link to connect briq to your account: https://app.briq.cloud/connect?user_code=…".
- On their computer: start your client's sign-in (
- Most clients load a new server only after a restart or a reconnect: tell the user.
- Call
briq_quota: it answers with the team, the credits and the limits.
All the details and troubleshooting: https://briq.cloud/docs/setup/agents.md
Run code in a sandbox
briq_run({ recipe: "sandbox" })
→ bq_7kq2m9x1p4ab sandbox running · WORKDIR=/work
briq_exec({ briq: "bq_7kq2m9x1p4ab", cmd: ["sh", "-c", "cd /work && git clone --depth 1 https://github.com/acme/shop . && npm ci && npm test"], async: true })
→ ex_9p2kd7mq1x4r running
briq_exec_result({ briq: "bq_7kq2m9x1p4ab", exec: "ex_9p2kd7mq1x4r" })
→ exited 1 after 2m · stdout: … 2 failed, 36 passed …
- A command that can take over a minute runs with
async: true, thenbriq_exec_result. - Files:
briq_files_putandbriq_files_get, 1 MB each way. Bigger:git cloneorcurlfrom inside. - A credential goes in as a secret, never as plain text:
env: { TOKEN: { secret: "TOKEN", value: "…", scope: "boot" } }for setup steps only, or withhosts: ["api.example.com"]so only requests to those hosts carry it. See https://briq.cloud/docs/guides/run-code-in-a-sandbox.md
Run a service
briq_run({ recipe: "postgres", stack: "shop" })
→ bq_… db running · DATABASE_URL=postgres://postgres:…@…internal:5432/app
briq_run({ recipe: "node", stack: "shop", checkout: { repo: "github.com/acme/shop" }, steps: [{ run: "npm ci" }], cmd: "npm start", expose: "private" })
→ bq_… web running · url: https://web-x2kd.briq.run/?briq_token=…
briq_cataloglists every recipe and its fields: postgres, mysql, redis, mongo, qdrant, chrome, duckdb, sandbox, node, python, go, bun, ruby, rust, php, static, nginx, and more. Prefer a recipe to a bare image: it returns ready connection strings.- Briqs in the same
stackreach each other on a private network and sleep and wake together. briq_exposegives a port an HTTPS URL (mode: "private"carries a token,"public"opens it to anyone), or a TLS endpoint for a database client outside briq (protocol: "postgres").briq_forkcopies a briq or a whole stack with its disk: try a migration on the copy, keep the one that works.
Spend with care
- A briq sleeps after its
sleepwindow without use (briq_set_sleep:"30m","3h","7d","never") and wakes on the next call or visit. Asleep, it keeps its disk and costs nothing. - Destroy what you are finished with:
briq_destroy. payment_required: the team has no credits. Tell the user (they confirm their email address or top up on the dashboard) and stop; retrying does not help.quota_exceededorplan_limit: callbriq_quota, then pick a smaller size or fewer briqs, or tell the user.
Without MCP: the CLI
For a git hook, a CI job or a script, use the CLI. It has one command per tool, with the same options:
npm install -g @briq-cloud/cli
briq login # prints a link for the user, like the device-code login
briq run sandbox
briq exec bq_7kq2m9x1p4ab npm test
In CI, set BRIQ_API_KEY (a key from the dashboard's Agents page) instead of briq login.
Every command: https://briq.cloud/docs/cli.md
More
- Every tool, with an example: https://briq.cloud/docs/mcp/tools.md
- Every recipe: https://briq.cloud/cookbook.md
briq_docsreads any docs page from inside your session.- Something does not work as documented:
briq_feedbackreaches the people who build briq.
- Downloads
- 63All time
- Security audit
- Review
- Last updated
- 3d ago
- Current version
- v1.0.0
- License
- MIT-0
