MCP server

MCP tools

Every tool the briq MCP server exposes, with input, output and an example call.

The server is at https://api.briq.cloud/mcp. Tools mirror the REST API. Hosted MCP does not accept sandbox credentials. Use their supported REST or client operations instead. Every result about a briq ends with its cost line:

bq_7kq2m9x1p4ab db (postgres:16) running · …internal · cost so far … · sleeps at 18:42 UTC unless used

briq_run

Create and start a briq from a recipe or an image. Returns once it is ready: its healthcheck passes, or without one its process has started.

FieldNotes
recipe or imagerecipe names a cookbook entry; image is any public OCI image
expose"private" for a URL only whoever has it can open, "public" for anyone. Publishes the recipe's front door, or the image's single port, and returns URL
nameUnique in the stack. Default: the recipe's briq name, or the image name
stackDefault default; created if missing
envA string, { "secret": "NAME" } for a generated secret, or { "secret": "NAME", "value": "…" } for a credential you already have; add "scope": "boot" for one only the boot steps need, never in the environment; { "secret": "NAME", "value": "…", "hosts": ["api.stripe.com"] } keeps the value out of the briq: a placeholder in its environment, the real value put in by the team's credential gateway to those hosts; { "secret": "NAME", "scope": "team" } names a team secret the same way, with no value (Secrets). Plain values show in status: credentials always go as secrets
imageWith recipe: another tag (postgres:17) or a compatible image (pgvector/pgvector:pg16)
cmd, ports, sizecmd: a string run with sh -c, or the argv. Size pico, micro, nano, small (default), medium, large, xlarge; briq_quota lists available sizes
filesPath → text or { "base64": "…" }, written before the process starts: absolute, or under /app for a language recipe. 64 files, 256 KB in all
volume{ mount, gb? }: a durable disk for data you cannot lose, 2 GB unless gb says more. A recipe mounts its own: { gb }
checkout, stepsA language recipe: your code from a repo ({ repo, ref?, path?, token? }), and the commands run before it starts ([{ run }]), as a GitHub Actions job
entrypoint, healthcheckImage only. healthcheck: { cmd, timeoutMs? }, briq_run waits until it passes
sleepWhen it goes to sleep: after this long without use, a string such as "30m", "3h", "7d", or "never" (always on, Pro plan and above). Never a number. Default "1h" on briq.cloud; with a recipe, every briq it makes gets the same. See Sleep
waitDefault true: return once ready, for up to two minutes. The result has ready: false with a message when a briq is still creating (check briq_status) or its create failed (an error result: read briq_logs)

With recipe, the fields change the service it makes, as for a GitHub Actions service; the recipe's cookbook page lists what it takes and its defaults. params is refused.

