Deploy your bot from the terminal, VS Code or AI (MCP)

Published on 9 min read

Use an API key and a mybotcloud.config file to deploy, pause, restart, change variables and delete your bot without leaving your editor.

You write the bot on your own machine. With MyBotCloud's developer tools, deploying, pausing, restarting, changing variables and deleting all happen from the terminal, VS Code or an AI agent, without opening the dashboard. Your code is packaged on your computer and only the package goes to the platform.

There are three ways to use the same thing: the CLI (mybotcloud), the VS Code extension and an MCP server for AI assistants. They all do exactly the same operations.

Where to get them: download the CLI and the VS Code extension from the MyBotCloud site (the landing page, or Developer in the dashboard). They are not on npm or the VS Code Marketplace, and the SHA-256 of each file is published next to it (/downloads/checksums.txt).

1. Create an API key

  1. Sign in to the dashboard and open Developer in the side menu.
  2. Name the key (for example laptop) and click Create key.
  3. Copy the key now: it starts with mbc_ and is never shown again. The platform only keeps a fingerprint of it.

What a key can do: deploy, pause, start, restart, read logs, change variables and delete your own applications. What it cannot do: access your account, support, or create other keys. Still, treat it like a password. You can have up to 5 keys and revoke any of them in the dashboard; revocation is immediate.

2. Install the CLI

You need Node 20 or newer. Download the CLI file (mybotcloud-<version>.tgz) and install it:

npm install -g ./mybotcloud-<version>.tgz
mybotcloud --help

The package already contains everything it needs, so the install does not download anything else.

On Linux (and WSL) npm install -g can fail with EACCES: permission denied, because npm tries to write to a system folder. Without sudo, install into your own folder:

npm install -g --prefix ~/.local ./mybotcloud-<version>.tgz
export PATH="$HOME/.local/bin:$PATH"    # add this line to ~/.bashrc to make it permanent
mybotcloud --help

3. Create the mybotcloud.config

In your bot's folder:

mybotcloud init

This creates mybotcloud.config (a JSON file) and adds it to .gitignore, so the key does not end up in Git:

{
  "name": "my-bot",
  "type": "bot",
  "main": "index.js",
  "start": "node index.js",
  "ram": 100,
  "key": "mbc_…"
}
FieldWhat it is for
nameThe application name. On the first upload it is how the app is created or found. Afterwards the id (see below) ties the folder to the app.
mainThe entry file. Node: .js, .mjs or .cjs. Python: main.py, app.py, bot.py or run.py at the project root.
typebot or app. Informational for now: both run the same way.
startThe start command. node index.js runs directly and uses about 60 MB less than npm start, which matters on a 100 MB plan. For Python only python <file> is accepted.
ramThe RAM you expect, in MB. It is only checked: a new app starts with its plan's default share (Start: 100 MB; Pulse and Orbit: 200 MB) and you adjust it afterwards with mybotcloud ram. Asking for more than your plan's total RAM fails before anything is sent.
keyThe API key. See the security note below.
envFile(optional) A .env file whose variables are sent along. It never goes inside the package.
ignore(optional) Folders or files to leave out of the package.
idWritten by the tool on the first upload. It ties the folder to the app even if you change name (renaming the app on the platform is not supported yet). Do not edit.
version(optional) Your own version label. Informational.

Leaving folders out: .mybotcloudignore

Create a .mybotcloudignore file at the root, one pattern per line:

# heavy folders
data/
*.log
/drafts

name matches at any depth, /name or a/b match from the root, and *, ** and ? are wildcards. Lines starting with ! (exceptions) are not supported. The file adds to the ignore field. node_modules is always left out already.

An unknown field in the config is an error, so a misspelled name does not slip through silently.

Where to put the key

In priority order: the MYBOTCLOUD_KEY environment variable, the VS Code secret storage (Set API key command), or the key field in the file. The safest choice is not to keep the key in the file.

For local development, point to your server with MYBOTCLOUD_URL=http://localhost:3000. The server address is never read from mybotcloud.config: a project cloned from someone else cannot redirect your key elsewhere.

4. Deploy

mybotcloud deploy --dry-run   # shows what would be sent, without sending
mybotcloud deploy

The CLI builds the ZIP on your machine and already checks what the platform would reject: a ZIP of up to 5 MB, 20 MB uncompressed, 2 MB per file, 300 files, no binaries. Always left out: mybotcloud.config, any file starting with a dot (.env, .git), node_modules, __pycache__ and venv. Files with an unaccepted extension (.sh, .png...) are also left out, and the CLI tells you which.

The first deploy creates the app; later ones update it in place. If the new version does not start, the previous one is restored and the bot's own output is shown so you can see the error.

5. Day to day

mybotcloud status                 # state, memory and variable names
mybotcloud stop                   # pause
mybotcloud start                  # start
mybotcloud restart                # restart (takes 15 to 30 s)
mybotcloud logs -n 100            # last log lines
mybotcloud delete --yes my-bot    # delete for good

delete only works if you repeat the exact app name. A stray flag or a command typed without thinking deletes nothing.

Add --json to any command for script-friendly output.

Environment variables (tokens and passwords)

mybotcloud env list                          # names only
mybotcloud env set DISCORD_TOKEN=abc123      # save (the bot restarts)
mybotcloud env set --from-file .env          # save everything from a file
mybotcloud env unset DISCORD_TOKEN           # remove

