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 | 50K | 1 | 1 | Basic models, RAG, Export |
| Pro | 200K | 5 | 1 | All models, Priority Queue, API |
| Business | 500K | 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
Activate 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-31Applying a License Key
License keys use the MBM-XXXX-XXXX-XXXX-XXXX format:
mbm license apply MBM-XXXX-XXXX-XXXX-XXXXConnecting 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 |
| 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 |
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 |
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
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
| Feature | Free | Pro | Business |
|---|---|---|---|
| Daily tokens | 50,000 | 200,000 | 500,000 |
| Monthly tokens | 500,000 | 5,000,000 | 10,000,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 |
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 |
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
