-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (30 loc) · 1.02 KB
/
main.py
File metadata and controls
38 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""
Trakt.tv MCP Server
A Model Context Protocol server that provides AI assistants with access to Trakt.tv API,
enabling TV show tracking, watchlist management, and viewing history queries.
"""
import sys
from src.utils.logger import get_logger
from src.server import mcp
logger = get_logger(__name__)
def main() -> None:
"""
Entry point for the Trakt MCP server.
Usage:
python -m trakt_mcp_server # stdio (default)
python -m trakt_mcp_server --http # Streamable HTTP on port 8000
"""
try:
if "--http" in sys.argv:
logger.info(f"Starting Streamable HTTP server on port 8000...")
mcp.run(transport="streamable-http", host="0.0.0.0")
else:
logger.info("Starting stdio server...")
mcp.run(transport="stdio")
except KeyboardInterrupt:
logger.info("Server stopped by user")
except Exception as e:
logger.exception(f"Fatal error: {e}")
raise
if __name__ == "__main__":
main()