Skip to main content

Module mcp

Module mcp 

Source

Functions§

has_server
Whether mcpServers.<id> already exists. Used as a preflight so an install can refuse before writing anything, rather than discovering the collision after the capability’s files are already on disk.
is_toml
Whether the file is a TOML config, such as Codex’s .codex/config.toml. A user hand-edits that file, so it is edited in place with its comments and formatting kept, rather than re-serialised.
register_server
Insert or replace mcpServers.<id> with entry, leaving every other key in the file untouched.
register_tool
remove_tool
servers_key
The object MCP servers live under: mcpServers in a harness’s MCP config file, mcp in OpenCode’s opencode.json, mcp_servers in Codex’s config.toml.
toml_entry
The mcp_servers.<id> table of a TOML config as a JSON value, for the same hash managed_mcp_entry_baseline computes from the adapter’s entry, without the settings policy rules own. Ok(None) when the file or the entry is absent; an error when the file is not TOML.
validate_config