Skip to content

MCP server configuration (mcp.json) ​

MCP configuration lives in a separate mcp.json file rather than the main config.json.

LevelPath
Global<config-dir>/mcp.json
Project<workspace>/.mogick/mcp.json
HostACP session injection, no writing to local files

For servers with the same name, precedence is ACP host > project > global. Servers with different names are merged. MOGICK_CONFIG_FILE does not change where Mogick loads MCP configuration.

servers uses objects whose keys are server names. Legacy arrays can still be read, but Mogick uses the object format for new writes.

json
{
  "servers": {
    "local-tool": {
      "type": "local",
      "transport": "stdio",
      "enabled": true,
      "command": ["python3", "-m", "my_mcp_server", "--port", "8080"],
      "env": { "API_KEY": "<api-key>" }
    }
  }
}

Choose a transport ​

ScenariotypetransportRequired fields
Local child processlocalstdiocommand
Remote Streamable HTTPremotehttpurl
Compatible with legacy SSEremotesseurl

When transport is omitted, local servers default to stdio and remote servers default to http. Use SSE only when a legacy server explicitly requires it.

Remote example ​

json
{
  "servers": {
    "remote-api": {
      "type": "remote",
      "transport": "http",
      "enabled": true,
      "url": "https://mcp.example.com/api",
      "headers": { "Authorization": "Bearer <token>" }
    }
  }
}

headers containing credentials should not be committed to version control.

Field reference ​

Common fields ​

FieldTypeRequiredDefault value/Description
typestringRecommendedlocal or remote; otherwise inferred from url and transport
transportstringNostdio, http, or sse
enabledboolNoDefault false; will not connect if not enabled
startupstringNoeager (default) or lazy
timeoutintNoConnection/wait timeout in milliseconds; 0 uses the client default

Local fields ​

FieldTypeRequiredDescription
commandstring[]YesThe first element is the executable; remaining elements are arguments
envobjectNoAppend or overwrite literal environment variables to the child process

Local processes inherit Mogick's process environment. env values do not expand ${VAR}; to inject secrets from outside, let the server read inherited environment variables directly instead of writing placeholders into the configuration.

Relative command paths are resolved according to the current working directory when Mogick is started, rather than according to the mcp.json directory. It is recommended to use absolute paths.

Remote fields ​

FieldTypeRequiredDescription
urlstringYesMCP service address
headersobjectNoHTTP request headers sent with the request

Eager and lazy startup ​

  • startup: "eager": Connect when the process or session starts.
  • startup: "lazy": Keep cold until triggered by mcp.connect, Skill or first call.
  • Unknown startup value falls back to eager and logs a warning.

Lazy startup works well for slow, infrequently used servers or servers with large tool schemas. When a session closes, Mogick disconnects an on-demand server if no other session is using it.

Management and hot updates ​

bash
mogick mcp list
mogick mcp setup

mogick mcp setup is an interactive wizard; it does not accept server names or legacy configuration flags. In the TUI, use /mcp to view server sources and connection status or to start and stop servers.

When MCP configuration changes during a session, Mogick reconciles added, removed, enabled, disabled, or modified servers while preserving unchanged connections. The active task keeps its current tool snapshot; the next turn uses the updated toolset.

Status ​

StatusMeaning
disabledenabled is false
coldLazy server has not connected yet
connectingStarting or handshaking
connectedConnected and ready
failedStartup, network, or protocol handshake failed

Troubleshooting ​

Run mogick mcp list and mogick doctor. For step-by-step diagnosis, see Troubleshoot MCP connections and tools.

Path placeholders <config-dir> and <db-path> refer to the effective profile/channel paths; see Data directories.