Skip to main content
Glama
reverse_logger.py1.21 kB
import sys import datetime import os ARCHIVO_LOG = "mcp_server.log" def main(): try: sys.stdin.reconfigure(encoding='utf-8') except AttributeError: pass print(f"Logger iniciado. Escribiendo en {ARCHIVO_LOG} (Más reciente arriba)", file=sys.stderr) for linea in sys.stdin: marca_tiempo = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") contenido = linea.strip() if not contenido: continue entrada_formateada = f"[{marca_tiempo}] {contenido}\n" print(entrada_formateada.strip()) try: contenido_existente = "" if os.path.exists(ARCHIVO_LOG): try: with open(ARCHIVO_LOG, 'r', encoding='utf-8') as f: contenido_existente = f.read() except Exception: pass with open(ARCHIVO_LOG, 'w', encoding='utf-8') as f: f.write(entrada_formateada + contenido_existente) except Exception as e: print(f"Error escribiendo log: {e}", file=sys.stderr) if __name__ == "__main__": main()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kodexArg/syv-mcp-tools'

If you have feedback or need assistance with the MCP directory API, please join our Discord server