Skip to main content

walrus_core/config/
mcp.rs

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