"""Riyadh Districts MCP Server."""
from fastmcp import FastMCP
from starlette.requests import Request
from starlette.responses import JSONResponse
from src.config import settings
from src.mcp.tools import register_tools
mcp = FastMCP(
settings.SERVICE_NAME,
on_duplicate_tools="error",
)
@mcp.custom_route("/health", methods=["GET"])
async def health_check(_: Request) -> JSONResponse:
"""Health check endpoint."""
return JSONResponse({"status": "healthy", "service": settings.SERVICE_NAME})
# Register all tools
register_tools(mcp)
# HTTP app for uvicorn
app = mcp.http_app()
if __name__ == "__main__":
# Run in stdio mode for MCP clients
mcp.run()