Getting Started
Installation
curl -fsSL https://get.mbm.mn/install | bashPlatform Support
| OS | Architectures |
|---|---|
| Linux | x64, arm64 (glibc & musl) |
| macOS | Intel (x64), Apple Silicon (arm64) |
| Windows | x64 via Git Bash / MSYS2 / WSL |
First Run
mbm # Launch interactive TUI mbm run "Hello" # Send a message mbm --help # Show all commandsmbm in your project directory to give the AI context about your codebase automatically.License & Activation
License Types
| Tier | Tokens / Day | Sessions | Devices | Key Features |
|---|---|---|---|---|
| Free | 0 (BYOK) | 1 | 1 | BYO API key, RAG, Export |
| Pro | 100K | 5 | 1 | All models, Priority Queue, API |
| Business | 150K | 10 | 20 | Team Collab, All Features |
Higher tiers available — view billing page or contact us.
Obtaining a License
- Sign up at console.mbm.mn/auth
- Navigate to License & Keys
- Choose a plan or apply an existing license key
Applying a License Key
License keys use the MBM-XXXX-XXXX-XXXX-XXXX format:
mbm license apply MBM-XXXX-XXXX-XXXX-XXXXActivate with a License File
mbm license activate /path/to/license.licenseExample output:
$ mbm license activate ./license.license
License activated successfully.
Device ID: a1b2c3d4e5f6a7b8
Tier: pro
Expires: 2029-12-31Connecting with an API Key
API keys use the {prefix}-{uuid} format (mf- / mp- / mb- prefix). Apply them inside the TUI:
- Launch the TUI:
mbm - Type /connect to open the provider connection dialog
- Select mbm as the provider
- Paste your API key when prompted
Alternatively, use the CLI:
mbm providers login # Select "mbm" → paste your API key (mp-abc123...)Check License Status
mbm license status Device ID: a1b2c3d4e5f6a7b8
License: Activated
Tier: pro
Expires: 2029-12-31T00:00:00.000Z
Max Devices: 1
Priority Queue: enabled
API Access: enabledDevice Binding
Each license is bound to a unique device ID derived from your hardware. If you change machines or hardware, you may need to re-activate your license.
Providers & Models
Supported Providers
| Provider | Auth | Model Examples |
|---|---|---|
| mbm (recommended) | API Key | GPT-4o, Claude, DeepSeek |
| AZ Network (recommended) | API Key | GPT-4o, Claude, DeepSeek |
| OpenAI | API Key | gpt-4o, gpt-4o-mini, o3 |
| Anthropic | API Key | claude-opus-4, claude-sonnet-4 |
| Google Gemini | API Key | gemini-2.5-pro, gemini-2.5-flash |
| OpenRouter | API Key | Multi-provider gateway |
| DeepSeek | API Key | deepseek-chat, deepseek-reasoner |
| Ollama | Local | llama3.2, qwen3, mistral |
Connecting Providers via /connect
Use /connect inside the TUI to add any provider:
- Run
mbmto launch the TUI - Type /connect and select a provider (e.g. DeepSeek, OpenAI)
- Paste your API key when prompted
Example: /connect → select DeepSeek → paste sk-... API key
Adding API Keys
mbm providers loginInteractive prompt: select provider → paste API key. Credentials are stored in ~/.local/share/mbm/auth.json with restrictive file permissions.
Via Config File
Add credentials to ~/.config/mbm/mbm.json:
{
"provider": {
"openai": {
"apiKey": "sk-proj-..."
},
"anthropic": {
"apiKey": "sk-ant-..."
}
}
}Selecting a Model
mbm models # List all available models mbm models openai # Filter by providerIn the TUI: press / to open the model picker — search by name, filter by provider, select with Enter.
Ollama (Local Models)
Install:
curl -fsSL https://ollama.com/install.sh | sh ollama pull llama3.2Connect (auto-detect): If Ollama runs on localhost:11434, mbm discovers it automatically.
Custom URL (config):
{
"provider": {
"ollama": {
"baseURL": "https://ollama2.mbm.mn/v1"
}
},
"model": {
"ollama": "qwen3.6:latest"
}
}Environment variable:
export OLLAMA_HOST=http://your-host:11434 mbmAgent Modes
What Are Agent Modes?
Modes control what the AI agent is allowed to do — read files, run commands, write code, or only analyze. Choose the right mode for your task to stay in control.
| Mode | Read | Write | Execute | Network | Best For |
|---|---|---|---|---|---|
| General | Ask | Ask | Ask | Ask | Daily use, mixed tasks |
| SAFE | Allow | Confirm | Confirm | Confirm | Exploring unknown code |
| Build | Allow | Allow | Allow | Allow | Active development |
| Plan | Allow | Deny | Deny | Ask | Research, architecture |
SAFE Mode
Requires confirmation for every write operation — file edits, bash commands, git operations. Ideal for learning or cautious exploration.
mbm --safe # Launch in SAFE mode mbm run --safe "Review the auth module"Build Mode
Full permissions: file writes, command execution, network access. Best for active coding sessions where you want the agent to implement changes directly.
Plan Mode
Read-only mode: the agent can read files, search code, and fetch documentation — but cannot write, execute, or modify anything. Use before implementation to research and plan.
Permission Configuration
Fine-tune permissions in mbm.json:
{
"permission": {
"bash": "ask",
"edit": "ask",
"read": "allow",
"webfetch": "allow",
"mbm-rag_*": "allow"
}
}Values: "allow" — always permit, "deny" — always block, "ask" — confirm each time.
Key Features
RAG — Knowledge Base
Retrieval-Augmented Generation indexes your codebase and documents for semantic search. The AI can answer questions about your entire project.
Setup
mbm rag setup # Install Docker + pgvector mbm rag enable # Enable auto-sync on git changes mbm rag index . # Index current directoryUsage
mbm rag search "how does auth work" mbm rag status # View KB statistics mbm rag optimize # Remove duplicates & stale entriesMCP — Model Context Protocol
Connect external tools and data sources via standardized protocol servers.
mbm mcp add # Add an MCP server
mbm mcp list # List configured servers
mbm mcp auth <name> # OAuth authenticate
mbm mcp debug <name> # Test connectionSessions
Save, share, fork, and resume conversation sessions.
mbm session list # List all sessions mbm session share # Generate share link mbm session compact # Summarize to reduce context mbm session export # Export to fileCustom Agents
Create agents with specific permissions, models, and system prompts for specialized tasks.
mbm agent create # Interactive agent builder mbm agent list # List your agentsUsage Stats
mbm stats # Token usage and cost summaryCommands Reference
Top-Level Commands
| Command | Description |
|---|---|
mbm | Launch interactive TUI |
mbm run <message> | Send a message (non-interactive) |
mbm models [provider] | List available AI models |
mbm providers login | Add provider API credentials |
mbm rag <subcommand> | Manage knowledge base |
mbm agent create | Create a custom agent |
mbm mcp add | Add MCP server |
mbm session <subcommand> | Manage sessions |
mbm stats | View token usage and costs |
mbm serve | Start headless server |
mbm web | Start server + open web UI |
mbm attach | Attach to a running server |
mbm plugin install | Install a plugin |
mbm upgrade | Upgrade to latest version |
mbm uninstall | Remove mbm from your system |
mbm about | Version and installation info |
mbm license status | Show license status |
mbm license activate | Activate offline license file |
mbm license apply | Apply API key or license key |
Global Options
| Option | Description |
|---|---|
--safe | Requires confirmation for all write operations |
--print-logs | Print logs to stderr |
--log-level <level> | DEBUG, INFO, WARN, ERROR |
--pure | Run without external plugins |
--help, -h | Show help |
--version, -v | Show version |
RAG Subcommands
| Command | Description |
|---|---|
rag setup | Install Docker + pgvector infrastructure |
rag enable | Enable auto-sync on git changes |
rag disable | Disable auto-sync |
rag status | Show knowledge base statistics |
rag index [path] | Index files into the KB |
rag search <query> | Semantic search the KB |
rag optimize | Remove duplicates and stale entries |
CLI Usage Examples
One-Shot Prompts
# Run with a specific model (provider/model format) mbm run -m openai/gpt-4o "Refactor this to async/await" mbm run -m deepseek/deepseek-v4-pro "Explain quantum computing" mbm run -m ollama/llama3:8b "What is this error?" mbm run -m anthropic/claude-sonnet-4-5 "Review this architecture" # With thinking/reasoning enabled mbm run -m deepseek/deepseek-v4-pro:thinking --thinking "Solve this math problem"Pipe & File Workflows
# Pipe stdin git diff HEAD~5 | mbm run -m openai/gpt-4o "Write a PR description" cat /var/log/nginx/error.log | mbm run -m ollama/llama3:8b "Diagnose this error" # Attach files for context mbm run -m openai/gpt-4o -f src/main.ts "Find bugs in this file" mbm run -m ollama/llama3:8b -f src/*.ts "Review these files" # Batch processing for f in src/**/*.ts; do mbm run -m ollama/llama3:8b -f "$f" "Add JSDoc to untagged functions" --dangerously-skip-permissions; doneSession Management
# Continue last session mbm run -c "Add error handling to the login function" mbm run --continue "Expand on the previous answer" # Resume a specific session mbm run -s sess_abc123 -m ollama/llama3:8b "Next step?" mbm run --fork -s sess_abc123 -m openai/gpt-4o "Try a different approach"CI/CD & Automation
# JSON output for CI pipelines mbm run --format json -m openai/gpt-4o "Code review" > review.jsonl # Slash command mbm run --command /review -m openai/gpt-4o src/api/ # Remote server diagnostics via SSH ssh user@server "mbm run -m ollama/llama3:8b 'Server health check' --dangerously-skip-permissions"Permissions & Environment
# Auto-approve all permissions (use with caution) mbm run -m ollama/llama3:8b --dangerously-skip-permissions "Fix all bugs" # Safe mode (read-only, no writes) MBM_SAFE_MODE=1 mbm run "Analyze project structure" # Custom Ollama host OLLAMA_HOST=http://10.0.0.5:11434 mbm run -m ollama/llama3:8b "Hello" # Configure permissions in mbm.json: # "permission": # "external_directory": "/proc/*": "allow" # "bash": "allow" # "read": "allow"API Keys
Key Format
API keys use the format {prefix}-{uuid}:
| Prefix | Tier | Example |
|---|---|---|
mf- | Free | mf-a1b2c3d4e5f6... |
mp- | Pro | mp-a1b2c3d4e5f6... |
mb- | Business | mb-a1b2c3d4e5f6... |
Creating Keys
- Log in to console.mbm.mn
- Navigate to Account → API Keys
- Click Create Key
- Copy the key immediately — it is shown only once
Using Keys in CLI
mbm providers login # Select "mbm" → paste your API keyOr inside the TUI: type /connect, select mbm, and paste your key.
Using Keys in API Requests (External Tools)
Your API key works with any OpenAI-compatible client. No TUI or CLI is required. Use https://proxy.mbm.mn/v1 as your base URL.
curl
curl https://proxy.mbm.mn/v1/chat/completions \
-H "Authorization: Bearer mf-abc123..." \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4o", "messages": [{"role": "user", "content": "Hello"}]}'OpenAI SDK (Python)
from openai import OpenAI
client = OpenAI(
base_url="https://proxy.mbm.mn/v1",
api_key="mf-abc123...",
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)OpenAI SDK (JavaScript)
import OpenAI from "openai"
const client = new OpenAI({
baseURL: "https://proxy.mbm.mn/v1",
apiKey: "mf-abc123...",
})
const response = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello" }],
})
console.log(response.choices[0].message.content)Tier Limits
| Feature | Free | Pro | Business |
|---|---|---|---|
| Daily tokens | 0 (BYOK) | 100,000 | 150,000 |
| Monthly tokens | 0 (BYOK) | 2,000,000 | 3,500,000 |
| Concurrent sessions | 1 | 5 | 10 |
| Max devices | 1 | 1 | 20 |
| RAG support | Yes | Yes | Yes |
Configuration
Config File
Global config: ~/.config/mbm/mbm.json
Per-project: .mbm/mbm.json (in your project root)
Full Example
{
"model": {
"default": "openai/gpt-4o",
"openai": "gpt-4o",
"ollama": "llama3.2:latest"
},
"provider": {
"openai": {
"apiKey": "sk-proj-..."
},
"ollama": {
"baseURL": "http://localhost:11434/v1"
}
},
"permission": {
"bash": "ask",
"edit": "ask",
"read": "allow",
"webfetch": "allow"
}
}Comprehensive Example
Full configuration with custom providers, MCP servers, and advanced options:
{
"$schema": "https://get.mbm.mn/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama (Local)",
"options": {
"baseURL": "http://localhost:11434/v1"
},
"models": {
"qwen3-coder": {
"name": "qwen3-coder:latest",
"options": {
"num_ctx": 262144,
"stream": false,
"tools": []
}
}
}
},
"openai": {
"apiKey": "sk-proj-..."
}
},
"mcp": {
"mbm-rag": {
"type": "local",
"command": [
"python3",
"~/.mbm/bin/rag/rag_mcp_server.py"
]
}
},
"lsp": true,
"rag_inject": true,
"permission": {
"bash": "ask",
"edit": "ask",
"read": "allow",
"webfetch": "allow",
"mbm-rag_*": "allow"
}
}Environment Variables
| Variable | Purpose |
|---|---|
MBM_DIR | Source / install directory |
MBM_CONFIG_DIR | Override config directory |
MBM_CONFIG | Path to a single config file |
OLLAMA_HOST | Ollama server address |
MBM_INSTALL_SERVER | Install server URL |
MBM_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS | Default timeout for bash commands in ms (default 120000 = 2 min) |
Directory Layout
| Path | Purpose |
|---|---|
~/.local/share/mbm/ | Data: logs, repos, DB, auth files |
~/.cache/mbm/ | Cache: LSP binaries, skill definitions |
~/.config/mbm/ | Config: themes, mbm.json, tui.json |
~/.local/state/mbm/ | State: model tracking, plugin metadata |
~/.mbm/bin/mbm | Binary / wrapper |
~/.mbm/logs/ | Install logs |
Web UI & Team Workflow
Every mbm server ships an embedded web interface. Use it to browse sessions, continue a terminal conversation in a browser, or let non-technical teammates plan while developers implement — all on the same machine and the same project data.
Quick Start
Start the server and open the web interface in your browser:
mbm web # starts on 127.0.0.1:8027 by defaultThe default port is 8027 and the server binds to 127.0.0.1. Pass --port / --hostname, or configure a fixed port in ~/.config/mbm/config.json:
{
"server": {
"port": 8027,
"hostname": "127.0.0.1"
}
}Serving under an Alias (e.g. /mbm)
Behind a reverse proxy, mount the UI under a base path such as /mbm. Set MBM_WEB_UI_BASE so deep links and page refreshes resolve correctly:
export MBM_WEB_UI_BASE=/mbm mbm weblocation = /mbm { return 301 /mbm/; }
location ^~ /mbm/ {
proxy_pass http://127.0.0.1:8027/; # trailing "/" strips /mbm
proxy_buffering off; # keeps SSE streams live
}You then open http://<server-ip>/mbm.
Authentication
The server is protected by HTTP Basic auth. The default username is mbm and the default password is mbmTUI123 — the CLI prints this value on startup when it is used.
MBM_SERVER_PASSWORD to a strong random value. Keep it in the OS environment of the process so it survives restarts:export MBM_SERVER_USERNAME=admin
export MBM_SERVER_PASSWORD='correct-horse-battery-staple'
mbm webThe browser prompts for credentials on first visit. WebSocket connections reuse the same session automatically (an auth_token query parameter is attached by the UI).
Plan → Build Team Flow
A natural workflow: a manager or product owner researches and drafts a plan from the web while a developer picks up the same session on the CLI and implements it in build mode.
| Role | Interface | Agent | Rights |
|---|---|---|---|
| Manager / Planner | Web UI (http://<ip>/mbm) | plan | Read-only — no file writes, no shell, no PTY |
| Developer | Terminal (TUI or mbm attach) | build | Full — file writes, shell, tools |
The web UI runs in plan-only mode by default (MBM_WEB_UI_PLAN_ONLY=true): non-terminal clients are forced onto the plan agent and writing tools (write, apply_patch, patch, plan_exit), the shell, and PTY endpoints are denied. This makes the web interface safe for managers — the plan agent can read code, run research, and discuss, but cannot accidentally modify anything.
Manager (web) Developer (CLI)
───────────── ────────────────
1. Open http://<ip>/mbm
→ create a session in the project
2. Describe the requirements
→ plan agent researches & drafts
a plan (read-only, safe)
3. Hand over the session
(copy the session id / title) ───►
4. mbm attach http://localhost:8027 --session <id>
(or run mbm in the project and open the session)
5. Switch to build mode: /agent build
6. Developer approves & the plan is implemented
with full write + shell access
5. Watch progress live on the web ◄───── (both sides stream the same session via SSE)Step by step on the developer side:
# Attach the terminal UI to the running web server (realtime sync)
mbm attach http://localhost:8027 --session sess_abc123
# Or continue the latest session
mbm attach http://localhost:8027 --continue
# Switch to the build agent and start implementing
/agent buildIn plan mode the agent records the final plan to a per-session plan file in the project's .mbm/plans/ directory and ends with plan_exit. The developer then switches to build and the AI implements that plan — the whole planning conversation stays in the same session as context.
If you trust the network and want the web UI to have full write access too, set MBM_WEB_UI_PLAN_ONLY=false and restart the server. This removes the plan-only guard, so use it only behind an SSH tunnel or a TLS reverse proxy.
Continue a Terminal Session in the Browser
From the TUI, run /share (or mbm session share) to generate a link that opens the current session in the web UI, where you can keep chatting with it.
Point share links at your own server so nothing is pushed to the remote share service. Configure share_base_url in ~/.config/mbm/config.json or set MBM_WEB_URL:
{
"share_base_url": "http://localhost:8027"
}export MBM_WEB_URL=http://localhost:8027With a base URL configured, the share link looks like http://localhost:8027/<base64-of-project-dir>/session/<session-id> and all remote sync is skipped — session data never leaves your machine.
Private Remote Access
Keep the server bound to 127.0.0.1 and reach it remotely through an SSH tunnel:
# On your laptop
ssh -N -L 8027:127.0.0.1:8027 user@<server-ip>
# Now open on your laptop
http://localhost:80270.0.0.0 over plain HTTP sends credentials and session content in cleartext. If you must expose it, put a TLS reverse proxy (nginx / caddy) in front, keep Basic auth enabled, and set a strong password.Environment Variables
| Variable | Purpose |
|---|---|
MBM_SERVER_PASSWORD | Server Basic auth password (default mbmTUI123) |
MBM_SERVER_USERNAME | Server Basic auth username (default mbm) |
MBM_WEB_URL | Base URL used for local session share links |
MBM_WEB_UI_BASE | Mount path for the web UI behind a reverse proxy (e.g. /mbm) |
MBM_WEB_UI_PLAN_ONLY | When true (default), the web UI is restricted to the plan agent and write/shell tools are denied |
MBM_DISABLE_EMBEDDED_WEB_UI | Disable the embedded web UI (assets are then proxied from the upstream CDN) |
MBM_DISABLE_SHARE | Disable all session sharing (local and remote) |
Troubleshooting
Ollama Connection Fails
- Verify Ollama is running:
systemctl status ollamaorollama serve - Check the port:
curl http://localhost:11434/api/tags - Pull a model:
ollama pull llama3.2 - If using a remote host, verify the
OLLAMA_HOSTenv var orbaseURLin config
License Invalid / Expired
- Check status:
mbm license status - Verify your device ID matches the license binding
- Re-apply the license key:
mbm license apply MBM-XXXX-... - Visit License & Keys to check your account status
Rate Limit Hit (429 Errors)
- Check your usage:
mbm stats - View daily limits at Usage dashboard
- Consider upgrading your plan for higher limits
RAG Not Working
- Ensure Docker is running:
docker ps | grep mbm-rag - Check setup:
mbm rag setup - Enable auto-sync:
mbm rag enable - Re-index:
mbm rag index . - Check status:
mbm rag status
API Key Not Working
- Keys are shown only once at creation — if lost, revoke and create a new one
- Verify the key format:
{prefix}-{32-char-hex} - Check if the key was revoked at API Keys
- Ensure you have an active license for the tier
