Skip to main content

Module config

Module config 

Source
Expand description

The two configuration tiers a tcode run reads MCP servers from (#5428).

Why: ADR-0060 decision 2 puts ONE list of configured MCP servers at ~/.trusty-tools/mcp/servers.toml, owned by trusty-mcp and read by both harnesses. trusty-agents already reads it (crate::mcp::shared there); this is trusty-code’s half. The second tier is the project, because a repo is where “this codebase needs that connector” is actually known — but a repo is also UNTRUSTED content, so the project tier passes through super::trust before it reaches the resolver.

What: resolve_at loads the global file, reads <project>/.trusty-code/mcp.toml through crate::paths::resolve_project_entry (which brings the .claude/ compatibility lookup with it), runs the trust gate, and hands both to trusty_mcp::config::resolve — the ONE resolver (ADR-0060 decision 5). Nothing here does precedence arithmetic of its own.

Failure is fail-open-and-visible, never a silent empty catalog: a file that exists and does not parse yields zero servers from that tier PLUS an McpIssue and a tracing::warn! naming the path. See super::tests::config_tests::a_malformed_global_file_yields_zero_servers_and_an_issue — a plain code span, not a link: the test modules are #[cfg(test)] and do not exist in rustdoc’s public pass.

Test: super::tests::config_tests — the whole module.

Structs§

McpIssue
One thing wrong with an MCP configuration file, or one entry refused.
ProjectOverrides
The project tier’s override table, as written in mcp.toml.
ResolvedMcp
Both tiers, layered, with everything that went wrong on the way.
ServerStatus
Whether one resolved server can actually be connected to.

Enums§

McpTier
Which configuration tier a server or a finding came from.

Constants§

PROJECT_MCP_FILE
The project-tier file name, resolved beneath the winning config root.

Functions§

load_global
Load the global tier, fail-open with a visible finding.
read_project_overrides
Read <project>/.trusty-code/mcp.toml, fail-open with a visible finding.
resolve_at
Layer the global tier with the project tier’s TRUSTED overrides.