# Configuration: Models, Roles, and MCP Config in TOML Configure Octomind's models, roles, tools, and runtime limits in TOML, including file locations, merge order, and overrides. This guide is for users maintaining their own TOML configuration. ## Create and Inspect the Configuration Octomind creates the default configuration automatically when no TOML configuration exists. You can also create or inspect it explicitly: ```bash octomind config # create config.toml when absent octomind config --show # display key effective settings octomind config --validate # validate the merged configuration octomind config --upgrade # run the current migration explicitly octomind configure # interactive provider, credentials, and model setup ``` On the first interactive `octomind` or `octomind run` launch with a missing config, setup offers the hub, your own provider, or skip before writing the template. `octomind configure` edits only the main and compression model names while preserving comments and other settings; credentials are stored separately in the user `.env`. The default template is embedded in the binary from `config-templates/default.toml`. Older configurations are upgraded automatically during load; a migration writes a versioned backup beside the original before replacing it. ## File Locations | Platform | Data directory | Main config file | |----------|----------------|------------------| | macOS | `~/.local/share/octomind/` | `~/.local/share/octomind/config/config.toml` | | Linux | `~/.local/share/octomind/` | `~/.local/share/octomind/config/config.toml` | | Windows | `%LOCALAPPDATA%/octomind/` | `%LOCALAPPDATA%/octomind/config/config.toml` | The data directory also contains saved sessions, logs, cache data, and taps. Two environment variables relocate configuration and state: | Variable | Effect | |----------|--------| | `OCTOMIND_DATA_DIR` | Replaces the platform data directory for config and other persistent state | | `OCTOMIND_CONFIG_PATH` | Selects a specific main config file; its parent becomes the multi-file merge directory | For a separate persistent setup, set the data directory before starting Octomind: ```bash OCTOMIND_DATA_DIR="$HOME/.local/share/octomind-demo" octomind config --show ``` To load an existing alternate configuration, use its absolute path. All TOML files alongside it also load: ```bash OCTOMIND_CONFIG_PATH="$HOME/.config/octomind/config.toml" octomind config --validate ``` `OCTOMIND_CONFIG_PATH` does not relocate credentials: the user `.env` remains under `/config/`. Host-local sockets and PID files use the system runtime/temp directory rather than `OCTOMIND_DATA_DIR`. With a custom config path, `config --show` still labels its output with the standard config path, and `config --upgrade` targets that standard path. Normal loading migrates the selected custom file automatically. ## Core Settings The shipped root settings begin with the following. Edit these existing keys before any TOML table header; do not append them beneath `[model]`. Leave `version` to the migration system. ```toml version = 25 log_level = "info" default = "assistant" sandbox = false telemetry = true commit_attribution = "Co-Authored-By: Octomind <345424151+octomindat3am@users.noreply.github.com>" mcp_response_tokens_threshold = 20000 max_session_tokens_threshold = 300000 cache_keepalive_enabled = false enable_markdown_rendering = true markdown_theme = "default" max_session_spending_threshold = 0.0 max_request_spending_threshold = 0.0 auto_capabilities = true ``` The `default` value is the tag used when `octomind run` receives no tag. `assistant` is the global assistant agent from the built-in `muvon/tap`. A local role in `[[roles]]` with the same name as a tap agent takes priority over it. List themes and select one with: ```bash octomind config --list-themes octomind config --markdown-theme dark ``` For every root field and validation rule, see the [Configuration Reference](../reference/03-config-reference.md). ## Model Profiles and Purposes Octomind makes requests for exactly two purposes of its own: | Purpose | Configuration | Used for | |---------|---------------|----------| | `main` | `[model]` | The active session conversation and its cache keepalive | | `compression` | `[compression.model]` | Conversation-compression decisions and summaries | The main profile is complete and is the inheritance baseline: ```toml [model] name = "octohub:auto" reasoning_effort = "medium" max_tokens = 32768 max_retries = 1 retry_timeout = 30 request_timeout_seconds = 300 ``` `[compression.model]` and `[roles.model]` accept the same fields as partial overrides; omitted values inherit from `[model]`. The shipped template gives compression its own complete profile, named `octohub:auto`. A plugin such as Besydr chooses its own models in its own configuration, not here. Model names must use `provider:model`. For the interactive CLI, model-name precedence is: ```text runtime override > active role profile > tap model mapping > main [model] ``` For example, after configuring the provider credential: ```bash octomind run -m 'openai:gpt-5.6-sol' ``` This changes the session model name. Compression keeps its own model profile; configure it too when moving away from OctoHub. See [AI Providers](04-providers.md#bring-your-own-keys). ## Roles and Tags A name selects a local `[[roles]]` entry, or else a tap agent of that name. A tap agent tag is `` for the base agent of a namespace (`developer`) or `:` for a variant from a private tap (`acme:reviewer`); `:default` is the base agent. See [Roles](06-roles.md) for complete examples, profile inheritance, and tool permissions. ## MCP Servers The default registry declares four built-in MCP servers: | Server | Tool group | |--------|------------| | `core` | `recall` when compression attention or its governance is enabled | | `orchestration` | Tap, schedule, and monitor tools | | `runtime` | MCP, skill, and capability management | External servers use `http` or `stdio`. For stdio, set `PROJECT_MCP_COMMAND` to the absolute path of your installed MCP server executable; this example assumes it speaks MCP on stdio without arguments. Add its required arguments to `args` if needed. Export the path in the shell that will launch Octomind (replace the user-supplied path): ```bash export PROJECT_MCP_COMMAND="/path/to/installed/mcp-server" ``` Save this definition as `mcp-project.toml` in the config directory: ```toml [[mcp.servers]] name = "project_tools" type = "stdio" command = "{{ENV:PROJECT_MCP_COMMAND}}" args = [] timeout_seconds = 30 tools = [] auto_bind = ["developer"] ``` Then start the matching role and inspect the server: ```bash octomind run developer ``` ```text /mcp ``` `auto_bind` matches exact role names. For a newly added reference, it also adds a `project_tools:*` grant when the role has a nonempty allowlist. Registration alone does not enable a server; use `auto_bind` or a role's `server_refs`. HTTP header values support `{{ENV:KEY}}`; without an explicit `Authorization` header, the HTTP client can use MCP authorization discovery. See [MCP Tools](07-mcp-tools.md) and [Config Reference](../reference/03-config-reference.md#mcp) for HTTP setup. ## Multi-File Configuration Octomind merges every `*.toml` file in the selected config directory: 1. `config.toml` loads first. 2. Other regular TOML files load alphabetically. 3. Files named `mcp-*.toml` load last; `mcp.toml` is a regular file. 4. Tables merge recursively and later scalar values replace earlier ones. 5. Arrays of tables are concatenated; entries with the same `name` are deduplicated with the last entry kept. 6. Other arrays are replaced by the later value. This makes a file such as `mcp-project.toml` an explicit override for a same-named server declared earlier. The last same-named array entry replaces the whole entry, so repeat all required server or role fields. Only the literal filename `config.toml` gets first priority, even with `OCTOMIND_CONFIG_PATH` set. For example, put this partial override in `settings.toml` alongside `config.toml`, then validate the merged result: ```toml log_level = "debug" [model] reasoning_effort = "high" ``` ```bash octomind config --validate ``` ## Tap and Capability Overrides `[capabilities]` selects a provider file inside a tap. When a capability has no override, its provider name is `default`: ```toml [capabilities] codesearch = "octocode" ``` `[taps]` changes only the model name for a tap agent; the rest of the main model profile remains inherited until an active role profile overrides it: ```toml [taps] "developer" = "ollama:glm-5.3" ``` These examples require the selected capability provider file in a tap and the selected model in Ollama. Apply either override to the existing table, then run: ```bash octomind run developer ``` The built-in tap and the revision of it to serve are set with `[registry] tap` and `ref`; see the [Configuration Reference](../reference/03-config-reference.md). ## Project Instructions and Template Variables When `AGENTS.md` exists in the working directory, Octomind loads its non-empty contents into a new session as project instructions and expands the same placeholders used by role `system` and `welcome` text. For example, place this text in your project's `AGENTS.md`: ```text Working directory: {{CWD}} Explain your proposed changes before editing files. Preserve unrelated changes. ``` | Placeholder | Value | |-------------|-------| | `{{CWD}}` | Current working directory | | `{{ROLE}}` | Active role, or `unknown` when no role was supplied to expansion | | `{{DATE}}` | Current date and timezone | | `{{SHELL}}` | Current shell information | | `{{OS}}` | Operating-system information | | `{{BINARIES}}` | Detected development tools | | `{{GIT_STATUS}}` | Git status, or an empty string when unavailable | | `{{GIT_TREE}}` | Project file tree, or an empty string when unavailable | | `{{README}}` | Root README content, or an empty string when unavailable | | `{{SYSTEM}}` | Combined shell, OS, directory, and tool information | | `{{CONTEXT}}` | Combined README, Git status, and file-tree context | Inspect context values with: ```bash octomind vars # list names octomind vars --preview # preview values (-p) octomind vars --expand # print full values (-e) ``` `octomind vars` additionally reports `{{HOME}}`, but `{{HOME}}` is not expanded in role prompts or `AGENTS.md`. Conversely, role prompt expansion supports `{{ROLE}}`, while the standalone `vars` command has no active role value to list. ## Troubleshooting **Why is a config edit ignored?** Check later files in the merge directory, and check whether the key is beneath the right table header. Validate after editing: ```bash octomind config --validate octomind config --show ``` **Why does my exported credential lose to another value?** Loading order is shell environment, user `/config/.env`, then working-directory `.env`; each later file overrides earlier values. See [AI Providers](04-providers.md#environment-file-precedence) for examples. ## See also - [Configuration Reference](../reference/03-config-reference.md) — complete field reference - [Environment Variables](../reference/04-environment-variables.md) — runtime and credential variables - [AI Providers](04-providers.md) — model gateways and provider setup - [Compression](08-compression.md) — compression behavior and configuration - [Plugins and the Supervisor](14-supervisor.md) — the `plugins` list and what Besydr does for octomind - [Workflows](09-workflows.md) — external workflow configuration