feat: prioritize COOLIFY_URL over MCP_PUBLIC_URL for inspector auto-connect URL

Added fallback to `process.env.COOLIFY_URL` before `MCP_PUBLIC_URL` when constructing the public URL for the MCP inspector, ensuring the correct base URL is used in environments where COOLIFY_URL is set.
This commit is contained in:
2026-04-21 12:16:53 +05:30
parent 5a94c1007b
commit fad74cad57
+1 -1
View File
@@ -284,7 +284,7 @@ export async function main() {
// MCP Inspector at root path - auto-connects to /mcp
// Mounted AFTER /mcp so specific routes take precedence
const mcpPublicUrl = process.env.MCP_PUBLIC_URL || `http://localhost:${PORT}`;
const mcpPublicUrl = process.env.COOLIFY_URL || process.env.MCP_PUBLIC_URL || `http://localhost:${PORT}`;
mountInspector(app, {
autoConnectUrl: `${mcpPublicUrl}/mcp`,
devMode: process.env.NODE_ENV !== "production",