ulysses/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
..
fonts Odysseus v1.0 2026-05-31 23:58:26 +09:00
js fix(settings): MCP server add — POST as multipart/form-data, not JSON (#107) 2026-06-01 13:23:05 +09:00
lib Odysseus v1.0 2026-05-31 23:58:26 +09:00
app.js Sidebar Chat button Quality of Life improvement. (#155) 2026-06-01 02:52:10 +00:00
index.html Move email account management to integrations 2026-06-01 13:01:33 +09:00
landing.html Fix landing footer snap and uvicorn docs 2026-06-01 10:51:55 +09:00
login.html Odysseus v1.0 2026-05-31 23:58:26 +09:00
manifest.json Odysseus v1.0 2026-05-31 23:58:26 +09:00
style.css Sidebar Chat button Quality of Life improvement. (#155) 2026-06-01 02:52:10 +00:00
sw.js Odysseus v1.0 2026-05-31 23:58:26 +09:00