Values never come back: not in the response, not in logs, not in the dashboard. The CLI only shows names. Prefer --from-file or the envFile field, because a value typed on the command line stays in your shell history.

If you use envFile in mybotcloud.config, deploy sends the variables along: on creation, before the first run (a bot that requires a token starts with it); on updates, before the new code.

6. VS Code extension

Download the extension file (mybotcloud-vscode-<version>.vsix) from the same page. In VS Code, open Extensions → … → Install from VSIX, or from a terminal:

code --install-extension mybotcloud-vscode-<version>.vsix

When you open your bot's folder, VS Code asks whether you trust the folder's authors (Restricted Mode). Click Yes, I trust: the extension only works in trusted folders, like any extension that reads and uploads project files.

The sidebar

A cloud icon appears in the activity bar. Without a key it shows a Sign in with API key button: paste the key (the extension checks it with the server before saving it, and keeps it in VS Code's secret storage, not in the project). Then you see:

  • Account: your plan, the plan's RAM (shared among your bots: what your apps use / the total) and how many applications you use out of the limit.
  • My applications: each app with a green cloud (up), gray (paused) or red (crashed) icon, its language, state and memory. Expand it for state, memory, uptime and restarts.

Hover an app for the start/stop, restart and logs buttons. Right-click for the full menu: status, logs, update code, add or remove a variable, and delete. You can act on a clicked app even in a folder without a mybotcloud.config. The list refreshes by itself every 15 seconds.

Commands (palette and shortcuts)

In the palette (Ctrl+Shift+P, type mybotcloud):

CommandWhat it does
Login / LogoutSaves or removes the key on this computer. Login checks the key with the server before saving it
Create Configuration FileCreates mybotcloud.config suggesting values from your package.json, and opens it for you to review
Deploy ApplicationCreates or updates, whichever applies to the folder. Shows progress and, at the end, offers View logs
Create Application from Project / Update ApplicationOnly creates / only updates
View Application StatusState, memory used/limit, CPU, disk, network, uptime, restarts, ID and last deploy
Start / Stop / Restart ApplicationBot control. The tree refreshes by itself
View Logs / Clear LogsFollows the app's log in its own channel; only new lines are appended. Running it again reconnects
Edit Environment VariablesLists only the names; add, change the value (a box that hides the text) or remove
Edit RAMPick from the sizes your plan allows (or type another value within the limit)
Backup Application / Download BackupStores a snapshot on the platform (the 3 newest) / downloads one
Copy Application IDCopies the app's ID
Delete ApplicationA confirmation window; Cancel deletes nothing

Shortcuts: Ctrl+Alt+M opens the action menu and Ctrl+Alt+U updates the app. The status bar shows MyBotCloud: connected (or asks you to sign in again if the key was refused) and opens the menu.

You can also right-click a folder in the Explorer (or the mybotcloud.config) and choose Deploy Application or Update Application. mybotcloud.config gets validation and autocompletion. If the configuration is missing, the error comes with a Create configuration file button.

About the deploy progress: the extension shows the two stages it really follows: check and compress and upload and deploy. Installing dependencies and starting the app happen on the server, inside the same upload, and the server only returns the final result.

About the logs: the platform has no continuous stream yet; the extension polls the log every few seconds (slower when the bot goes quiet).

7. Let an AI operate your bot (MCP)

MCP (Model Context Protocol) is how AI assistants such as Claude Code call tools. The mybotcloud mcp command exposes 21 tools. The ones for running your bot are mybotcloud_deploy, _status, _stop, _start, _restart, _logs, _env_list, _env_set and _delete; the rest cover RAM, name, avatar, backups, team and domains. None of them opens a shell inside your container.

It uses the CLI you installed in step 2. In Claude Code:

claude mcp add mybotcloud -e MYBOTCLOUD_KEY=mbc_… -- mybotcloud mcp

In other clients the configuration usually looks like:

{
  "mcpServers": {
    "mybotcloud": {
      "command": "mybotcloud",
      "args": ["mcp"],
      "env": { "MYBOTCLOUD_KEY": "mbc_…" }
    }
  }
}

Then just ask: "deploy the bot", "restart it and show me the logs". The server works in the folder where it was started, re-reading mybotcloud.config on every call.

Two cautions:

  • The delete tool requires the exact app name (confirmName). Ask the AI to confirm with you first.
  • A variable value the AI passes to mybotcloud_env_set goes through your conversation with it. For tokens and passwords, prefer envFile.

Security at a glance

  • The key is stored on the platform only as a fingerprint and shown once.
  • It only opens your applications' routes. It does not reach your account, support or other keys.
  • The config, the key and the .env never enter the uploaded package.
  • The server address does not come from the project.
  • Variable values are write-only.
  • Revoked the key? It stops working on the very next request.

Common problems

MessageWhat to do
No API keyPut the key in key, in MYBOTCLOUD_KEY or in the VS Code secret storage.
[401] ... invalid or revokedThe key was revoked or copied incompletely. Create another in the dashboard.
[409] Seu plano não permite mais aplicaçõesThe Start (free) plan allows one application. Delete the other one or contact support.
ram ... is more than your plan offersLower ram (or remove the field).
Python: the server runs the first one that exists among main.py...Rename the entry file to one of those names, at the root.
The language cannot change after creationDelete the app and deploy again.

Still stuck? Open a ticket in Support in the dashboard.

  • cli
  • vscode
  • mcp
  • deploy
  • tutorial

← Back to the blog