Getting Started

Installation

bash
curl -fsSL https://get.mbm.mn/install | bash

Platform Support

OSArchitectures
Linuxx64, arm64 (glibc & musl)
macOSIntel (x64), Apple Silicon (arm64)
Windowsx64 via Git Bash / MSYS2 / WSL

First Run

bash
mbm                    # Launch interactive TUI mbm run "Hello"       # Send a message mbm --help            # Show all commands
Tip: Run mbm in your project directory to give the AI context about your codebase automatically.

License & Activation

License Types

TierTokens / DaySessionsDevicesKey Features
Free50K11Basic models, RAG, Export
Pro200K51All models, Priority Queue, API
Business500K1020Team Collab, All Features

Higher tiers available — view billing page or contact us.

Obtaining a License

  1. Sign up at console.mbm.mn/auth
  2. Navigate to License & Keys
  3. Choose a plan or apply an existing license key

Activate with a License File

bash
mbm license activate /path/to/license.license

Example output:

$ mbm license activate ./license.license
License activated successfully.

  Device ID:  a1b2c3d4e5f6a7b8
  Tier:       pro
  Expires:    2029-12-31

Applying a License Key

License keys use the MBM-XXXX-XXXX-XXXX-XXXX format:

bash
mbm license apply MBM-XXXX-XXXX-XXXX-XXXX

Connecting with an API Key

API keys use the {prefix}-{uuid} format (mf- / mp- / mb- prefix). Apply them inside the TUI:

  1. Launch the TUI: mbm
  2. Type /connect to open the provider connection dialog
  3. Select mbm as the provider
  4. Paste your API key when prompted

Alternatively, use the CLI:

bash
mbm providers login # Select "mbm" → paste your API key (mp-abc123...)

Check License Status

bash
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:     enabled

Device 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.

Need help? Visit License & Keys to manage your licenses or upgrade your plan.

Providers & Models

Supported Providers

ProviderAuthModel Examples
mbm (recommended)API KeyGPT-4o, Claude, DeepSeek
OpenAIAPI Keygpt-4o, gpt-4o-mini, o3
AnthropicAPI Keyclaude-opus-4, claude-sonnet-4
Google GeminiAPI Keygemini-2.5-pro, gemini-2.5-flash
OpenRouterAPI KeyMulti-provider gateway
DeepSeekAPI Keydeepseek-chat, deepseek-reasoner
OllamaLocalllama3.2, qwen3, mistral

Adding API Keys

bash
mbm providers login

Interactive 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:

json
{
  "provider": {
    "openai": {
      "apiKey": "sk-proj-..."
    },
    "anthropic": {
      "apiKey": "sk-ant-..."
    }
  }
}

Selecting a Model

bash
mbm models                     # List all available models mbm models openai              # Filter by provider

In the TUI: press / to open the model picker — search by name, filter by provider, select with Enter.

Ollama (Local Models)

Install:

bash
curl -fsSL https://ollama.com/install.sh | sh ollama pull llama3.2

Connect (auto-detect): If Ollama runs on localhost:11434, mbm discovers it automatically.

Custom URL (config):

json
{
  "provider": {
    "ollama": {
      "baseURL": "https://ollama2.mbm.mn/v1"
    }
  },
  "model": {
    "ollama": "qwen3.6:latest"
  }
}

Environment variable:

bash
export OLLAMA_HOST=http://your-host:11434 mbm

Agent 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.

ModeReadWriteExecuteNetworkBest For
GeneralAskAskAskAskDaily use, mixed tasks
SAFEAllowConfirmConfirmConfirmExploring unknown code
BuildAllowAllowAllowAllowActive development
PlanAllowDenyDenyAskResearch, architecture

SAFE Mode

Requires confirmation for every write operation — file edits, bash commands, git operations. Ideal for learning or cautious exploration.

bash
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:

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

bash
mbm rag setup              # Install Docker + pgvector mbm rag enable             # Enable auto-sync on git changes mbm rag index .            # Index current directory

Usage

bash
mbm rag search "how does auth work" mbm rag status             # View KB statistics mbm rag optimize           # Remove duplicates & stale entries

MCP — Model Context Protocol

Connect external tools and data sources via standardized protocol servers.

bash
mbm mcp add               # Add an MCP server
mbm mcp list              # List configured servers
mbm mcp auth <name>       # OAuth authenticate
mbm mcp debug <name>      # Test connection

Sessions

Save, share, fork, and resume conversation sessions.

