pub struct McpConfig {
pub profile: Option<String>,
pub allowlist: Option<HashMap<String, Vec<String>>>,
}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"]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,
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