Skip to content

Reject empty env var keys - #4410

Merged
jlowin merged 1 commit into
PrefectHQ:mainfrom
CodingFeng101:codex/agent-small-fix
Jun 29, 2026
Merged

Reject empty env var keys#4410
jlowin merged 1 commit into
PrefectHQ:mainfrom
CodingFeng101:codex/agent-small-fix

Conversation

@CodingFeng101

Copy link
Copy Markdown
Contributor

fastmcp run --env and the install helpers both accept environment variables as KEY=VALUE. Today a value like =secret or =secret passes validation and produces an empty environment variable name after stripping. That can write invalid server configuration or fail later in a less direct place.

This rejects empty keys at the parse boundary while preserving the existing value parsing behavior, including empty values such as EMPTY_VAR= and values containing additional = characters.

_parse_env_var("  =secret")  # exits with a clear validation error
_parse_env_var("EMPTY_VAR=")  # still accepted

@github-actions

This comment has been minimized.

@github-actions github-actions Bot closed this Jun 28, 2026
@marvin-context-protocol marvin-context-protocol Bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. cli Related to FastMCP CLI commands (run, dev, install) or CLI functionality. labels Jun 28, 2026
@jlowin jlowin reopened this Jun 28, 2026
@jlowin
jlowin merged commit 0d8844d into PrefectHQ:main Jun 29, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. bypass-issue-check cli Related to FastMCP CLI commands (run, dev, install) or CLI functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants