v0.3.9 — bodyTemplate interpolation & connector editor fixes
Fixes
-
Caller-context and env variables now work in a
bodyTemplate(#453):interpolateConnectorConfig()coveredbaseUrl, headers,path,queryParamsandbodyMapping— but notbodyTemplate, which the REST engine then rendered with tool arguments only.{{amcp.user_email}}therefore reached the target system verbatim. Note this was broader than the caller-context feature: plain{{ENV_VAR}}in a body template had been silently broken for as long as body templates existed.Substituted values are escaped for their JSON string context, so a quote or backslash in a value cannot terminate the surrounding string and inject syntax. A bare numeric placeholder such as
{"limit": {{MAX}}}still yields valid JSON, and${param}placeholders are left untouched for the engine to render afterwards with its own escaping. -
OAuth2 endpoints are editable again (#453): a connector switched to
OAUTH2after creation has noauthorizationUrl, and the edit form only exposed client id and secret — so it could never be authorized (No authorization URL configured for this connector) and had to be rebuilt from scratch. Authorization URL, Token URL and Scopes are now shown and editable, pre-filled from the stored configuration and saved through the merge endpoint so issued tokens survive the edit. -
Nested
bodyMappingis no longer invisible or silently destroyed (#453): the field editor can only express a flatparam → $parammapping. Anything else — nested objects, arrays, literal values,{{variables}}— rendered as an empty Body Fields section, and saving rebuilt the mapping from the visible fields, discarding the rest. Such a mapping is now detected and shown in a new Body Mapping (JSON) mode that round-trips it verbatim. Invalid JSON blocks saving with an inline message instead of throwing, and the live preview no longer crashes on a half-typed document. -
The Test button explains empty caller-context values (#453): it does not run through an authenticated MCP session, so
{{amcp.*}}resolves to empty and a perfectly good tool looks broken. The test result now says so when the tool uses those variables.
Upgrading
No schema changes and no configuration changes. If you worked around the bodyTemplate limitation by moving the payload into a nested bodyMapping, that keeps working unchanged — and is now editable from the UI.
Verification: backend 3475 tests green, typecheck clean; frontend typecheck + build + e2e clean.
Docs: docs/tool-definition.md corrected — it stated the variables applied to "the endpoint mapping" while bodyTemplate was in fact excluded.
Thanks to Dominik Muhlke (pikoworks) for a precise report that pinpointed the exact call path for each of these.