| Name | Type | Description |
|---|---|---|
explicit_config_path | str | None | Default: NoneExtra config file to layer on top of auto-discovered configs. |
no_mcp | bool | Default: FalseIf |
trust_project_mcp | bool | None | Default: None |
project_context | ProjectContext | None | Default: None |
additional_configs | tuple[dict[str, Any], ...] | Default: () |
stateless | bool | Default: False |
session_manager | MCPSessionManager | None | Default: None |
Resolve MCP config and load tools.
Auto-discovers configs from standard locations and merges them. When
explicit_config_path is provided it is added as the highest-precedence
source and errors in that file are fatal.
Controls project-level server trust.
Applies to stdio and remote (http/sse) servers alike — remote entries
are gated too because an attacker-controlled .mcp.json can SSRF or
exfiltrate ${VAR} headers during the discovery preflight.
True: grant whole-config trust (all servers load).False / None: no whole-config trust. None is treated
identically to False — the persistent trust store this once
consulted was removed, so project servers load only via the
user's scoped approvals / env allowlist described below.Regardless of this flag, the user-level allow/deny policy
([mcp].enabled_project_server_approvals,
[mcp].disabled_project_servers, and env equivalents via
load_mcp_server_trust_lists) is applied: scoped approvals load
from an otherwise-untrusted config only when the project root and
server fingerprint match, and explicitly denied servers are dropped
even from a trusted one.
Explicit project path context for config discovery and trust resolution.
Config layers injected by higher-level composition,
such as plugin-provided MCP servers. Installing a plugin is treated
as the user's trust decision for its bundled servers, so these load
without per-server approval — but the user-level deny policy still
applies (an explicitly disabled server stays disabled), and if that
policy cannot be read the servers fail closed rather than bypass a
saved rejection. A malformed layer (non-dict, or a non-mapping
mcpServers) is skipped and surfaced as a config error.
When True, do not return an owned runtime session manager.
Optional externally owned runtime session manager.