Output: the briqs (id, state, host, endpoints), ready (with a message when it is false), the outputs (a recipe's connection strings, secrets briq generated, URL), the cost line. A secret you passed in is not printed back. A briq in state error makes the result an error. The text still lists the briq, so you can briq_destroy it.

briq_run({ recipe: "postgres" })
→ bq_7kq2m9x1p4ab db (postgres:16) running · …internal · cost so far … · sleeps at 18:42 UTC unless used
  outputs:
    DATABASE_URL=postgres://postgres:…@…internal:5432/app

briq_up

Bring up the stack a repo declares in briq.yaml. Creates each service the stack does not have yet, as briq_run makes it, all of them or none; leaves the others as they are. Never changes or deletes.

FieldNotes
fileThe file's content, as the agent read it from the repo
stackBring it up as this stack instead of the file's stack: a branch's
secretsValues of secrets the file names as { secret: NAME }: { "STRIPE_KEY": "…" }. The others are generated. Stored encrypted, never printed back
exposetrue: outputs for a client outside briq. Each database gets a TLS endpoint, and the connection strings name it
waitDefault true: return once the new services are ready

Output: each briq, the services created and those already there, and the outputs. Calling it again creates nothing.

briq_up({ file: "stack: shop\nservices:\n  db: { recipe: postgres }\n" })
→ stack shop: 1 created, 0 already there
  bq_7kq2m9x1p4ab db (postgres:16) running · …internal · cost so far …
  outputs:
    DATABASE_URL=postgres://postgres:…@…internal:5432/app

briq_exec

Run a command in a briq. Input: { briq, cmd: string[], timeoutMs?, stdin?, async?, stdinOpen?, env?, clearEnv? }. cmd is an argv run without a shell: ["psql", "-c", "select 1"], not ["psql -c 'select 1'"] (that looks for a program named after the whole line, and fails with exit 127); for pipes, globs, && or $VARS, pass ["sh", "-c", "…"]. timeoutMs 60000 by default and at most (a longer one runs with 60000 and the answer says so); keep the command under about 16 KB and send bigger input as stdin. Longer: async: true starts it and answers at once with an exec id, read with briq_exec_result (Run a long command); it needs sh and setsid in the image. Output: exit code, stdout and stderr (stdout truncated at 32 KB). A sleeping briq is woken first, so the call is slower. On a stopped briq, an error that says why: invalid_state (409) after a stop or an exit (with the code), quota_exceeded or payment_required (402) while a limit holds.

env sets variables for this command only; clearEnv starts it from the briq's PATH, HOME and LANG only, then env. Values stay off its command line and out of the audit log. stdinOpen (with async) keeps its stdin open for briq_exec_input.

briq_exec({ briq: "bq_7kq2m9x1p4ab", cmd: ["psql", "-U", "postgres", "-c", "select count(*) from orders"] })
→ exit 0
  count
  -----
  1284
  cost so far … · sleeps at 18:42 UTC unless used

briq_exec_result

Where a command started with async: true stands. Input: { briq, exec, waitMs?, offset?, stream?, maxBytes? }. Waits up to waitMs (30000 by default, 45000 at most) for it to end, then answers either way. Output: its state (running, exited, timed_out, stopped, lost), the exit code once it exited, and the end of stdout and stderr. The whole output is in the briq, at the path it names. On a stopped briq, the last state seen.

With offset, the output from that byte of stream (stdout by default) instead of the tails, up to maxBytes (32768 by default), and the offset to read next. The wait then ends at the first new output. See Follow the output.

briq_exec_result({ briq: "bq_7kq2m9x1p4ab", exec: "ex_4n8w2k5p1qzt" })
→ ex_4n8w2k5p1qzt exited 0 after 3m
  stdout: …

briq_exec_input

Write to the stdin of a command started with async: true and stdinOpen: true. Input: { briq, exec, data?, base64?, eof?, seq? }. Writes land in order, 64 KB at most each; eof closes the input. seq is the last write's number plus one: a write sent again with the same seq is not written twice. Output: the write's seq, and whether it was already written.

briq_exec_input({ briq: "bq_7kq2m9x1p4ab", exec: "ex_4n8w2k5p1qzt", seq: 1, data: "yes\n" })
→ written as seq 1

briq_exec_stop

Stop a command started with async: true, and every process it started. Input: { briq, exec }. One already finished is answered as it is; on a stopped briq, invalid_state (409): start it first.

briq_logs

Input: { briq, since?, limit? } (since is the next cursor of a previous call, limit up to 1000). Output: log lines and next.

briq_files_put / briq_files_get

Write or read one file, base64, up to 1 MB each way. (PUT /v1/briqs/:id/files and briq files-put take raw bytes up to maxFileBytes of briq_quota, 1 MB or more.) Input: { briq, path, contentBase64 } / { briq, path }. A PNG, JPEG, GIF or WebP comes back as an image the model can see, a screenshot for example; briq_exec with base64 <path> gives its bytes as text. A larger file is refused with a validation error that says so, in both directions: move it from inside the briq instead (git clone, curl), or read part of it with briq_exec. A 1 MB write can take up to half a minute. Writing one of the briq's boot files answers with a warning: the spec writes it again at the next start.

A write answers with the file's sha256, and verified: true when the briq computed the same digest from its disk (its image has sha256sum): compare it with your copy's. Line breaks in the base64 are ignored; base64 whose length shows it was cut short is refused with a validation error, rather than written and found broken later.

briq_files_put({ briq: "bq_7kq2m9x1p4ab", path: "/seed.sql", contentBase64: "aW5zZXJ0…" })
briq_exec({ briq: "bq_7kq2m9x1p4ab", cmd: ["psql", "-U", "postgres", "-f", "/seed.sql"] })

briq_expose

Give the briq its HTTPS URL, on one port, or a TCP endpoint. Input: { briq, port, protocol?, mode?, rotate? }. mode is private, a URL only whoever has it can open (it carries a secret checked before any request reaches the briq), or public, open to anyone. Without mode, a URL the briq already has keeps its mode, and a first URL is public.

  • By default a briq has one front-door URL. additional: true gives an HTTP port a separate URL on supported environments, keeping the front door. briq_unexpose({ briq, endpoint }) removes one URL by its id from status. Its front door (the recipe's, or a briq's only port) publishes at once. Another port moves the URL there and restarts the machine: the processes start over, files on disk are kept, and the result carries a note saying so.
  • rotate: true gives a private URL a new token: the URL stays, links and cookies with the old token stop working. A public URL has none to rotate.
  • A briq declares at most 32 ports; exposing a new one past that is refused.
  • protocol is http by default. A database protocol (postgres, mysql, redis, mongodb, amqp, bolt, grpc) makes a TCP endpoint: reachable from outside over TLS, for any briq. A recipe's database port refuses http and names its protocol. mode does not apply: the password is the gate. See Connect to a database from outside.

See Expose a preview URL.

briq_expose({ briq: "bq_9a2fk3m8q1zt", port: 3000, mode: "private" })
→ exposed port 3000 (private): https://api-k7x3.briq.run/?briq_token=…

briq_fork

Copy a briq, or a whole stack, before a change you might want to undo. See Forks.

FieldNotes
briq or stackbriq forks one briq; stack alone forks the whole stack
nameOne briq: the fork's name. Default <name>-fork
stack (with briq)One briq: the stack to put the fork in. Default: the same
intoWhole stack: the new stack. Default <stack>-fork
exposeWhole stack: "private" or "public" to use the fork from outside briq. Databases get TLS endpoints, front doors a URL; outputs name them. See Forks
sleepDefault: the source's. A window longer than the key allows is refused
waitDefault true

Output: the forks, what each copied (disk or config), outputs pointing at the forks, the cost line.

briq_stop / briq_start / briq_destroy

Input: { briq }, or for destroy { stack }: every briq of the stack. Stop keeps the disk, volume and every other file; destroy removes it. Each returns once the move lands (up to 30 s); a stopping, starting or destroying state means it is still on its way, and calling again is safe. Stop and destroy accept wait: false to return after the move is queued. An already pending move then returns invalid_state; read its status to follow completion. A stop during starting is refused with wait: false. A briq stopped by briq_stop or its own exit stays stopped until briq_start. One stopped by a limit sleeps once the limit clears. A sleeping one needs neither: the next call or visit wakes it.

briq_set_sleep

Change when a briq goes to sleep. Input: { briq, sleep, stack? }: sleep as in briq_run, stack: true for every briq of its stack. A running briq sleeps the new window from now; a sleeping one keeps sleeping until its next use. Not needed for ordinary work: every call and every visit already pushes the sleep back.

briq_set_sleep({ briq: "bq_7kq2m9x1p4ab", sleep: "3h" })
→ bq_7kq2m9x1p4ab db (postgres:16) running · …internal · cost so far … · sleeps at 21:12 UTC unless used

briq_resize

The same briq at another size, with a bigger volume, or with another image. See Resize.

briq_resize({ briq: "bq_7kq2m9x1p4ab", size: "medium", volumeGb: 20 })
→ bq_7kq2m9x1p4ab db (postgres:16) running · …internal · cost so far … · size medium · volume 20 GB
FieldNotes
sizeThe new size. A running briq restarts at it; a stopped or sleeping one takes it at its next start
volumeGbThe volume grown to this size. More than it has: a volume only grows
imagePass alone after stopping the briq. It stays stopped; start it explicitly after the change lands

Checked like briq_run: sizes, disk and credits. Returns once it lands (up to 30 s); resizing means it is still on its way.

briq_move

briq_move({ briq: "bq_7kq2m9x1p4ab", stack: "checkout" })
→ bq_7kq2m9x1p4ab db (postgres:16) running · …internal · in stack checkout · restarted: its processes started over and its private IP changed
FieldNotes
stackA stack's name (a new name makes it) or null to take the briq out of its stack

A briq alone that joins a new stack, or leaves one, moves in place. A running briq that joins a stack that has briqs restarts. If the stack's briqs run on another host the move is refused: make the briq again in the stack. Cases and costs: Stack. Returns once it lands (up to 30 s); moving means it is still on its way.

briq_list / briq_status

Input: { stack?, all? } / { briq }. Output: state (running, sleeping, stopped…), image, host, cost and when it sleeps per briq; for one, also why it stopped (stoppedReason), its last process exit (lastExit), endpoints, env (secrets masked), boot files (path and size) and the commands running with async: true.

briq_quota

Input: {}. Output: spend today against the daily cap, credits left, live briqs and how many more are allowed, allowed sizes, the longest sleep. The spend and the live briqs that count toward the limit are this credential's own: an agent that signed in again has a new one, so briqs it started before show in the team's count (teamLiveBriqs) and in briq_list, not in its own.

briq_secrets

The team's secrets by name, with the hosts each may be sent to and where it goes; never a value. Input: none. Name one in briq_run's env as { "secret": "NAME", "scope": "team" }: the briq gets a placeholder, and the team's credential gateway puts the real value into requests to those hosts. The person adds secrets on the dashboard's Secrets page or with POST /v1/secrets; an agent asks them to, never for the value. See Secrets.

briq_secrets({})
→ STRIPE_KEY → api.stripe.com (header) · last used 2026-10-19T21:04:11Z
  GITHUB_TOKEN → api.github.com, *.githubusercontent.com (header)

briq_catalog

Input: { name? }. Output: every recipe with a one-line description; with name, every parameter it takes (type, default, what it does), its outputs and briqs.

briq_docs

Input: { page? }. Without page, the index of every docs, cookbook and legal page (/llms.txt); with it, that page as Markdown: concepts/fork, cookbook/postgres, legal/dpa.

briq_feedback

Input: { topic: "bug" | "idea" | "question", message }. Emails the people who build briq. For when briq does not do what these docs say, an error has no explanation (a 5xx), the docs miss something, or there is an idea. The answer goes by email to the person who connected the agent (or the team's owner), who also gets a copy; the team's audit log records it as support.send. Output: the request id to quote, and who will get the answer. Five per ten minutes.

Resources and prompts

  • briq://recipes/<name>: a recipe's parameters, outputs and briqs.
  • briq://docs/<page>: every page briq_docs can read.
  • Prompt briq_getting_started: how to use the tools well (prefer recipes, reuse a stack, read the cost line, destroy what you created).

Transport and auth

Streamable HTTP, stateless. Authentication follows the MCP authorization spec: a request without credentials gets 401 with WWW-Authenticate pointing at https://api.briq.cloud/.well-known/oauth-protected-resource/mcp. The authorization server (https://app.briq.cloud/api/auth) supports Client ID Metadata Documents, dynamic client registration, PKCE (S256) and the briq and offline_access scopes. Access tokens last 30 days; refresh tokens 30 days from their last use, and each one works once. A client that signs in with a device code (RFC 8628) gets a refresh token too, whatever scopes it asked for; a code request that names no scope gets the ones the client registered. The code waits 15 minutes for approval. A sign-in request refused for coming too often (429) says how long to wait: Retry-After, and retry_after_seconds in the body. An API key (Authorization: Bearer bq_live_…) works too.

How can we help?

Message to the briq team