Files
scribe/scraibe/__main__.py
T
admin bdd0a80d8d
Mirror and run GitLab CI / build (push) Waiting to run
Ruff / ruff (push) Waiting to run
Add watch-folder mode and wire MCP/watcher into entrypoint
- New watcher.py: polls WATCH_DIR, enqueues transcription+summary via Celery.
- New process_watch_file_task in tasks.py.
- Updated __main__.py: WebUI always runs; MCP and watcher run in parallel when enabled.
2026-06-19 17:18:20 +00:00

49 lines
1017 B
Python

"""
Entrypoint for running ScrAIbe as a module:
python -m scraibe
Always launches the Web GUI (Gradio).
Optionally launches:
- MCP-style API server
- Watch-folder mode
"""
import os
import threading
from .webui import create_app
def _run_mcp_server():
"""
Run MCP server in a separate thread.
"""
import uvicorn
from . import mcp_server
host = os.getenv("MCP_SERVER_HOST", "0.0.0.0")
port = int(os.getenv("MCP_SERVER_PORT", "8000"))
uvicorn.run(
mcp_server.app,
host=host,
port=port,
log_level="info",
)
if __name__ == "__main__":
# Optionally start MCP server in background
mcp_enabled = os.getenv("MCP_SERVER_ENABLED", "false").strip().lower() in ("true", "1", "yes")
if mcp_enabled:
t = threading.Thread(target=_run_mcp_server, daemon=True)
t.start()
# Optionally start watch-folder mode
from .watcher import start_watcher
start_watcher()
# Always start WebUI (Gradio)
create_app()