Skip to main content
Glama

OLEXI Australian Laws MCP Server

by mickey-mikey
mcp_http.py1.22 kB
""" MCP-only ASGI app: serves the MCP Streamable HTTP endpoint at the service root ("/"). Use this when you want a dedicated Cloud Run service whose base URL is your MCP endpoint without a "/mcp" prefix. The main combined app remains in main.py. Run with uvicorn, e.g.: uvicorn mcp_http:app --host 0.0.0.0 --port ${PORT:-8080} """ from mcp_server import mcp from starlette.responses import FileResponse, JSONResponse import os # Ensure the HTTP transport expects the handshake at "/" (trailing slash supported). try: mcp.settings.streamable_http_path = "/" except Exception: pass # Build the ASGI sub-application that implements the MCP Streamable HTTP transport. app = mcp.streamable_http_app() # Lightweight /privacy route when this app is deployed standalone async def privacy(request): # type: ignore[override] path = "static/privacy-mcp.html" if os.path.exists(path): return FileResponse(path, media_type="text/html") return JSONResponse({"title": "Privacy Policy", "detail": "See docs/PRIVACY_MCP.md"}) try: app.add_route("/privacy", privacy, methods=["GET"]) # type: ignore[attr-defined] except Exception: # If add_route isn't available, ignore; privacy page is optional pass

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mickey-mikey/olexi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server