Skip to main content

walrus_daemon/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)]
9pub struct McpServerConfig {
10    /// Server name. If empty, the name will be the command.
11    #[serde(default)]
12    pub name: CompactString,
13    /// Command to spawn.
14    pub command: String,
15    /// Command arguments.
16    #[serde(default)]
17    pub args: Vec<String>,
18    /// Environment variables.
19    #[serde(default)]
20    pub env: BTreeMap<String, String>,
21    /// Auto-restart on failure.
22    #[serde(default = "default_true")]
23    pub auto_restart: bool,
24}
25
26fn default_true() -> bool {
27    true
28}