-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MCP client with npx not working when env parameter of StdioServerParameters is set #326
Comments
…g when env parameter of StdioServerParameters is set
Perhaps this line: env=server.env if server.env is not None else get_default_environment(), to this: env={**get_default_environment(), **server.env} if server.env is not None else get_default_environment(), I've created pull request #327 |
That's I guess because npx needs some environment variable to work properly? |
The current behavior makes sense to me. It doesn't let secrets that may be available via env vars visible to the MCP server. |
Your assertion that current (buggy) implementation doesn't expose secrets is false. If |
…g when env parameter of StdioServerParameters is set
Oh sorry, that makes sense. 👍 |
MCP client code using StdioServerParameters with
npx
command is not working (with any MCP server) when itsenv
parameter is set to something other thanNone
.Demo code:
Fail output:
No fail output:
Secure MCP Filesystem Server running on stdio Allowed directories: [ '/home' ]
Interestingly, running
npm i @modelcontextprotocol/server-filesystem
and using node directly works fine:Desktop:
The text was updated successfully, but these errors were encountered: