Skip to main content
Glama
logger.py719 B
""" Logging utilities for MCP server. Logs to stderr to keep stdout clean for JSON-RPC communication. """ import sys from datetime import datetime def log(message, level="INFO"): """ Write a log message to stderr. Args: message: The log message level: Log level (INFO, ERROR, DEBUG, etc.) """ timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") print(f"[{timestamp}] [{level}] {message}", file=sys.stderr, flush=True) def log_error(message): """Log an error message.""" log(message, "ERROR") def log_debug(message): """Log a debug message.""" log(message, "DEBUG") def log_info(message): """Log an info message.""" log(message, "INFO")

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/jubeju555/MCPServer-1'

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