-
Notifications
You must be signed in to change notification settings - Fork 344
Env placeholder syntax for --header/--env is undiscoverable from CLI or npm package; ${env:VAR} silently passes through verbatim #323
Copy link
Copy link
Closed
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Activity
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
The environment placeholder format supported by mcporter for HTTP
headersand stdioenvvalues (${VAR},${VAR:-fallback}, and whole-value$env:VAR) is not discoverable by a user or coding agent that only has the npm package installed: it is not mentioned in any--helptext, the README only says configs accept "environment placeholders" without giving the syntax, and the docs that do document it (docs/config.md) are not shipped in the published package (the tarball contains onlydist/,LICENSE,README.md, andpackage.json). The only way to learn the format without opening the repo on GitHub is to readdist/env.js/dist/runtime/utils.jsin the installed package.Worse, the
${env:VAR}syntax that is the de-facto convention in Cursor / Claude Code / Codex / Windsurf MCP configs is silently NOT expanded: a header value likeAuthorization: Bearer ${env:SOME_API_KEY}is sent over the wire literally, producing a 401 that looks like a wrong API key. I hit exactly this:mcporter config add <name> <url> --header "Authorization=Bearer ${env:INNGEST_API_KEY}"wrote the config fine and connected with 401; switching the config to${INNGEST_API_KEY}worked immediately. The placeholder regex requires an identifier followed by}or:-fallback, so${env:VAR}fails the match and falls through untouched, and materializeHeaders sends the literal string. Because the CLI help promises nothing about interpolation, a user has no way to know this is the cause.Places where the format could be mentioned (so a user or agent knows without reading source)
mcporter config add --help— the--header KEY=valueand--env KEY=valueflag descriptions should state the supported placeholders and show an example, since that is the exact moment a user is authoring header/env values.mcporter config --helpandmcporter config get --help— parent/subcommand help for the config surface.${VAR}/${VAR:-fallback}/$env:VAR), because docs/config.md is not available to npm installers.envandheadersin the config schema, so editor/IDE validation surfaces the format.${env:...}pattern, fail fast with a clear error naming the variable instead of silently sending the literal string (which manifests as opaque 401/403 auth failures); either translate${env:VAR}to the mcporter syntax or reject it explicitly.${env:VAR}in mcpServers headers, so the import reference is the most likely place a user will inherit this syntax from and should warn that mcporter does not expand it.Environment