Skip to main content

load_server_from_config

Function load_server_from_config 

Source
pub fn load_server_from_config(name: &str) -> Result<(ServerId, ServerConfig)>
Expand description

Loads server configuration from ~/.claude/mcp.json by server name.

Convenience wrapper around get_mcp_server that drops the raw entry.

§Arguments

  • name - Server name from mcp.json (e.g., "github")

§Errors

Returns an error if the config file is missing, malformed, or the server name is not present.

§Examples

use mcp_execution_cli::commands::common::load_server_from_config;

let (id, config) = load_server_from_config("github").unwrap();
assert_eq!(id.as_str(), "github");