This commit is contained in:
@@ -10,6 +10,8 @@ import qdrant_client as qdrant_pkg
|
|||||||
from dateutil import parser as date_parser
|
from dateutil import parser as date_parser
|
||||||
from email.utils import parseaddr
|
from email.utils import parseaddr
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
from starlette.requests import Request
|
||||||
|
from starlette.responses import JSONResponse
|
||||||
from fastmcp import FastMCP
|
from fastmcp import FastMCP
|
||||||
from qdrant_client import QdrantClient
|
from qdrant_client import QdrantClient
|
||||||
from qdrant_client.http import models
|
from qdrant_client.http import models
|
||||||
@@ -44,6 +46,11 @@ logger.info(f"Starting MCP server with collection: {COLLECTION_NAME}")
|
|||||||
# Initialize FastMCP server
|
# Initialize FastMCP server
|
||||||
mcp = FastMCP("mcp-maildir")
|
mcp = FastMCP("mcp-maildir")
|
||||||
|
|
||||||
|
@mcp.custom_route("/health", methods=["GET"])
|
||||||
|
async def health_check(request: Request):
|
||||||
|
"""Simple health check endpoint for Kubernetes liveness/readiness probes."""
|
||||||
|
return JSONResponse({"status": "ok"})
|
||||||
|
|
||||||
# Lazy singletons
|
# Lazy singletons
|
||||||
_qdrant_client: Optional[QdrantClient] = None
|
_qdrant_client: Optional[QdrantClient] = None
|
||||||
_embedding_model: Optional[TextEmbedding] = None
|
_embedding_model: Optional[TextEmbedding] = None
|
||||||
|
|||||||
Reference in New Issue
Block a user