pub struct McpJsonFile {
pub mcp_servers: HashMap<String, McpServerEntry>,
}Expand description
Represents an .mcp.json configuration file.
Fields§
§mcp_servers: HashMap<String, McpServerEntry>Implementations§
Source§impl McpJsonFile
impl McpJsonFile
Sourcepub fn save(&self, path: &Path) -> Result<(), String>
pub fn save(&self, path: &Path) -> Result<(), String>
Write the file to path as pretty-printed JSON.
Sourcepub fn into_entries(self, scope: McpScope) -> Vec<McpServerEntry>
pub fn into_entries(self, scope: McpScope) -> Vec<McpServerEntry>
Flatten the map into a Vec<McpServerEntry> with a given scope.
Sourcepub fn resolve_scope_paths() -> Vec<(McpScope, PathBuf)>
pub fn resolve_scope_paths() -> Vec<(McpScope, PathBuf)>
Recursively resolve .mcp.json paths for user, project, and local scopes.
Returns a list of (scope, path) to load, from lowest to highest precedence.
Sourcepub fn load_aggregated() -> Vec<McpServerEntry>
pub fn load_aggregated() -> Vec<McpServerEntry>
Load and merge .mcp.json files across User, Project, and Local scopes.
The resulting Vec<McpServerEntry> represents the flattened and merged
configuration where Local > Project > User. Only active entries
are retained per name.
Sourcepub async fn load_aggregated_async() -> Vec<McpServerEntry>
pub async fn load_aggregated_async() -> Vec<McpServerEntry>
Async version of load_aggregated.
Trait Implementations§
Source§impl Clone for McpJsonFile
impl Clone for McpJsonFile
Source§fn clone(&self) -> McpJsonFile
fn clone(&self) -> McpJsonFile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for McpJsonFile
impl Debug for McpJsonFile
Source§impl Default for McpJsonFile
impl Default for McpJsonFile
Source§fn default() -> McpJsonFile
fn default() -> McpJsonFile
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for McpJsonFile
impl<'de> Deserialize<'de> for McpJsonFile
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for McpJsonFile
impl RefUnwindSafe for McpJsonFile
impl Send for McpJsonFile
impl Sync for McpJsonFile
impl Unpin for McpJsonFile
impl UnwindSafe for McpJsonFile
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().