Files
LocalAI/pkg
L0ria 281b43a693 fix(mcp): point httpapi list_installed_models & system_info at live routes
The standalone 'local-ai mcp-server' HTTP client (httpapi.Client) called
GET / for both list_installed_models and system_info, expecting the legacy
welcome JSON (ModelsConfig / Version / InstalledBackends). That endpoint was
unregistered when the React UI moved to /app, so GET / now 301-redirects to
the SPA. The client uses LocalAI's hardened httpclient, which refuses all
redirects by default, so both tools failed with:

    Get "/app": httpclient: redirect blocked: refusing to follow redirect ...

These two tools have never returned data over HTTP (the client was added
after / became a redirect). Repoint them at live, non-redirecting routes:

  - list_installed_models -> GET /api/models/capabilities
    (returns id/backend/capabilities/disabled/pinned; also makes the
    capability filter, previously a no-op over HTTP, actually work)
  - system_info           -> GET /version + GET /backends + GET /system

The dead routeWelcome constant is removed and the three new routes are
added as route* constants per the package convention. Test fakes and the
Tool<->REST drift map in coverage_test.go are updated to the new routes,
and new specs cover list_installed_models (all / filtered / empty) and
system_info (version + backends + loaded models).

Assisted-by: LocalAI-Agent:qwen3.8-27b-heretic-abliterated-uncensored
Signed-off-by: L0ria <loria@hno3.eu>
(cherry picked from commit d123083bc0)
(cherry picked from commit f352b4278f764ad25902882d26afb761fa1b953d)
2026-11-03 19:24:13 +00:00
..
2024-06-23 08:24:36 +00:00