Skip to main content
Glama
utils.py881 B
"""Utility functions for QuantConnect MCP Server""" import sys import logging logger = logging.getLogger(__name__) def safe_print(text): """Print text safely, handling emojis and MCP server context. Don't print to stderr when running as MCP server via uvx to avoid JSON parsing errors. Check if we're running as MCP server (no TTY and uvx in process name). """ # Don't print to stderr when running as MCP server via uvx to avoid JSON parsing errors # Check if we're running as MCP server (no TTY and uvx in process name) if not sys.stderr.isatty(): # Running as MCP server, suppress output to avoid JSON parsing errors logger.debug(f"[MCP Server] {text}") return try: print(text, file=sys.stderr) except UnicodeEncodeError: print(text.encode('ascii', errors='replace').decode(), file=sys.stderr)

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/taylorwilsdon/quantconnect-mcp'

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