Skip to main content
Glama

IBKR TWS MCP Server

by haymant
main.py1.25 kB
import uvicorn from src.server import app import os import logging # Filter to suppress known harmless ib-async warnings class IBAsyncTickTypeFilter(logging.Filter): """Suppress tickType warnings from ib-async that don't affect functionality.""" def filter(self, record): # Suppress "tickString with tickType XX: unhandled value" errors # These are informational - the library receives tick types it doesn't recognize # but this doesn't affect the streaming functionality if "tickString with tickType" in record.getMessage() and "unhandled value" in record.getMessage(): return False return True if __name__ == "__main__": # Apply the filter to suppress harmless tickType warnings # The ib_async library uses logger "ib_async.wrapper" (see wrapper.py:250) tick_filter = IBAsyncTickTypeFilter() # Apply to the specific ib_async.wrapper logger ib_logger = logging.getLogger("ib_async.wrapper") ib_logger.addFilter(tick_filter) # Also apply to root logger as backup logging.getLogger().addFilter(tick_filter) host = os.getenv("SERVER_HOST", "0.0.0.0") port = int(os.getenv("SERVER_PORT", 8000)) uvicorn.run(app, host=host, port=port)

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/haymant/tws-mcp'

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