1use std::collections::HashMap;
4use crate::ToolFilter;
5
6#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
8pub struct McpServiceConfig {
9 pub name: String,
11 pub command: String,
13 pub args: Option<Vec<String>>,
15 pub env: Option<HashMap<String, String>>,
17 #[serde(skip_serializing_if = "Option::is_none")]
19 pub tool_filter: Option<ToolFilter>,
20}
21
22impl McpServiceConfig {
23 pub fn new(name: String, command: String) -> Self {
25 Self {
26 name,
27 command,
28 args: None,
29 env: None,
30 tool_filter: None,
31 }
32 }
33
34 pub fn with_args(mut self, args: Vec<String>) -> Self {
36 self.args = Some(args);
37 self
38 }
39
40 pub fn with_env(mut self, env: HashMap<String, String>) -> Self {
42 self.env = Some(env);
43 self
44 }
45
46 pub fn with_tool_filter(mut self, filter: ToolFilter) -> Self {
48 self.tool_filter = Some(filter);
49 self
50 }
51}