pub struct MCPConfigLoader;Expand description
Configuration loader for MCP using ricecoder-storage
Implementations§
Source§impl MCPConfigLoader
impl MCPConfigLoader
Sourcepub fn load_from_file<P: AsRef<Path>>(path: P) -> Result<MCPConfig>
pub fn load_from_file<P: AsRef<Path>>(path: P) -> Result<MCPConfig>
Load MCP configuration from a file
Supports YAML and JSON formats. Automatically detects format based on file extension.
Sourcepub fn load_from_string(
content: &str,
format: ConfigFormat,
) -> Result<MCPConfig>
pub fn load_from_string( content: &str, format: ConfigFormat, ) -> Result<MCPConfig>
Load MCP configuration from a string
Sourcepub fn load_with_precedence(
project_dir: Option<&Path>,
user_dir: Option<&Path>,
) -> Result<MCPConfig>
pub fn load_with_precedence( project_dir: Option<&Path>, user_dir: Option<&Path>, ) -> Result<MCPConfig>
Load MCP configuration from multiple sources with precedence
Loads configuration from project, user, and default locations. Later sources override earlier ones.
Precedence (highest to lowest):
- Project-level:
.ricecoder/mcp-servers.yaml,.ricecoder/custom-tools.json,.ricecoder/permissions.yaml - User-level:
~/.ricecoder/mcp-servers.yaml,~/.ricecoder/custom-tools.json,~/.ricecoder/permissions.yaml - Built-in defaults
Sourcepub fn load_from_directory<P: AsRef<Path>>(dir: P) -> Result<MCPConfig>
pub fn load_from_directory<P: AsRef<Path>>(dir: P) -> Result<MCPConfig>
Load MCP configuration from a directory
Looks for:
mcp-servers.yamlormcp-servers.jsonfor server configurationscustom-tools.jsonorcustom-tools.mdfor custom tool definitionspermissions.yamlorpermissions.jsonfor permission configurations
Auto Trait Implementations§
impl Freeze for MCPConfigLoader
impl RefUnwindSafe for MCPConfigLoader
impl Send for MCPConfigLoader
impl Sync for MCPConfigLoader
impl Unpin for MCPConfigLoader
impl UnwindSafe for MCPConfigLoader
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