Skip to content

fix(mcp): system locale default + MCP_LOCALE override for get_local_time#87

Merged
elgorro merged 3 commits intomainfrom
fix/list-events-date-format-store-corruption
Mar 6, 2026
Merged

fix(mcp): system locale default + MCP_LOCALE override for get_local_time#87
elgorro merged 3 commits intomainfrom
fix/list-events-date-format-store-corruption

Conversation

@elgorro
Copy link
Owner

@elgorro elgorro commented Mar 6, 2026

Summary

  • Removes the hardcoded sv-SE locale from get_local_time's localTime field — it was a fragile trick to produce YYYY-MM-DD HH:MM:SS output
  • toLocaleString(undefined, ...) now uses the system locale by default
  • Users can set MCP_LOCALE=sv-SE (or any BCP 47 tag) to restore the previous ISO-like format or pick any preferred locale
  • Documents MCP_LOCALE in the env vars table in CLAUDE.md

Test plan

  • cd mcp-server && npm test passes
  • npm run lint — 0 errors
  • npx prettier --check src/ — all clean
  • Unset MCP_LOCALElocalTime reflects system locale
  • MCP_LOCALE=sv-SElocalTime shows "2026-03-06 14:32:00" style output

🤖 Generated with Claude Code

elgorro and others added 3 commits March 6, 2026 16:25
…lete corrupted state files

- toICalDateTime(): bare 8-digit date (e.g. 20260307) is now expanded to
  full UTC datetime (20260307T000000Z) required by Sabre/DAV <c:time-range>,
  preventing HTTP 500 from list_events when from/to are date-only strings
- loadJson(): after logging a parse-error warning, unlink the corrupted file
  so subsequent restarts see ENOENT (silent) instead of repeating the warning

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Gives the model a reliable time anchor before creating or listing
calendar events, and to resolve scheduling ambiguities with the user.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ALE override

Replace hardcoded 'sv-SE' locale with process.env.MCP_LOCALE so localTime
uses the system locale when unset. Users can set MCP_LOCALE=sv-SE to restore
the previous ISO-like format. Documents the new env var in CLAUDE.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@elgorro elgorro merged commit 41d16f3 into main Mar 6, 2026
3 checks passed
@elgorro elgorro deleted the fix/list-events-date-format-store-corruption branch March 6, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant