| Name | Type | Description |
|---|---|---|
names* | Iterable[str] | Server names to add to the allowlist. Blank/whitespace-only names are ignored; a call with no usable names is a no-op success. |
config_path | Path | None | Default: NoneConfig file to write. Defaults to |
project_root | str | Path | None | Default: None |
server_configs | Mapping[str, JsonValue] | None | Default: None |
Persist project-scoped MCP server approvals.
Backs the interactive approval prompt's "always allow" choice: the given
names are added to the user-level config.toml allowlist with each server
definition's fingerprint. Fixed remote URLs use the local Git repository
identity and are shared by its linked worktrees. Local commands and
interpolated remote URLs use the exact worktree root. A different clone or
changed definition asks again.
Defaults to the user-level config (DEFAULT_CONFIG_PATH), the sole source
load_mcp_server_trust_lists reads the allowlist from — so writing to the
user's home config is what preserves the read-side trust boundary (a
committed .mcp.json can never self-approve). Any name being persisted is
also pruned from the deprecated flat [mcp].enabled_project_servers key
(the key is removed once empty), migrating callers off the ignored legacy
list. The write is atomic (tempfile.mkstemp + Path.replace) and holds
_config_write_lock across the whole read-modify-write, matching
suppress_warning.
Project root whose MCP server definitions were approved.
Current server definitions keyed by server name.