How to use internal AI endpoints?

I solved it adding the Docker Internal Gateway IP to DISCOURSE_ALLOWED_INTERNAL_HOSTS and exposing the port on LiteLLM docker-compose.yml file:

    ports:
      - "4444:4000"

Nginx points to LITELLM_IP:4000 and Discourse to GATEWAY_IP:4444 to avoid port conflicts.


Then I solved the errors on MCP admin UI removing previous non-working MCP added tools:

# List all configured MCP servers
AiMcpServer.all

# If you see a bad one, delete it by ID (e.g., id: 1)
AiMcpServer.find(1).destroy

Hope it helps to someone with similar setup.