Skip to main content

McpManager

Struct McpManager 

Source
pub struct McpManager { /* private fields */ }

Implementations§

Source§

impl McpManager

Source

pub fn new( user_config_path: PathBuf, project_root: Option<PathBuf>, trust_store_path: PathBuf, auth_store_path: PathBuf, ) -> Result<Self, String>

Source

pub fn from_default_paths(project_root: Option<&Path>) -> Result<Self, String>

Source

pub fn empty_in(base_dir: &Path) -> Self

Source

pub fn with_env_lookup(self, lookup: EnvLookup) -> Self

Source

pub fn with_timeouts( self, http_timeout: Duration, callback_timeout: Duration, ) -> Self

Source

pub fn auth_store_path(&self) -> &Path

Source

pub fn user_config_path(&self) -> &Path

Source

pub fn trust_store_path(&self) -> &Path

Source

pub fn redact_text(&self, text: &str, root: &Path) -> String

Source

pub fn connect_all_in_background(self: &Arc<Self>)

Source

pub fn connect_all(&self)

Source

pub fn list_servers(&self) -> Vec<McpServerSnapshot>

Source

pub fn get_server(&self, name: &str) -> Option<McpServerSnapshot>

Source

pub fn list_tools(&self) -> Vec<McpToolInfo>

Source

pub fn connect_server(&self, name: &str) -> Result<McpServerSnapshot, String>

Source

pub fn reconnect_server(&self, name: &str) -> Result<McpServerSnapshot, String>

Source

pub fn disconnect_server(&self, name: &str) -> Result<McpServerSnapshot, String>

Source

pub fn set_enabled( &self, name: &str, enabled: bool, ) -> Result<McpServerSnapshot, String>

Source

pub fn set_approval_policy( &self, name: &str, policy: ApprovalPolicy, ) -> Result<McpServerSnapshot, String>

Source

pub fn trust_project_server( &self, name: &str, ) -> Result<McpServerSnapshot, String>

Source

pub fn add_server( &self, name: &str, config: ServerConfig, replace: bool, ) -> Result<McpServerSnapshot, String>

Source

pub fn remove_server(&self, name: &str) -> Result<(), String>

Source

pub fn logout_server(&self, name: &str) -> Result<McpServerSnapshot, String>

Source

pub fn reload_config(&self) -> Result<Vec<McpServerSnapshot>, String>

Source

pub fn update_server_oauth( &self, name: &str, patch: OAuthConfigPatch, ) -> Result<McpServerSnapshot, String>

Source

pub fn start_oauth(self: &Arc<Self>, name: &str) -> Result<String, String>

Source

pub fn tool_access( self: &Arc<Self>, approver: Option<Arc<dyn Approver>>, ) -> Arc<dyn McpToolAccess> ⓘ

Source

pub fn is_deferred_mode(&self) -> bool

Source

pub fn loaded_tool_names(&self) -> Vec<String>

Source

pub fn tool_specs(&self) -> Vec<ToolSpec>

Source

pub fn execute_exposed_tool( &self, exposed_name: &str, args: &Value, root: &Path, approver: Option<&Arc<dyn Approver>>, ) -> Option<ToolOutcome>

Auto Trait Implementations§

§

impl !Freeze for McpManager

§

impl Forget for McpManager

§

impl Move for McpManager

§

impl RefUnwindSafe for McpManager
where Mutex<ManagerState>: RefUnwindSafe,

§

impl Send for McpManager
where RawVecInner: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send, Mutex<ManagerState>: Send,

§

impl Sync for McpManager
where RawVecInner: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync, Mutex<ManagerState>: Sync,

§

impl Unpin for McpManager
where *const u8 is !null: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin, Align4<u32>: Unpin, Align1<u8>: Unpin, *const LeafNode<String, ManagedServer> is !null: Unpin, Box<(String, ManagedServer)>: Unpin,

§

impl UnsafeUnpin for McpManager
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const LeafNode<String, String> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(String, String)>>: UnsafeUnpin, Align4<u32>: UnsafeUnpin, Align1<u8>: UnsafeUnpin, *const LeafNode<String, ManagedServer> is !null: UnsafeUnpin, PhantomData<Box<(String, ManagedServer)>>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin,

§

impl UnwindSafe for McpManager
where RawVecInner: UnwindSafe, BTreeMap<String, String>: UnwindSafe, Mutex<ManagerState>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.