bash
mbm session list          # List all sessions mbm session share         # Generate share link mbm session compact       # Summarize to reduce context mbm session export        # Export to file

Custom Agents

Create agents with specific permissions, models, and system prompts for specialized tasks.

bash
mbm agent create          # Interactive agent builder mbm agent list            # List your agents

Usage Stats

bash
mbm stats                # Token usage and cost summary

Commands Reference

Top-Level Commands

CommandDescription
mbmLaunch interactive TUI
mbm run <message>Send a message (non-interactive)
mbm models [provider]List available AI models
mbm providers loginAdd provider API credentials
mbm rag <subcommand>Manage knowledge base
mbm agent createCreate a custom agent
mbm mcp addAdd MCP server
mbm session <subcommand>Manage sessions
mbm statsView token usage and costs
mbm serveStart headless server
mbm webStart server + open web UI
mbm attachAttach to a running server
mbm plugin installInstall a plugin
mbm upgradeUpgrade to latest version
mbm uninstallRemove mbm from your system
mbm aboutVersion and installation info
mbm license statusShow license status
mbm license activateActivate offline license file
mbm license applyApply API key or license key

Global Options

OptionDescription
--safeRequires confirmation for all write operations
--print-logsPrint logs to stderr
--log-level <level>DEBUG, INFO, WARN, ERROR
--pureRun without external plugins
--help, -hShow help
--version, -vShow version

RAG Subcommands

CommandDescription
rag setupInstall Docker + pgvector infrastructure
rag enableEnable auto-sync on git changes
rag disableDisable auto-sync
rag statusShow knowledge base statistics
rag index [path]Index files into the KB
rag search <query>Semantic search the KB
rag optimizeRemove duplicates and stale entries

API Keys

Key Format

API keys use the format {prefix}-{uuid}:

PrefixTierExample
mf-Freemf-a1b2c3d4e5f6...
mp-Promp-a1b2c3d4e5f6...
mb-Businessmb-a1b2c3d4e5f6...

Creating Keys

  1. Log in to console.mbm.mn
  2. Navigate to Account → API Keys
  3. Click Create Key
  4. Copy the key immediately — it is shown only once

Using Keys in CLI

bash
mbm providers login # Select "mbm" → paste your API key

Or inside the TUI: type /connect, select mbm, and paste your key.

Using Keys in API Requests

bash
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"}]}'

Tier Limits

FeatureFreeProBusiness
Daily tokens50,000200,000500,000
Monthly tokens500,0005,000,00010,000,000
Concurrent sessions1510
Max devices1120
RAG supportYesYesYes
Security: Keys are shown only once. Store them securely. Revoke compromised keys immediately from API Keys.

Configuration

Config File

Global config: ~/.config/mbm/mbm.json
Per-project: .mbm/mbm.json (in your project root)

Full Example

json
{
  "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:

json
{
  "$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

VariablePurpose
MBM_DIRSource / install directory
MBM_CONFIG_DIROverride config directory
MBM_CONFIGPath to a single config file
OLLAMA_HOSTOllama server address
MBM_INSTALL_SERVERInstall server URL

Directory Layout

PathPurpose
~/.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/mbmBinary / wrapper
~/.mbm/logs/Install logs

Troubleshooting

Ollama Connection Fails

  1. Verify Ollama is running: systemctl status ollama or ollama serve
  2. Check the port: curl http://localhost:11434/api/tags
  3. Pull a model: ollama pull llama3.2
  4. If using a remote host, verify the OLLAMA_HOST env var or baseURL in config

License Invalid / Expired

  1. Check status: mbm license status
  2. Verify your device ID matches the license binding
  3. Re-apply the license key: mbm license apply MBM-XXXX-...
  4. Visit License & Keys to check your account status

Rate Limit Hit (429 Errors)

  1. Check your usage: mbm stats
  2. View daily limits at Usage dashboard
  3. Consider upgrading your plan for higher limits

RAG Not Working

  1. Ensure Docker is running: docker ps | grep mbm-rag
  2. Check setup: mbm rag setup
  3. Enable auto-sync: mbm rag enable
  4. Re-index: mbm rag index .
  5. Check status: mbm rag status

API Key Not Working

  1. Keys are shown only once at creation — if lost, revoke and create a new one
  2. Verify the key format: {prefix}-{32-char-hex}
  3. Check if the key was revoked at API Keys
  4. Ensure you have an active license for the tier
Still stuck? Visit your dashboard or contact support through the License & Keys page.