pub struct McpEnv {
pub config_path: PathBuf,
pub store_path: PathBuf,
pub opener: BrowserOpener,
pub now: u64,
pub tools_dir: Option<PathBuf>,
pub credential_store: Option<Box<dyn CredentialStore>>,
pub allow_env_vars: Vec<String>,
}Expand description
Seams the real I/O of lev mcp depends on, injected so the command logic is
unit-testable without a browser, real config, or the real home directory.
Fields§
§config_path: PathBufPath to the config file to read and rewrite.
store_path: PathBufPath to the OAuth token store.
opener: BrowserOpenerHow to open the browser during a login.
now: u64Current Unix time, for token-expiry math.
tools_dir: Option<PathBuf>The global Rhai script-tools directory (<leviath-home>/tools/). lev mcp list also surfaces these tools (labeled script) so the listing covers
every external tool provider, not only MCP servers. None
disables the script scan (used by tests that only care about servers).
credential_store: Option<Box<dyn CredentialStore>>Where OAuth grants are kept, already resolved. lev mcp login writes a
refresh token, so it has to write it where the user asked for it to be
kept.
Resolved by the caller rather than here, and before any subcommand runs: a keychain that was asked for but cannot be reached has to fail the command outright, because falling back to the file would put a refresh token on disk that the user asked to keep out of it. Doing that once at the edge also means these code paths carry no error arm that only an unreachable keychain could take.
allow_env_vars: Vec<String>[security] allow_env_vars: which credential-shaped variables an MCP
server’s ${VAR} headers may interpolate.
Auto Trait Implementations§
impl !RefUnwindSafe for McpEnv
impl !UnwindSafe for McpEnv
impl Freeze for McpEnv
impl Send for McpEnv
impl Sync for McpEnv
impl Unpin for McpEnv
impl UnsafeUnpin for McpEnv
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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