Getting started
Deploy your first agent in ten minutes.
Install the mb CLI, push your code with git, and get a running agent with its own HTTPS address.
-
Install the CLI
curl -fsSL https://get.mesangebleue.io | shInstalls to
~/.local/binafter checking the download's SHA-256. No sudo needed.irm https://get.mesangebleue.io/install.ps1 | iexRun in PowerShell. Installs to your user profile and adds it to your
PATH. No administrator rights needed.Check it worked:
mb version -
Sign in
mb loginA browser window opens to sign you in.
mbalso sets up git so that pushing to your agents uses this sign-in. There are no passwords or SSH keys to manage.Several workspaces? Commands use your workspace automatically when you belong to just one. Otherwise add--tenant <workspace>, or setMB_TENANTonce in your shell. -
Write a small app
An agent is any web service that listens on the port in
$PORT. Python, Go and LangChain are supported. This example uses Python's standard library, so it needs no dependencies.$ mkdir hello && cd hello && git init -b mainmain.pyimport os from http.server import BaseHTTPRequestHandler, HTTPServer class Hello(BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) self.send_header("Content-Type", "text/plain") self.end_headers() self.wfile.write(b"Hello from MesangeBleue\n") HTTPServer(("", int(os.environ.get("PORT", "8080"))), Hello).serve_forever()That's the whole app:
main.pyis found and started automatically. Add arequirements.txtfor dependencies, or aProcfilewith aweb:line to start it differently. -
Create the agent
Run this inside the project folder:
mb agent create --name hello --runtime pythonThis registers the agent and adds a git remote called
mbto your repository. Other runtimes:--runtime goor--runtime langchain. -
Deploy with git
git add . && git commit -m "First version" git push mb mainEvery push to
mainbuilds and deploys a new version. Follow it with:mb agent get --slug hello # status and address mb agent logs --slug hello # application outputWhen the status is
running, your agent is live athttps://hello.<workspace>.mesangebleue.io, with HTTPS already set up. -
Add settings and secrets
Values are stored encrypted and passed to your agent as environment variables. Reading a secret from standard input keeps it out of your shell history:
mb agent secret set --slug hello --key OPENAI_API_KEY --stdin mb agent secret sync --slug hello # restart with the new values mb agent secret list --slug helloNew values also take effect on your next push.
-
Add a database (optional)
Get a managed PostgreSQL database and connect it to your agent:
mb agent db create --name hello-db mb agent db bind --slug hello --db hello-db --env-var DATABASE_URLYour agent restarts with
DATABASE_URLset. You never handle the database password yourself. -
Use your own domain (optional)
mb agent alias add --slug hello --domain agent.example.comThe command shows a DNS
TXTrecord that proves you own the domain. Add it with your DNS provider, and point the domain at your agent with aCNAMEtohello.<workspace>.mesangebleue.io. Then run:mb agent alias verify --slug hello --domain agent.example.comThe certificate is issued automatically, usually within a couple of minutes.
-
Work as a team
Whoever creates an agent owns it. Everyone in your workspace can see it. Contributors can push code and change settings, while only the owner and workspace admins can delete it or give it to someone else.
mb agent contributor add --slug hello --user teammate@example.com mb agent owner --slug hello mb agent transfer --slug hello --to teammate@example.com
Where to go next
mb --help lists every command, and adding --help to any command shows its options. For automated deploys from CI, create a workspace API client and sign in with mb service-login.
