-
Notifications
You must be signed in to change notification settings - Fork 683
Default Environment should be appended with custom env's passed to client (instead of replacing) #216
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
Comments
@Pdash-exceeds, thanks for filing this! Does no one use 'env'? 😂 |
I think most people use a remote MCP so they don't use env |
this is for stdio, and I am struggling with env config for testing various local mcp servers. |
To use the Notion MCP, which requires certain environment variables, I worked around the original design by merging getDefaultEnvironment() with my own env like this:
|
Describe the bug
In this line
typescript-sdk/src/client/stdio.ts
Line 119 in 0fa2397
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Both cases should pass.
env: { ...getDefaultEnvironment(), ...(this._serverParams.env ?? {}) },
Logs
file:///Users/pradeeptadash/langchain_mcp/node_modules/@langchain/mcp-adapters/dist/src/client.js:407
throw new MCPClientError(
Failed to connect to stdio server "${serverName}": ${error}
, serverName);^
MCPClientError: Failed to connect to stdio server "linear-server": Error: spawn npx ENOENT
at MultiServerMCPClient.initializeStdioConnection (file:///Users/pradeeptadash/langchain_mcp/node_modules/@langchain/mcp-adapters/dist/src/client.js:407:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MultiServerMCPClient.initializeConnections (file:///Users/pradeeptadash/langchain_mcp/node_modules/@langchain/mcp-adapters/dist/src/client.js:371:17)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: