#2318·mopidy

Move JSON-RPC and the web client list to an ASGI app

Author: jodalCreated Sep 27, 2026Updated Sep 27, 2026
LabelsA-ext-httpready-for-agent

:robot: Summary

Mopidy's JSON-RPC HTTP endpoint (/mopidy/rpc), the web client list page and the redirects run as a Starlette app, registered internally the same way as an http:asgi app named mopidy. It uses the public origin and CSRF middleware. The wire protocol does not change.

Core calls use sync endpoints (Starlette runs them in a thread pool) or .get() in a thread, until Pykka's async release. See "Mopidy's own endpoints" and "Web client list" in the parent spec.

/mopidy/ws is a separate ticket, so it stays a Tornado handler in this ticket.

Parent

mopidy/mopidy#2312

Acceptance criteria

  • /mopidy/rpc accepts and returns exactly the same JSON-RPC, status codes and headers as before, including X-Mopidy-Version, Cache-Control, CORS and CSRF behavior.
  • The web client list page shows ASGI apps, Tornado apps and static apps, without a Tornado template.
  • The redirects, including the one to default_app, work as before.
  • Core calls do not block the event loop.
  • The existing server, handler and JSON-RPC tests pass without changes to their assertions.

Blocked by

  • mopidy/mopidy#2317