pub struct Config {
pub mode: TaskMode,
pub justfile_path: Option<String>,
pub allowed_dirs: Vec<PathBuf>,
pub init_template_file: Option<String>,
}Expand description
Runtime configuration for task-mcp.
Fields§
§mode: TaskModeFiltering mode for exposed recipes.
justfile_path: Option<String>Path to the justfile (relative or absolute).
allowed_dirs: Vec<PathBuf>Allowed working directories for session_start. Empty means no restriction (all directories allowed).
init_template_file: Option<String>Path to a custom justfile template used by the init tool.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load() -> Self
pub fn load() -> Self
Load configuration from .task-mcp.env (if present) and environment variables.
Priority: env var > .task-mcp.env > default.
Sourcepub fn is_workdir_allowed(&self, workdir: &Path) -> bool
pub fn is_workdir_allowed(&self, workdir: &Path) -> bool
Check whether workdir is permitted.
Returns true when allowed_dirs is empty (no restriction) or when
workdir starts with at least one entry in allowed_dirs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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