pub enum McpCommand {
Npx {
version: String,
},
Explicit(PathBuf),
OnPath,
}Expand description
How the MCP server entry (and the skill’s bootstrap commands) invoke mushroomdb.
The assistant host spawns the MCP server by command, so that command has
to resolve from its process, not from the shell install ran in. A bare
name only works when it resolves on the host’s PATH, and the one case where
that is provable is when the mushroomdb PATH resolves to is this very
executable. Everything else — npm’s Node shim, a different build, a local
target/release binary, no hit at all — pins the published package and
lets npx fetch it.
Variants§
Npx
npx -y mushroomdb@<version> … — the default, and the only form that
works from a machine where nothing is installed globally.
Explicit(PathBuf)
An absolute path the user named with --command.
OnPath
mushroomdb resolves on PATH and is this executable: the bare name
is safe and follows upgrades.
Implementations§
Source§impl McpCommand
impl McpCommand
Sourcepub fn json_entry(&self, sub: &str, db: &str) -> Value
pub fn json_entry(&self, sub: &str, db: &str) -> Value
The MCP server entry: {"command": …, "args": [… , sub, db]}.
Nothing here is shell-quoted. An MCP host spawns the command with an argv, so a path with a space in it is one element and quoting it would make the quotes part of the filename.
Sourcepub fn shell(&self) -> String
pub fn shell(&self) -> String
The same invocation as a command prefix for a POSIX shell, already quoted where quoting is needed.
Hook entries and the skill’s copy-paste lines are read by a shell, so
an explicit path has to survive a space in it. The bare name and the
npx form contain no metacharacters and are left as they read.
Trait Implementations§
Source§impl Clone for McpCommand
impl Clone for McpCommand
Source§fn clone(&self) -> McpCommand
fn clone(&self) -> McpCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for McpCommand
impl Debug for McpCommand
impl Eq for McpCommand
Source§impl PartialEq for McpCommand
impl PartialEq for McpCommand
impl StructuralPartialEq for McpCommand
Auto Trait Implementations§
impl Freeze for McpCommand
impl RefUnwindSafe for McpCommand
impl Send for McpCommand
impl Sync for McpCommand
impl Unpin for McpCommand
impl UnsafeUnpin for McpCommand
impl UnwindSafe for McpCommand
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.