pub fn get_mcp_server(
name: &str,
) -> Result<(ServerId, ServerConfig, McpServerEntry)>Expand description
Retrieves a named server from ~/.claude/mcp.json.
§Arguments
name- Server name as defined undermcpServersinmcp.json
§Returns
A tuple of (ServerId, ServerConfig, McpServerEntry):
ServerId— typed server identifierServerConfig— ready-to-use connection config forIntrospectorMcpServerEntry— raw entry for display purposes (command, args, env)
§Errors
Returns an error if the config file is missing, malformed, or the named server is not present.
§Examples
use mcp_execution_cli::commands::common::get_mcp_server;
let (id, _config, entry) = get_mcp_server("github").unwrap();
assert_eq!(id.as_str(), "github");
println!("command: {}", entry.command);