LibreChat sandbox: accessible image generation via MCP tool; two MCP servers; new overlay tag

This commit is contained in:
Nathan Schneider committed 2026-10-18 20:54:31 -06:00
1 parent 34a23a34f3
commit bac352f50e
1 file changed
+22 -8
+22 -8
View File
@@ -24,13 +24,26 @@ env vars, known state). This doc is the operator-facing summary.
(dedicated LiteLLM virtual key, alias `librechat-speech`, $5/30d, audio
models only — never the gateway master key), `IMAGE_GEN_OAI_BASEURL` +
`IMAGE_GEN_OAI_MODEL` (agent image tool → gateway), `SEARXNG_INSTANCE_URL`.
- **Docs MCP server** — `/app/data/mcp/server.py` (volume, mirrored in the
repo at `mcp/server.py`; stdlib-only Python; tool `search_docs`).
- **MCP servers** — `/app/data/mcp/server.py` (docs search, `search_docs`,
starts at boot) and `/app/data/mcp/image_server.py` (image generation,
`generate_image`, per-user startup — see below); both mirrored in the repo
under `mcp/`, stdlib-only Python.
- **Brand assets** (login logo, favicons, PWA icons, page title) — baked into
a pinned overlay image `FROM` the official appstore image, built from the
repo via `cloudron builder build` and deployed with
`cloudron update --image ... --force`. Deployed tag:
`registry.inference.coop/co-op/librechat-custom:20261019-070dec3`.
`registry.inference.coop/co-op/librechat-custom:20261019-5e214e4`.
## Image generation (two member-facing paths)
1. **MCP tool (easiest)**: the `inference-image` MCP server exposes
`generate_image` in the composer's **+** palette — no agent setup. Each
member's own co-op API key is injected per-user (LibreChat
`customUserVars` → `env`, `startup: false` because the key only exists
after the member saves it in the MCP panel), so images bill to the
member's own balance (~1–2¢ per 1024² image via `regolo/qwen-image`).
2. **Agent tool**: LibreChat's built-in "OpenAI Image Tools"
(`IMAGE_GEN_OAI_BASEURL`/`IMAGE_GEN_OAI_MODEL` → gateway; per-user keys).
## Update policy
@@ -75,8 +88,9 @@ cloudron logs --app 4023ccbf-d57a-4500-97df-14de9cf3516e --lines 60 | \
curl -s https://librechat-test.inference.coop/api/config # appTitle, emailLoginEnabled
```
Expected: `Custom config file loaded`, `[MCP] Initialized with 1 configured
server and 1 tool`, `[schedules] engine started`, `appTitle: Inference
Co-op`, `emailLoginEnabled: false`. The login page shows the co-op logo, the
co-op favicon, and a single "Login with Inference Cooperative" (Cloudron SSO)
path with no email/password form.
Expected: `Custom config file loaded`, `[MCP][inference-docs]` initialized
with tool `search_docs`, `inference-image` registered (its `Tools: undefined`
boot line is expected — per-user startup), `[schedules] engine started`,
`appTitle: Inference Co-op`, `emailLoginEnabled: false`. The login page shows
the co-op logo, the co-op favicon, and a single "Login with Inference
Cooperative" (Cloudron SSO) path with no email/password form.