Files
yargi-mcp/app.py
T
saidsurucuandClaude Opus 4.7 a24def2e66 feat(deploy): add minimal ASGI app and Dockerfile for simple deploys
Mirrors the mevzuat-mcp pattern: a thin app.py exposing
mcp.http_app() with a /health route, no FastAPI/CORS/OAuth wrapper.
Dockerfile builds on python:3.12-slim and runs uvicorn directly.
Removes Dockerfile/fly.toml entries from .dockerignore so the new
Dockerfile is included in the build context.

Existing asgi_app.py (api.yargimcp.com production) is untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 13:13:22 +03:00

36 lines
942 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
ASGI application for Yargı MCP Server (simple deployment variant).
This is a minimal ASGI application that can be run with:
uvicorn app:app --host 0.0.0.0 --port 8000
The MCP server will be available at:
http://localhost:8000/mcp/
For the FastAPI-wrapped variant with CORS and extra metadata routes,
see asgi_app.py instead.
"""
from starlette.responses import JSONResponse
from mcp_server_main import create_app
mcp = create_app()
@mcp.custom_route("/health", methods=["GET"])
async def health_check(request):
"""Health check endpoint for monitoring services (Fly.io, Render, etc.)."""
return JSONResponse({
"status": "healthy",
"service": "Yargı MCP Server",
"version": "0.2.0",
})
# Create ASGI app directly from FastMCP server
app = mcp.http_app()
# Endpoints:
# - /mcp/ - MCP server (Streamable HTTP transport, default FastMCP path)
# - /health - Health check for monitoring