Spaces:
Runtime error
Runtime error
| """ | |
| Module for loading MCP configuration from JSON file. | |
| """ | |
| import json | |
| import os | |
| from typing import Dict, Any | |
| def load_mcp_config() -> Dict[str, Any]: | |
| """ | |
| Load MCP configuration from JSON file. | |
| Returns: | |
| Dict[str, Any]: MCP configuration dictionary | |
| """ | |
| config_path = os.path.join(os.path.dirname(__file__), "mcp_config.json") | |
| try: | |
| if os.path.exists(config_path): | |
| with open(config_path, 'r') as f: | |
| config = json.load(f) | |
| return config | |
| else: | |
| print(f"MCP config file not found at {config_path}. Using empty config.") | |
| return {} | |
| except Exception as e: | |
| print(f"Failed to load MCP config from {config_path}: {str(e)}") | |
| return {} | |
| # Load the configuration when the module is imported | |
| mcp_config = load_mcp_config() | |