Skip to main content

CODE_MODE_KEY

Constant CODE_MODE_KEY 

Source
pub const CODE_MODE_KEY: &str = "codemode";
Expand description

OpenCode 2.x per-server MCP key: “Expose this server’s tools through Code Mode. Defaults to true.” Under Code Mode the model sees only part of a server’s tools, as functions inside execute, so ctx_read and ctx_search drop out of view (#2295). lean-ctx sets it to false.

OpenCode 1.x validates MCP entries strictly: with this key the whole config is rejected (“Configuration is invalid … Invalid input mcp.lean-ctx”, observed with 1.2.15). The key is therefore added only when the installed OpenCode is known to be 2.x or newer; see code_mode_key_supported.