pub struct McpConfig {
pub profile: Option<String>,
pub allowlist: Option<HashMap<String, Vec<String>>>,
pub profile_hint_in_errors: bool,
}Expand description
[mcp] block in config.toml — v0.6.4 addition. Today this only
carries the named tool profile. v0.6.4 Track D will extend with
[mcp.allowlist] for per-agent capability gating.
Resolution for profile: CLI flag > AI_MEMORY_PROFILE env (both
merged by clap) > this config field > compiled default "core".
Fields§
§profile: Option<String>Named tool profile. One of core, graph, admin, power,
full, or a comma-separated custom list (e.g.,
core,graph,archive). Default core (v0.6.4 default flip).
allowlist: Option<HashMap<String, Vec<String>>>v0.6.4-008 — per-agent capability allowlist. Maps an agent_id
pattern to the families that agent may request via
memory_capabilities --include-schema family=<f>. Patterns
resolve to a Vec"*" is the default for agents not otherwise listed.
When the entire allowlist is absent (mcp.allowlist = None),
the gate is disabled — every caller may expand any family
(Tier-1 single-process semantics, profile flag rules).
Example config.toml:
[mcp.allowlist]
"alice" = ["core", "graph"]
"bob" = ["full"]
"*" = ["core"]profile_hint_in_errors: bool#1254 (MED, 2026-05-25) — error-oracle posture for
tools/call against a tool that exists but is not loaded
under the active profile.
Default false (production-secure): the daemon returns a
minimal "unknown tool: <name>" regardless of whether the
tool exists in another family. This prevents a lower-profile
client from probing the surface of a higher-profile tool set
(e.g. admin or power family names) by walking error
messages.
Set to true to restore the v0.6.4-002 helpful hint
(“tool ‘X’ is in family ‘Y’ which is not loaded under the
active profile. Restart with --profile <name> …”). The
hint is convenient for single-tenant dev environments where
every operator sees the full surface anyway, but leaks
family membership in any multi-tenant deployment.
Implementations§
Source§impl McpConfig
impl McpConfig
Sourcepub fn allowlist_decision(
&self,
agent_id: Option<&str>,
family: &str,
) -> AllowlistDecision
pub fn allowlist_decision( &self, agent_id: Option<&str>, family: &str, ) -> AllowlistDecision
v0.6.4-008 — resolve the allowlist decision for an agent requesting a family.
Returns:
AllowlistDecision::Disabledif the entire allowlist is absent (Tier-1 default — gate is off).AllowlistDecision::Allowif a matching pattern includes the requested family (or"full").AllowlistDecision::Denyif a pattern matches but does not list the family.AllowlistDecision::Denyif no pattern matches and there is no"*"wildcard.
Pattern matching: exact match wins; otherwise the wildcard
"*" is consulted. Multiple-pattern precedence follows
longest-prefix order with stable tie-break by config order
(since HashMap is unordered, we sort by key length
descending for the comparison).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for McpConfig
impl<'de> Deserialize<'de> for McpConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for McpConfig
impl RefUnwindSafe for McpConfig
impl Send for McpConfig
impl Sync for McpConfig
impl Unpin for McpConfig
impl UnsafeUnpin for McpConfig
impl UnwindSafe for McpConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more