wrolpi/wrolpi_mcp/__main__.py
Roland ebbea75e26
ai: wrolpi_mcp becomes a thin proxy over /api/ai
Every MCP tool is now one /api/ai call with minimal text rendering;
the formatting, link building, and truncation logic it used to carry
untested lives (tested) in modules/ai.  Tool names are unchanged for
external clients; a source-scan test guards the names and that the
proxy only reaches /api/ai.  New lean blueprint endpoints back the two
tools that had no equivalent: GET archives/{id} (detail + snapshot
history) and GET videos/{id}/comments (paged author lines).  Paged
content is read up to the old 50k-char bound.  get_inventory_items now
takes the inventory slug (inventories are config-only; the old
numeric-id endpoint no longer exists).  This also brings wrolpi_mcp
into version control (venv/ is already gitignored).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-24 14:09:54 -06:00

13 lines
441 B
Python

"""Entry point: python -m wrolpi_mcp, or python wrolpi_mcp/__main__.py"""
import sys
from pathlib import Path
# Ensure the project root is on sys.path so wrolpi_mcp is importable
# regardless of the working directory or how this script is invoked.
project_root = str(Path(__file__).resolve().parent.parent)
if project_root not in sys.path:
sys.path.insert(0, project_root)
from wrolpi_mcp.server import mcp
mcp.run(transport="stdio")