Skip to content

fix(tools): restrict get-env to accept key parameter only - #4001

Open
Jim1874 wants to merge 1 commit into
modelcontextprotocol:mainfrom
Jim1874:fix/issue-3986-get-env-key-param
Open

fix(tools): restrict get-env to accept key parameter only#4001
Jim1874 wants to merge 1 commit into
modelcontextprotocol:mainfrom
Jim1874:fix/issue-3986-get-env-key-param

Conversation

@Jim1874

@Jim1874 Jim1874 commented Apr 22, 2026

Copy link
Copy Markdown

Summary

Security fix: get-env tool was exposing entire process.env to any caller.

Changes:

  • inputSchema now requires a key parameter
  • Returns only process.env[key] instead of full env
  • Returns 'not set' for missing keys

Closes #3986

Security fix: get-env tool was returning full process.env to any caller.
Now requires a 'key' parameter and returns only process.env[key].

Closes modelcontextprotocol#3986

@LuuOW LuuOW left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical audit: Verified MCP server implementation for consistency with current SDK patterns.

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.

server-everything: get-env tool returns full process.env without any filtering

2 participants