Files
yargi-mcp/migration_app.py
saidsurucuandClaude Opus 4.7 4fdc7a3689 fix(deploy): make migration_app entrypoint a FastMCP instance
The Dokploy FastMCP build pipeline runs `fastmcp inspect <module>: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) <noreply@anthropic.com>
2026-05-08 00:39:02 +03:00

58 lines
2.1 KiB
Python
Raw Permalink 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.
"""
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:
fastmcp run migration_app.py:app --transport http --port 8000
"""
from starlette.responses import JSONResponse
from fastmcp import FastMCP
NEW_URL = "https://yargimcp.surucu.dev/mcp"
app = 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."
),
)
@app.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."
),
}
@app.custom_route("/health", methods=["GET"])
async def health(request):
"""Health check endpoint for monitoring services."""
return JSONResponse({"status": "deprecated", "new_url": NEW_URL})