"""HTTP/SSE entrypoint for the BigBugAI MCP server.
Run with: `uv run -m bigbugai_mcp.server_http`
This starts a FastAPI app with:
- GET /healthz -> plain text "ok"
- Mounted MCP HTTP/SSE server under /mcp
"""
from __future__ import annotations
from fastapi import FastAPI, Response
from mcp.server.fastmcp import FastMCP
from bigbugai_mcp.tools import register_tools
# Create MCP server and register tools
mcp = FastMCP("bigbugai")
register_tools(mcp)
# Build ASGI apps for the MCP transports
mcp_http_app = mcp.streamable_http_app()
mcp_sse_app = mcp.sse_app()
# Create FastAPI app
app = FastAPI(title="BigBugAI MCP", version="0.1.0")
# Health endpoint
@app.get("/healthz")
async def healthz() -> Response:
return Response(content="ok", media_type="text/plain")
# Mount MCP transports
app.mount("/mcp", mcp_http_app)
app.mount("/mcp/sse", mcp_sse_app)
if __name__ == "__main__":
import uvicorn
uvicorn.run("bigbugai_mcp.server_http:app", host="0.0.0.0", port=8000, reload=False)