# cliente_prueba_http.py

import asyncio
from fastmcp import Client

async def main():
    async with Client("http://127.0.0.1:8080/mcp") as client:
        tools = await client.list_tools()
        for tool in tools:
            print(f"🔧 {tool.name} - {tool.description or 'sin descripción'}")

        # ✅ llamar a la herramienta correctamente
        result = await client.call_tool_mcp(name="esperar", arguments={"segundos": 5})
        print(f"\nResultado de 'saludar': {result.content[0].text}")

if __name__ == "__main__":
    asyncio.run(main())