Skip to main content

walrus_core/config/
mcp.rs

1//! MCP server configuration.
2
3use compact_str::CompactString;
4use serde::{Deserialize, Serialize};
5use std::collections::BTreeMap;
6
7/// MCP server configuration.
8#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(default)]
10pub struct McpServerConfig {
11    /// Server name. If empty, the name will be the command.
12    pub name: CompactString,
13    /// Command to spawn.
14    pub command: String,
15    /// Command arguments.
16    pub args: Vec<String>,
17    /// Environment variables.
18    pub env: BTreeMap<String, String>,
19    /// Auto-restart on failure.
20    pub auto_restart: bool,
21}
22
23impl Default for McpServerConfig {
24    fn default() -> Self {
25        Self {
26            name: CompactString::default(),
27            command: String::new(),
28            args: Vec::new(),
29            env: BTreeMap::new(),
30            auto_restart: true,
31        }
32    }
33}