Guide · About 5 minutes

Enable HTTPS for AI and MCP clients

AI clients such as Claude (custom connectors) and ChatGPT (connectors and apps) only connect to remote MCP servers over HTTPS. Your trial runs on http://localhost:8080, so put HTTPS in front of it. Do step 1, then pick one option.

Each command is a single line, so it works as-is in a macOS/Linux terminal and in Windows PowerShell (not the old Command Prompt). Boxes with several lines hold several commands, or file contents.

Your MCP address will be https://<your-https-host>/mcp/<service-name>. Create the service in the DreamFactory admin app under AI → MCP servers; <service-name> is its Name.

  1. Re-create the trial with three settings (every option)

    Your data lives in its own Docker volume, and the dashboard command keeps the same APP_KEY, so re-creating the container is safe. Remove the container:

    Remove the container (data stays in the volume)
    docker rm -f dreamfactory-trial

    Then run the docker run command from your dashboard again, adding these flags just before the image name (the last word):

    Flags to add before the image name
    -e HTTPS_HEADER=on -e ENABLE_MCP_DAEMON=1 -e ENABLE_SYSTEM_MCP_DAEMON=1

    Using the Compose file instead? Add these lines under environment:, then run docker compose up -d:

    docker-compose.yml, under environment:
          HTTPS_HEADER: "on"
          ENABLE_MCP_DAEMON: "1"
          ENABLE_SYSTEM_MCP_DAEMON: "1"

    When the container is up (give it a minute), run this once. Repeat it whenever you re-create the container:

    Let the MCP engine reach DreamFactory inside the container
    docker exec dreamfactory-trial sh -c 'echo MCP_INTERNAL_BASE_URL=http://127.0.0.1 >> /opt/dreamfactory/.env && php /opt/dreamfactory/artisan config:clear'

    What these do: HTTPS_HEADER=on makes DreamFactory publish https:// sign-in and token links to AI clients. The ENABLE_* flags start the MCP engine. MCP_INTERNAL_BASE_URL lets that engine reach DreamFactory inside the container. With HTTPS_HEADER=on, connect AI clients through the HTTPS address, not localhost.

    Opening the admin app after this step: use your HTTPS address (from option A or B), or http://localhost:8080/dreamfactory/dist/. Plain http://localhost:8080 now redirects to https://localhost and will not load. You need the admin app to create the MCP service and to change the admin password.

  2. Quickest, no domain needed: Cloudflare quick tunnel

    Good for trying things out. No account and no open ports needed.

    Start the tunnel
    docker run --rm --network container:dreamfactory-trial cloudflare/cloudflared:2026.9.3 tunnel --no-autoupdate --url http://localhost:80

    Copy the https://<random-words>.trycloudflare.com address it prints and open it in your browser. Ctrl+C stops the tunnel. You get a new address each time you start it, and quick tunnels are for testing only (no uptime guarantee). For a permanent address, use option B or a named Cloudflare Tunnel.

    Restarted or re-created dreamfactory-trial? Restart the tunnel too (Ctrl+C, then the same command): it stops serving when the trial container goes away, even though it still looks "Up". You get a new address, so update it in your AI client.

  3. Your own domain with automatic certificates: Caddy

    You need a DNS name (for example mcp.example.com) pointing at this machine's public IP, with ports 80 and 443 reachable from the internet. Caddy gets and renews a free Let's Encrypt certificate automatically.

    Create a file named Caddyfile in the folder you run Docker from (replace the domain):

    Caddyfile
    mcp.example.com {
    	reverse_proxy dreamfactory-trial:80
    }

    Compose users: add this service under services:, add caddy-data: under the top-level volumes: (next to the existing volume entry), then run docker compose up -d:

    docker-compose.yml, under services:
      caddy:
        image: caddy:2.11.4
        restart: unless-stopped
        ports: ["80:80", "443:443"]
        volumes:
          - ./Caddyfile:/etc/caddy/Caddyfile:ro
          - caddy-data:/data

    docker run users:

    Shared network + Caddy
    docker network create dfnet
    docker network connect dfnet dreamfactory-trial
    docker run -d --name caddy --restart unless-stopped --network dfnet -p 80:80 -p 443:443 -v "$PWD/Caddyfile:/etc/caddy/Caddyfile:ro" -v caddy-data:/data caddy:2.11.4

    Open https://mcp.example.com. After re-creating dreamfactory-trial, connect it to dfnet again (docker network connect dfnet dreamfactory-trial).

  4. Other ways (step 1 still applies)

    • ngrok: ngrok http 8080 gives an https://….ngrok-free.app address (a free static domain is available).
    • Tailscale Funnel: tailscale funnel 8080 publishes the trial on your https://<machine>.<tailnet>.ts.net name.
    • Existing nginx, Traefik or load balancer: proxy HTTPS to port 8080 and pass the Host and X-Forwarded-Proto headers. With nginx, also set proxy_buffering off for /mcp/.

Check that it worked

Replace YOUR-HOST and YOUR-SERVICE
curl -s https://YOUR-HOST/.well-known/oauth-authorization-server/mcp/YOUR-SERVICE

On Windows PowerShell, type curl.exe instead of curl (in Windows PowerShell 5.1, curl is a different command).

Every URL in the answer (issuer, authorization_endpoint, token_endpoint) must start with https://. Then add https://YOUR-HOST/mcp/YOUR-SERVICE as a remote or custom MCP connector in your AI client; it opens the DreamFactory sign-in page.

SymptomFix
The URLs above start with http://HTTPS_HEADER=on is missing. Re-create the container (a plain restart is not enough).
503 MCP daemon is not reachableENABLE_MCP_DAEMON=1 is missing (System API MCP: ENABLE_SYSTEM_MCP_DAEMON=1).
Tools connect but every call says fetch failedRun the MCP_INTERNAL_BASE_URL command from step 1 again.

Security checklist

  • Anything you expose is public on the internet. Change the admin password (your profile in the admin app) before you start a tunnel or proxy, and keep the new one somewhere safe: password reset emails are not available in the trial instance.
  • Give AI clients least privilege: a role that can reach only the services and tables they need, Require Role Access on for the MCP service, and API keys tied to limited roles, never an admin account.
  • Turn off Allow writes on the MCP service if the AI only needs to read.
  • Stop quick tunnels (Ctrl+C) when you're done. If you remove the proxy, re-create the container without HTTPS_HEADER=on.