""" 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. Run with: uvicorn migration_app:app --host 0.0.0.0 --port 8000 """ from starlette.responses import JSONResponse from fastmcp import FastMCP NEW_URL = "https://yargimcp.surucu.dev/mcp" mcp = FastMCP( name="Yargı MCP (taşındı / moved)", instructions=( f"Bu Yargı MCP endpoint'i kullanımdan kaldırıldı. " f"Sunucu yeni adrese taşındı: {NEW_URL}. " f"Kullanıcıya MCP istemci ayarlarındaki sunucu URL'sini güncellemesini söyle." ), ) @mcp.tool( description=( "DEPRECATED ENDPOINT — Yargı MCP sunucusu yeni adrese taşındı. " "Bu endpoint'teki eski araçlar (Yargıtay, Danıştay, Anayasa Mahkemesi, " "KVKK, BDDK, Rekabet Kurumu, Sayıştay, KİK, Emsal, Uyuşmazlık, GİB, " "Sigorta Tahkim, Bedesten vb.) artık burada çalışmıyor. " "Bu aracı çağırarak yeni sunucu adresini ve migrasyon talimatını al, " "ardından kullanıcıya MCP istemci (Claude Desktop, 5ire, ChatGPT vb.) " "ayarlarındaki sunucu URL'sini güncellemesi gerektiğini açıkça söyle." ) ) def migration_notice() -> dict: """Yargı MCP sunucusunun yeni adresini ve migrasyon talimatını döner.""" return { "status": "moved", "new_url": NEW_URL, "message": ( f"Yargı MCP sunucusu yeni adrese taşındı: {NEW_URL}\n\n" f"Lütfen MCP istemcinin (Claude Desktop, 5ire, ChatGPT vb.) " f"ayarlarındaki sunucu URL'sini yukarıdaki yeni adresle güncelleyin. " f"Mevcut endpoint artık kullanım dışıdır ve sadece bu uyarıyı döner." ), } @mcp.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()