use crate::ToolFilter;
use std::collections::HashMap;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct McpServiceConfig {
pub name: String,
pub command: String,
pub args: Option<Vec<String>>,
pub env: Option<HashMap<String, String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tool_filter: Option<ToolFilter>,
}
impl McpServiceConfig {
pub fn new(name: String, command: String) -> Self {
Self {
name,
command,
args: None,
env: None,
tool_filter: None,
}
}
pub fn with_args(mut self, args: Vec<String>) -> Self {
self.args = Some(args);
self
}
pub fn with_env(mut self, env: HashMap<String, String>) -> Self {
self.env = Some(env);
self
}
pub fn with_tool_filter(mut self, filter: ToolFilter) -> Self {
self.tool_filter = Some(filter);
self
}
}