fix mcp-server crash and Kiwix FQDN resolution
mcp_server.py / local-ai-setup.sh: FastMCP.get_asgi_app() was removed in mcp 1.x — replace with sse_app(), which returns the same Starlette ASGI app for SSE transport. Fixes the crash loop the container was stuck in. laptop_full_setup.sh Caddyfile: $(hostname).local requires mDNS (Avahi/Bonjour) to resolve from a proxy machine, which is often not available on all LAN clients. Replace every occurrence with $LOCAL_IP (the machine's LAN IP) so the generated Caddyfile.example works reliably regardless of mDNS support. https://claude.ai/code/session_012gDnantBmFTWZGCiKyjazx
This commit is contained in:
@@ -1392,19 +1392,19 @@ write_if_new "$BASE/Caddyfile.example" << CADDY
|
|||||||
# Replace yourdomain.com with your actual domain
|
# Replace yourdomain.com with your actual domain
|
||||||
|
|
||||||
webui.yourdomain.com {
|
webui.yourdomain.com {
|
||||||
reverse_proxy $(hostname).local:3000 {
|
reverse_proxy $LOCAL_IP:3000 {
|
||||||
header_up X-Forwarded-Proto {scheme}
|
header_up X-Forwarded-Proto {scheme}
|
||||||
header_up X-Forwarded-Host {host}
|
header_up X-Forwarded-Host {host}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
invokeai.yourdomain.com { reverse_proxy $(hostname).local:9090 }
|
invokeai.yourdomain.com { reverse_proxy $LOCAL_IP:9090 }
|
||||||
search.yourdomain.com { reverse_proxy $(hostname).local:8888 }
|
search.yourdomain.com { reverse_proxy $LOCAL_IP:8888 }
|
||||||
git.yourdomain.com { reverse_proxy $(hostname).local:3001 }
|
git.yourdomain.com { reverse_proxy $LOCAL_IP:3001 }
|
||||||
kiwix.yourdomain.com { reverse_proxy $(hostname).local:8181 }
|
kiwix.yourdomain.com { reverse_proxy $LOCAL_IP:8181 }
|
||||||
rag.yourdomain.com { reverse_proxy $(hostname).local:8001 }
|
rag.yourdomain.com { reverse_proxy $LOCAL_IP:8001 }
|
||||||
mcp.yourdomain.com { reverse_proxy $(hostname).local:8002 }
|
mcp.yourdomain.com { reverse_proxy $LOCAL_IP:8002 }
|
||||||
portainer.yourdomain.com {
|
portainer.yourdomain.com {
|
||||||
reverse_proxy https://$(hostname).local:9443 {
|
reverse_proxy https://$LOCAL_IP:9443 {
|
||||||
transport http { tls_insecure_skip_verify }
|
transport http { tls_insecure_skip_verify }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -669,7 +669,7 @@ def rag_health() -> str:
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
uvicorn.run(mcp.get_asgi_app(), host="0.0.0.0", port=8002)
|
uvicorn.run(mcp.sse_app(), host="0.0.0.0", port=8002)
|
||||||
PY
|
PY
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|||||||
+1
-1
@@ -199,5 +199,5 @@ def rag_health() -> str:
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
app = mcp.get_asgi_app()
|
app = mcp.sse_app()
|
||||||
uvicorn.run(app, host="0.0.0.0", port=8002)
|
uvicorn.run(app, host="0.0.0.0", port=8002)
|
||||||
|
|||||||
Reference in New Issue
Block a user