zagens-cli 0.8.3

Zagens headless CLI + HTTP/SSE runtime sidecar (`zagens`, `zagens-runtime` binaries)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! MCP config load/save helpers for CLI commands.

use std::path::Path;

use anyhow::{Result, anyhow};

use crate::mcp::McpConfig;

pub fn load_mcp_config(path: &Path) -> Result<McpConfig> {
    if !path.exists() {
        return Ok(McpConfig::default());
    }
    let contents = std::fs::read_to_string(path)
        .map_err(|e| anyhow!("Failed to read MCP config {}: {e}", path.display()))?;
    serde_json::from_str(&contents).map_err(|e| anyhow!("Failed to parse MCP config: {e}"))
}