Not able to add some MCP servers using npx #6006
Replies: 6 comments 6 replies
-
The modelcontextprotocol SDK has trouble with some installations of node, this workaround worked for me: modelcontextprotocol/servers#64 (comment) mcpServers:
notion:
type: stdio
command: "/home/danny/.nvm/versions/node/v20.15.1/bin/node"
args:
- "/home/danny/.nvm/versions/node/v20.15.1/lib/node_modules/@suekou/mcp-notion-server/build/index.js"
env:
NOTION_API_TOKEN: xxx terminal logs 2025-02-24T21:33:09.626Z debug: [MCP][notion] Transport sending: {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"librechat-mcp... [truncated]
Starting Notion MCP Server...
Connecting server to transport...
Notion MCP Server running on stdio
2025-02-24T21:33:09.655Z debug: [MCP][notion] Transport sending: {"method":"notifications/initialized","jsonrpc":"2.0"}
2025-02-24T21:33:09.655Z info: [MCP][notion] Connection state: connected
2025-02-24T21:33:09.655Z info: [MCP][notion] Capabilities: {"tools":{}}
2025-02-24T21:33:09.655Z debug: [MCP][notion] Transport sending: {"method":"tools/list","jsonrpc":"2.0","id":1}
Received ListToolsRequest
2025-02-24T21:33:09.657Z info: [MCP][notion] Available tools: notion_append_block_children, notion_retrieve_block, notion_retrieve_block_children, notion_delete_block, notion_retrie... [truncated] |
Beta Was this translation helpful? Give feedback.
-
I've removed the env parts from both and the processes now start (but don't work as they don't have the environment vars). So I guess there's something not quite right with how this is all wired up. |
Beta Was this translation helpful? Give feedback.
-
i had success with following workaround, spawn sh -c and export env vars via sh command:
|
Beta Was this translation helpful? Give feedback.
-
For me the issue is related to timeouts, the MCP servers can't fully start up before LibreChat gives up on them. Ended up using a proxy to make them available over SSE, now it works. |
Beta Was this translation helpful? Give feedback.
-
It seems like when you use the "env" variable in the yaml config in docker that overrides the systems default PATH. so this worked for me: |
Beta Was this translation helpful? Give feedback.
-
Very helpful, hsani114. This setting of the PATH for ENV, npx mcp servers should be added to the docs here: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
I've tried two different mcp servers which use npx:
In the logs I see this:
I can get a shell on the container and run the npx command fine, so not sure what's going on...
One thing to note here - this is only happening when there are envs added. Without (fileserver and sequential thinking) seem to work fine)
Version Information
ghcr.io/danny-avila/librechat-dev-api latest df74a5e13736 3 days ago 1.08 GB
ghcr.io/danny-avila/librechat-rag-api-dev-lite latest 095db2c2ff3b 2 months ago 1.32 GB
Steps to Reproduce
Add an npx based mcp stdio server.
Watch sh not be able to find it
What browsers are you seeing the problem on?
Chrome
Relevant log output
Screenshots
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions