main.py 852 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. """HTTP/SSE entrypoint for the atlas2-mcp server."""
  2. from __future__ import annotations
  3. from datetime import datetime, timezone
  4. from typing import Dict
  5. import logging
  6. import os
  7. from fastapi import FastAPI
  8. from dotenv import load_dotenv
  9. load_dotenv()
  10. from .mcp_server import mcp
  11. START_TIME = datetime.now(timezone.utc)
  12. logging.basicConfig(level=logging.INFO, force=True)
  13. app = FastAPI(
  14. title="Atlas2-MCP",
  15. description="Atlas2 semantic resolution scaffold (single resolve tool).",
  16. version="0.0.1",
  17. )
  18. app.mount("/mcp", mcp.sse_app())
  19. @app.get("/health", tags=["liveness"])
  20. async def health() -> Dict[str, object]:
  21. now = datetime.now(timezone.utc)
  22. uptime_seconds = (now - START_TIME).total_seconds()
  23. return {
  24. "status": "ok",
  25. "uptime_seconds": round(uptime_seconds, 2),
  26. "tools": ["resolve"],
  27. }