Skip to content

Commit bd72e33

Browse files
committed
Address review: MCP config dump params + workflow token permissions
- fastmcp _entry_dump now passes entry.translation_params to get_translation so {0} placeholders (Spotify callback URL, QR provider name) are substituted for MCP clients, matching ConfigEntry.__post_serialize__. - Add minimal GITHUB_TOKEN permissions to the Lokalise workflows (upload: contents:read; download: contents:write + pull-requests:write).
1 parent 12b88ad commit bd72e33

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/lokalise-download.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ on:
1515
- cron: "0 3 * * 2" # every Tuesday at 03:00 UTC
1616
workflow_dispatch:
1717

18+
# Pushes a branch and opens the translations PR, so it needs write + PR scope.
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
1823
jobs:
1924
download:
2025
runs-on: ubuntu-latest

.github/workflows/lokalise-upload.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ on:
2121
- cron: "0 1 * * 2" # weekly safety net, before the Tuesday download run
2222
workflow_dispatch:
2323

24+
# Only checks out the repo and pushes to Lokalise (via the Lokalise token), so read-only.
25+
permissions:
26+
contents: read
27+
2428
jobs:
2529
upload:
2630
runs-on: ubuntu-latest

music_assistant/providers/fastmcp_server/tools/config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,13 @@ def _entry_dump(mass: MusicAssistant, entry: ConfigEntry, current: Any) -> Confi
116116
base = entry.translation_key or f"config_entries.{entry.key}"
117117
label = (
118118
entry.label
119-
or mass.translations.get_translation(f"{base}.label", owner=entry.translation_owner)
119+
or mass.translations.get_translation(
120+
f"{base}.label", owner=entry.translation_owner, params=entry.translation_params
121+
)
120122
or entry.key
121123
)
122124
description = entry.description or mass.translations.get_translation(
123-
f"{base}.description", owner=entry.translation_owner
125+
f"{base}.description", owner=entry.translation_owner, params=entry.translation_params
124126
)
125127
return ConfigEntryDump(
126128
key=entry.key,

0 commit comments

Comments
 (0)