loadMcpConfigFile function
Load MCP server configs from a JSON file (.mcp.json format).
Implementation
Future<List<McpServerConfig>> loadMcpConfigFile(String path) async {
final file = File(path);
if (!await file.exists()) return const [];
try {
final content = await file.readAsString();
final json = jsonDecode(content) as Map<String, dynamic>;
return _parseConfigs(json);
} catch (_) {
return const [];
}
}