Skip to content

Commit 4ceae8a

Browse files
claude[bot]zhuangjianguoclaude
authored
fix(mcp): read the stdio transport's localization after the settings engine bind (#11623)
* fix(mcp): read stdio localization after the settings engine bind Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019siH5jDmk5hrayvfyojUqR * chore(devx): delete the com.objectstack.mcp pre-bind ledger entry The site it recorded is repaired, and the ledger is shrink-only: an entry that outlives its defect holds a ceiling for a leak that no longer exists. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019siH5jDmk5hrayvfyojUqR --------- Co-authored-by: os-zhuang <zhuangjianguo@steedos.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 6f75c2f commit 4ceae8a

4 files changed

Lines changed: 477 additions & 30 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
'@objectstack/mcp': patch
3+
---
4+
5+
MCP stdio transport now serves the workspace's CONFIGURED timezone/locale
6+
instead of the manifest defaults
7+
8+
The stdio transport resolved its localization inside `MCPServerPlugin.start()`.
9+
`SettingsServicePlugin` registers its service in `init()` but binds its data
10+
engine from a `kernel:ready` hook registered in its own `start()`, and every
11+
plugin's `start()` body runs strictly before the first `kernel:ready` handler —
12+
so that read was inside the settings bind window under **every** composition
13+
order. Being ordered after the settings plugin did not help, and the
14+
`optionalDependencies` edge that repairs the neighbouring ordering defects would
15+
not have moved it either.
16+
17+
In that window the read does not fail: the empty in-memory fallback plus the
18+
manifest defaults answer with `source: 'default'`, so `resolveLocalizationContext`
19+
returned `UTC` / `en-US` and reported success, never reaching its direct
20+
`sys_setting` fallback. The value is then held for the life of the transport by
21+
design, so a long-lived stdio MCP server served every call with `UTC` / `en-US`
22+
on a workspace whose persisted `localization` settings said otherwise, and never
23+
self-corrected.
24+
25+
The resolution now happens from a `kernel:bootstrapped` hook — the earliest phase
26+
strictly after the bind, and the one `SettingsService.reportPreBindRead` names as
27+
the remedy — memoized so it stays one resolution for the life of the transport
28+
rather than a per-call settings read. A host that never fires the boot hooks
29+
resolves it lazily at first use instead, so nothing can deadlock on a hook that
30+
never arrives.
31+
32+
**Behaviour change on a declared setting**: a deployment that has configured
33+
`localization.timezone` / `localization.locale` / `localization.currency` will
34+
see those values take effect on the stdio MCP surface, where it previously
35+
always received the platform defaults. Formula evaluation (`ctx.timezone`) and
36+
message localization on that surface change accordingly.

0 commit comments

Comments
 (0)