AI backend / relay
Create a small self-hosted backend relay for MC that forwards requests to a user-configured LLM endpoint with a user-configured API key. This solves browser CORS issues for providers that cannot be called directly from the frontend, while keeping provider keys out of the browser.
Scope
- Minimal Flask
app.py + simple Dockerfile.
- Config via environment variables only.
- Intended for self-hosting by individuals, teams, or companies.
Required config
UPSTREAM_BASE_URL
UPSTREAM_API_KEY
MC_RELAY_USERNAME
MC_RELAY_PASSWORD
- Optional:
ALLOWED_ORIGIN, timeout, extra upstream headers.
Required features
- HTTP Basic Auth for MC -> relay access.
- CORS support for the configured MC origin.
- Proxy OpenAI-compatible endpoints, at minimum:
GET /health
GET /v1/models
POST /v1/chat/completions
- Pass upstream responses through with minimal transformation.
- Support streaming if possible.
Security requirements
- No provider key in frontend/browser.
- No secrets in logs.
- Deploy behind HTTPS.
- Restrict CORS to configured origin, not
*.
Goal
Add support for custom/self-hosted and CORS-blocked LLM providers via a simple relay that can live inside the MetaConfigurator repo and be easy to run with Docker.
Also sufficiently document how to set up and use this "relay".
AI backend / relay
Create a small self-hosted backend relay for MC that forwards requests to a user-configured LLM endpoint with a user-configured API key. This solves browser CORS issues for providers that cannot be called directly from the frontend, while keeping provider keys out of the browser.
Scope
app.py+ simple Dockerfile.Required config
UPSTREAM_BASE_URLUPSTREAM_API_KEYMC_RELAY_USERNAMEMC_RELAY_PASSWORDALLOWED_ORIGIN, timeout, extra upstream headers.Required features
GET /healthGET /v1/modelsPOST /v1/chat/completionsSecurity requirements
*.Goal
Add support for custom/self-hosted and CORS-blocked LLM providers via a simple relay that can live inside the MetaConfigurator repo and be easy to run with Docker.
Also sufficiently document how to set up and use this "relay".