-
Notifications
You must be signed in to change notification settings - Fork 325
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
Connection failures with npm-based MCP servers while uvx-based servers work correctly (Solved, see the comment in this post) #76
Comments
Solution for MCP Servers Connection Issues with NVM/NPMBackgroundThis solution is inspired by and builds upon the workaround discussed in Issue #64. While the original solution was for macOS, this implementation is specifically for Windows systems using NVM (Node Version Manager). ProblemWhen using NVM or standard Node.js installation, the default configuration using Solution OverviewThe solution involves:
Step-by-Step Guide1. Locate Node.js and npm pathsOpen Command Prompt (CMD) as administrator and run: where node This will show your Node.js executable path. Example output:
Then find your global npm packages location: npm root -g Example output:
2. Install Required Packages GloballyRun these commands in CMD: npm install -g @modelcontextprotocol/server-filesystem
npm install -g @modelcontextprotocol/server-github
npm install -g @modelcontextprotocol/server-memory
npm install -g @modelcontextprotocol/server-puppeteer
npm install -g @modelcontextprotocol/server-brave-search
npm install -g @modelcontextprotocol/server-google-maps
npm install -g @modelcontextprotocol/server-postgres 3. Verify InstallationsCheck each package installation: npm list -g @modelcontextprotocol/server-filesystem
npm list -g @modelcontextprotocol/server-github
npm list -g @modelcontextprotocol/server-memory
npm list -g @modelcontextprotocol/server-puppeteer
npm list -g @modelcontextprotocol/server-brave-search
npm list -g @modelcontextprotocol/server-google-maps
npm list -g @modelcontextprotocol/server-postgres Expected output format:
4. Update Configuration FileModify your {
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": [
"mcp-server-sqlite",
"--db-path",
"D:\\github_repository\\test.db"
]
},
"filesystem": {
"command": "D:\\Program\\nvm\\node.exe",
"args": [
"D:\\Program\\nvm\\node_modules\\@modelcontextprotocol\\server-filesystem\\dist\\index.js",
"D:\\github_repository",
"D:\\github_repository\\image-generator"
]
},
"github": {
"command": "D:\\Program\\nvm\\node.exe",
"args": [
"D:\\Program\\nvm\\node_modules\\@modelcontextprotocol\\server-github\\dist\\index.js"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": ""
}
},
"postgres": {
"command": "D:\\Program\\nvm\\node.exe",
"args": [
"D:\\Program\\nvm\\node_modules\\@modelcontextprotocol\\server-postgres\\dist\\index.js",
"postgresql://localhost/mydb"
]
},
"memory": {
"command": "D:\\Program\\nvm\\node.exe",
"args": [
"D:\\Program\\nvm\\node_modules\\@modelcontextprotocol\\server-memory\\dist\\index.js"
]
},
"puppeteer": {
"command": "D:\\Program\\nvm\\node.exe",
"args": [
"D:\\Program\\nvm\\node_modules\\@modelcontextprotocol\\server-puppeteer\\dist\\index.js"
]
},
"brave-search": {
"command": "D:\\Program\\nvm\\node.exe",
"args": [
"D:\\Program\\nvm\\node_modules\\@modelcontextprotocol\\server-brave-search\\dist\\index.js"
],
"env": {
"BRAVE_API_KEY": ""
}
},
"google-maps": {
"command": "D:\\Program\\nvm\\node.exe",
"args": [
"D:\\Program\\nvm\\node_modules\\@modelcontextprotocol\\server-google-maps\\dist\\index.js"
],
"env": {
"GOOGLE_MAPS_API_KEY": ""
}
},
"fetch": {
"command": "uvx",
"args": [
"mcp-server-fetch"
]
}
},
"globalShortcut": "Ctrl+Q"
} 5. Important Notes
6. Apply Changes
VerificationAfter restart, all MCP servers should connect successfully. The TroubleshootingIf you encounter issues:
This solution has been tested on Windows 11 (Build 22631.4460) with Node.js managed by NVM. |
I'm getting the opposite 😆 |
Thanks a ton! Solved my issue. |
thanks a lot, it works under windows 11. |
trying to add simple DDG MCP, but getting error... any proper guides for python? in the docs seem having problem with the file dir.. working in windows |
followed the instructions on windows 10, i only got memory and pupeteer working |
you may check the rest tools at step2(installed successful) and step3(the path alignment with config file ) |
Sorry, this is the same issue as #40. We're working on a fix. 🙏 |
Perfect! Thanks so much. (Edit: The only one that didn't work was Github.)- Re-Edit, got Github working and made a repo, had to do some steps in Poweshell to post but easy enough considering I don't know how to code. Edited the JSON below for Github with what worked. { |
I got it working , i had referenced the full path of the node executable instead of just "node" |
Let me fetch and examine that issue to better understand the uvx vs npx situation: I apologize - let me try using the search function instead to find relevant information: Ah, this is quite interesting! From what I can gather:
Looking at your JSON configuration, you've cleverly used:
This explains why your setup works when others fail! The reason many people struggle is likely because they're trying to use npx for everything, not realizing the distinction between Python-based and TypeScript-based servers. Given this understanding, I think we have a few options for implementing multi-database support:
Would you like me to explore any of these approaches? Also, this explains how you got 49 tools working - you've managed to get both the Python (uvx) and Node.js based tools functioning correctly, which is quite an achievement! Currently fully functioning JSON:{
}, |
Thank you, this worked for me |
Environment
System Information
Configuration File
Location:
\Claude\claude_desktop_config.json
The text was updated successfully, but these errors were encountered: