From 4fdc7a368945d038fb0a8abda35992863f6f6d17 Mon Sep 17 00:00:00 2001 From: saidsurucu Date: Fri, 8 May 2026 00:39:02 +0300 Subject: [PATCH] fix(deploy): make migration_app entrypoint a FastMCP instance The Dokploy FastMCP build pipeline runs `fastmcp inspect :app` and expects `app` to be a FastMCP instance, not a Starlette ASGI app. Drop the `mcp.http_app()` wrapper and bind the FastMCP instance to `app` directly so `fastmcp inspect` and `fastmcp run --transport http` both work. Verified locally with `fastmcp inspect` and end-to-end MCP initialize over `fastmcp run`. Co-Authored-By: Claude Opus 4.7 (1M context) --- migration_app.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/migration_app.py b/migration_app.py index ec5a544..5eb7f21 100644 --- a/migration_app.py +++ b/migration_app.py @@ -4,8 +4,11 @@ Migration stub for the deprecated Yargı MCP endpoint. Exposes a single tool that informs the MCP client the server has moved and the user must update their configuration. +Entrypoint variable `app` is a FastMCP instance so it works with +Dokploy's FastMCP build pipeline (`fastmcp inspect`, `fastmcp run`). + Run with: - uvicorn migration_app:app --host 0.0.0.0 --port 8000 + fastmcp run migration_app.py:app --transport http --port 8000 """ from starlette.responses import JSONResponse @@ -13,7 +16,7 @@ from fastmcp import FastMCP NEW_URL = "https://yargimcp.surucu.dev/mcp" -mcp = FastMCP( +app = FastMCP( name="Yargı MCP (taşındı / moved)", instructions=( f"Bu Yargı MCP endpoint'i kullanımdan kaldırıldı. " @@ -23,7 +26,7 @@ mcp = FastMCP( ) -@mcp.tool( +@app.tool( description=( "DEPRECATED ENDPOINT — Yargı MCP sunucusu yeni adrese taşındı. " "Bu endpoint'teki eski araçlar (Yargıtay, Danıştay, Anayasa Mahkemesi, " @@ -48,10 +51,7 @@ def migration_notice() -> dict: } -@mcp.custom_route("/health", methods=["GET"]) +@app.custom_route("/health", methods=["GET"]) async def health(request): """Health check endpoint for monitoring services.""" return JSONResponse({"status": "deprecated", "new_url": NEW_URL}) - - -app = mcp.http_app()