We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dan-bailey/todoist-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
cli.py•1.03 KiB
#!/usr/bin/env python3
"""Command-line entry point for the Todoist MCP server."""
import os
from dotenv import load_dotenv
def cli():
"""Main CLI entry point."""
# Load environment variables from .env file if it exists
load_dotenv()
# Check if API token is configured
if not os.getenv("TODOIST_API_TOKEN"):
print("Error: TODOIST_API_TOKEN environment variable not set.")
print("Please set your Todoist API token:")
print(" export TODOIST_API_TOKEN=your_token_here")
print("Or create a .env file with:")
print(" TODOIST_API_TOKEN=your_token_here")
return 1
# Import and run the server - FastMCP's run() is synchronous
from .server import mcp
try:
# FastMCP's run() method is synchronous and handles its own event loop
mcp.run()
return 0
except KeyboardInterrupt:
print("\nShutting down...")
return 0
except Exception as e:
print(f"Error: {e}")
return 1
if __name__ == "__main__":
exit(cli())