2.5.0: unresolved env placeholder on an mcp boolean gate now drops to its default (behavior change not in CHANGELOG)
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 82/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- authentication, documentation
Research direction
Start by reviewing the 2.5.0 CHANGELOG sections named under Security, Added, and Fixed, then read dist/lib/config.js and dist/index.js for the unresolved-placeholder behavior and call site. Done means adding a concise Changed or migration entry that explains the new defaulting behavior and warning for the listed mcp boolean options.
Written by the indexing model from the issue text.
Description
Summary
Upgrading @harperfast/oauth 2.4.0 → 2.5.0 changed how an unresolved env placeholder on an mcp boolean gate is treated. Given a config where the value is a ${VAR} placeholder and VAR is unset (e.g. mcp.enabled: "${SOME_VAR}"):
- 2.4.0 and earlier left the literal string
"${SOME_VAR}"in place. Formcp.enabledthat string is truthy, so MCP was treated as enabled; ifmcp.issuerwas also an unresolved placeholder, startup then failed loudly in issuer validation (mcp.issuer must be an absolute http(s) origin …) and the instance booted degraded. - 2.5.0 detects the unresolved
${…}placeholder, logs a warning, and removes the field so the documented default applies. Formcp.enabledthat means MCP is disabled and the instance boots clean — the/mcproute is simply not mounted.
This is a strictly safer default (a mistyped or unset gate can no longer silently flip on), and it reads as intentional: the normalizeBooleanField implementation special-cases the placeholder, and the type declaration documents each documented boolean as "coerced to a real boolean, or removed with a warning so the documented default applies."
Why I'm filing
The change isn't called out in the 2.5.0 CHANGELOG under Security / Added / Fixed — it lives only in code comments and the .d.ts. A downstream integration test of mine asserted the old surface (an env-interpolated mcp.enabled with the var unset → degraded boot / 500), and it broke on the bump with no changelog signal pointing at the cause; it took a source diff between the two tarballs to attribute it.
A one-line Changed entry (or a migration note) would save the next integrator that diff. Suggested wording:
Unresolved
${ENV}placeholders on documentedmcpboolean options (mcp.enabled,mcp.clientCredentials.enabled,mcp.clientIdMetadataDocuments.enabled,mcp.dynamicClientRegistration.enabled,mcp.refreshTokenRequiresOfflineAccess) are now treated as absent — a warning is logged and the documented default applies — rather than being left as a truthy string.
One observability point worth folding into that note: an operator who intended mcp.enabled: "${VAR}" to be on but left VAR unset now gets a green boot with MCP silently off (only a log warning), where before they'd have hit a loud startup error. That's the right fail-safe for a security gate — just worth telling operators to check for the warning if MCP isn't mounting.
Repro
config.yaml:
mcp:
enabled: "${MCP_ENABLED}" # MCP_ENABLED unset
issuer: "${MCP_ISSUER}" # unset
- 2.4.0:
/healthand/mcpreturn500; body containsmcp.issuer must be an absolute http(s) origin. - 2.5.0: MCP disabled;
/mcpnot mounted; no degraded boot; a warning is logged that the placeholder was treated as absent.
Evidence (from the published tarballs)
dist/lib/config.js—normalizeBooleanField: theisUnresolvedPlaceholder = /^\$\{[^}]*\}$/branch that warns anddelete obj[field]. (2.4.0 had no equivalent — a non-coercible value onmcp.enabledwas left unchanged.)dist/index.js— thenormalizeMcpSecurityConfig(mcpConfig, logger)call site; the comment now names the "unresolved${FLAG}placeholder" case.
Happy to open a CHANGELOG PR if that's useful.
- Dominant language
- JavaScript
- Stars
- 1
- Forks
- 2
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HarperFast/oauth
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
HarperFast/oauth#224 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
HarperFast/oauth#231 · 1 comment ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 68/100
HarperFast/oauth#230 · 1 comment ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 52/100
HarperFast/oauth#229 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
HarperFast/oauth#228 ·
All issues in HarperFast/oauth
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·
-
client-controller-update ta-bot-triage team-money-movement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MetaMask/metamask-mobile#36594 ·