#!/usr/bin/env python3 """ HuggingFace MCP Agent Runner This script provides a CLI interface to run HuggingFace MCP agents. Usage: python run-agent.py """ import sys import asyncio from pathlib import Path def main(): if len(sys.argv) != 2: print("Usage: python run-agent.py ") print("Example: python run-agent.py my-agent/agent.json") sys.exit(1) config_path = sys.argv[1] if not Path(config_path).exists(): print(f"Error: Config file '{config_path}' not found") sys.exit(1) try: from huggingface_hub.inference._mcp.cli import run_agent asyncio.run(run_agent(config_path)) except KeyboardInterrupt: print("\nAgent stopped by user") except Exception as e: print(f"Error running agent: {e}") sys.exit(1) if __name__ == "__main__": main()