Files
odysseus/static
cryptoji 17fe738659 fix(settings): MCP server add — POST as multipart/form-data, not JSON (#107)
routes/mcp_routes.py declares POST /api/mcp/servers with FastAPI
Form(...) params. The Save handler in static/js/settings.js was
sending application/json, so the Form parser saw no fields and
returned 422 with "Field required" for every input — clicking Save
did nothing visible.

Build a FormData object and let the browser set the multipart
Content-Type. args/env are JSON-stringified per the controller
contract (defaults "[]" / "{}"); bad JSON still falls back to
defaults, same as before.

Also check r.ok and surface non-2xx in the form-status span — the
previous code never checked status, so a 422 looked like success.

Matches the FormData pattern already used in this file (uf-mcp-toggle,
~L4036) for the toggle-enable PATCH against the same controller.

Co-authored-by: Toji <ccryptoji@gmail.com>
2026-06-01 13:23:05 +09:00
..
2026-05-31 23:58:26 +09:00
2026-05-31 23:58:26 +09:00
2026-05-31 23:58:26 +09:00
2026-05-31 23:58:26 +09:00
2026-05-31 23:58:26 +09:00