You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I talked about this in my comment on this other post, but essentially it's likely because of Windows policies not allowing the temporary execution using npx.
Instead, you have to install the package globally to your machine using npm.
Global installations via npm install -g adds the package to your system PATH, whereas npx uses a temporary PATH. which apparently Windows doesn't like.
Biggest downsides to this are it takes up local storage, and in order to use the latest version you need to manually update (compared to npx which uses the latest version every time and isn't installed on your local machine).
That being said, supposedly there's been a fix to this in Cursor v0.48, but in order to access the latest version you have to enable your Early Access under the Beta Features and then Update to the latest version of Cursor.
I confirm @ZylerKade your win10 method fixes this issue in Cline and Roo Code as well. I use windsurf regularly and it does not have this problem. I can use the json configs as is for the mcp servers and don't need to install globally.
How to Fix MCP Server "Error executing MCP tool: Not connected" Error
Important Note: This guide provides steps to resolve the common "Not connected" error with Model Context Protocol (MCP) servers. The brave-search server is used in the examples below, but these steps and principles also apply to similar connection issues you might encounter with many other MCP servers. You may need to adapt the commands and configuration details based on the specific server you are having trouble with.
1. Check MCP Server Configuration
Open your MCP settings file. This file is usually located at:
C:\Users\**<YOUR_USERNAME>**\AppData\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json (Replace <YOUR_USERNAME> with your actual Windows username.)
Verify that the entry for the problematic MCP server matches the format of your other working servers or the correct format shown below.
Especially on Windows systems, the "command" should typically be "cmd", and the "args" array should start with "/c", "npx", "-y", "package-name".
Example Difference: Non-Working vs. Working Configuration (Windows)
Below shows the difference between a common incorrect configuration and the corrected, working configuration for the brave-search server on Windows:
Incorrect / Non-Working Example (Common Windows Issue): In this configuration, command is set directly to npx, and /c is missing from args.
Correct / Working Example (Fixed for Windows): In this configuration, command has been changed to "cmd", and "/c", "npx" have been added to the beginning of the args array.
The Key Change: On Windows, running a Node.js package via npx often requires the cmd /c prefix to be executed correctly from within another process like VSCode's extension host. Therefore, "command": "npx" was replaced with "command": "cmd", and the actual npx command was moved into the "args" array, preceded by "/c". This fix allows Windows to interpret the command correctly and launch the server.
2. Ensure API Keys and Environment Variables Are Set
Make sure any required API keys (like BRAVE_API_KEY in the example above) are correctly added under the "env" section for the relevant server in the configuration file.
Double-check for typos in key names or values. Missing or incorrect keys are a common cause of connection problems. (Ensure you replace "YOUR_API_KEY" in the working example with your actual, valid key).
3. Save and Close the Settings File
Save the changes you made to the cline_mcp_settings.json file.
It's often recommended to close and reopen VSCode to ensure the changes take full effect.
4. Restart the Claude Extension or VSCode
MCP servers are usually started automatically by the Claude extension. However, if you're getting a "Not connected" error, the server might not have started correctly or might have crashed.
The most reliable method is to completely close and restart VSCode to force all MCP servers and the extension to reload.
Alternatively, you can try disabling and then re-enabling the Claude extension from the VSCode Extensions tab.
5. Wait a Few Seconds
After restarting VSCode or the extension, wait for 5-10 seconds to allow the MCP server time to initialize in the background.
Then, try using your MCP tool (e.g., the Brave Search command) again.
6. Check for Typos or Wrong Server Names
When calling the MCP tool (e.g., in a chat prompt or via the command palette), ensure the server name (server_name) you use exactly matches the key in your cline_mcp_settings.json file (e.g., "github.com/modelcontextprotocol/servers/tree/main/src/brave-search").
Even a minor typo or an extra character will cause a "Not connected" error.
7. Verify Internet Connection
Some MCP servers, like Brave Search, require an active internet connection to function.
Make sure your internet connection is working and that no firewall or proxy settings are blocking outgoing connections from the server process (or the npx command).
8. Update or Reinstall the MCP Server Package
There might be an issue with the NPM package that runs the server. To check this, open a terminal (Command Prompt, PowerShell, or Terminal) and try running the package with the --help flag (e.g., for Brave Search):
If this command results in an error, hangs for a long time, or doesn't run at all, the package might be corrupted or there might have been an issue during download.
You can try the following steps:
Clear the NPM cache: npm cache clean --force
Try manually updating the package to the latest version (if applicable).
If the problem persists, you might consider finding the cache directory where npx downloads packages (often a location like %LocalAppData%\npm-cache\_npx on Windows) and deleting the folder for the problematic package.
9. Check for Errors in the VSCode Output Panel
For more detailed error messages, check the VSCode Output panel:
Go to View > Output in VSCode (or press Ctrl+Shift+U).
Select the relevant channel from the dropdown menu, such as "Claude" or "Extension Host".
Examine the output in the panel for any error messages related to MCP server startup (e.g., command not found, missing API key, connection errors, etc.). These messages can often help pinpoint the source of the problem.
10. As a Last Resort: Remove and Re-add the MCP Server
If none of the above steps work, try completely removing and then re-adding the problematic MCP server configuration as a last resort:
Open the cline_mcp_settings.json file.
Carefully delete the entire JSON block (including the key and value) for the server you're having trouble with.
Save the file.
Restart VSCode.
After VSCode restarts, carefully re-add the server configuration to the file (e.g., using the Correct / Working Example format from Step 1). Ensure you enter the API keys and other settings correctly.
Save the file again and restart VSCode one more time.
Wait a few seconds after the restart, then test the server.
Reacted by Shi Yong Zhao, foe919, bsod128, AliasFox, Adriel Martins, Jawher Khalifa and Rovshan Badirkhanov
Deprecation Notice: Development for server-github has been moved to GitHub in the http://github.com/github/github-mcp-server repo. PRs to server-github in this repo are no longer being merged.
The Key Change: On Windows, running a Node.js package via npx often requires the cmd /c prefix to be executed correctly from within another process like VSCode's extension host. Therefore, "command": "npx" was replaced with "command": "cmd", and the actual npx command was moved into the "args" array, preceded by "/c". This fix allows Windows to interpret the command correctly and launch the server.
I also find another workaround. Instead of another layer of shell I wrote the absolute path to my npx:
Activity
BadAtCaptchas commentedon Mar 30, 2025
+1 having this issue on every MCP tool I attempt to use.
assaf-b commentedon Apr 1, 2025
+1 on this
ZachTheJack commentedon Apr 1, 2025
I was able to get mine working on Windows 10 using the following:
{ "mcpServers": { "github": { "command": "cmd", "args": [ "/c", "npx", "-y", "@modelcontextprotocol/server-github" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>" } } } }And then using the following command in my terminal:
npm install -g @modelcontextprotocol/server-githubI talked about this in my comment on this other post, but essentially it's likely because of Windows policies not allowing the temporary execution using npx.
Instead, you have to install the package globally to your machine using npm.
Global installations via
npm install -gadds the package to your system PATH, whereas npx uses a temporary PATH. which apparently Windows doesn't like.Biggest downsides to this are it takes up local storage, and in order to use the latest version you need to manually update (compared to npx which uses the latest version every time and isn't installed on your local machine).
That being said, supposedly there's been a fix to this in Cursor v0.48, but in order to access the latest version you have to enable your Early Access under the Beta Features and then Update to the latest version of Cursor.
Hope this helps!
jesse-lane-ai commentedon Apr 6, 2025
I confirm @ZylerKade your win10 method fixes this issue in Cline and Roo Code as well. I use windsurf regularly and it does not have this problem. I can use the json configs as is for the mcp servers and don't need to install globally.
snahmetkaya commentedon Apr 10, 2025
How to Fix MCP Server "Error executing MCP tool: Not connected" Error
1. Check MCP Server Configuration
Open your MCP settings file. This file is usually located at:
C:\Users\**<YOUR_USERNAME>**\AppData\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json(
Replace <YOUR_USERNAME> with your actual Windows username.)Verify that the entry for the problematic MCP server matches the format of your other working servers or the correct format shown below.
Especially on Windows systems, the
"command"should typically be"cmd", and the"args"array should start with"/c","npx","-y","package-name".Example Difference: Non-Working vs. Working Configuration (Windows)
Below shows the difference between a common incorrect configuration and the corrected, working configuration for the
brave-searchserver on Windows:Incorrect / Non-Working Example (Common Windows Issue):
In this configuration,
commandis set directly tonpx, and/cis missing fromargs.Correct / Working Example (Fixed for Windows):
In this configuration,
commandhas been changed to"cmd", and"/c", "npx"have been added to the beginning of theargsarray.The Key Change: On Windows, running a Node.js package via
npxoften requires thecmd /cprefix to be executed correctly from within another process like VSCode's extension host. Therefore,"command": "npx"was replaced with"command": "cmd", and the actualnpxcommand was moved into the"args"array, preceded by"/c". This fix allows Windows to interpret the command correctly and launch the server.2. Ensure API Keys and Environment Variables Are Set
Make sure any required API keys (like
BRAVE_API_KEYin the example above) are correctly added under the"env"section for the relevant server in the configuration file.Double-check for typos in key names or values. Missing or incorrect keys are a common cause of connection problems. (Ensure you replace
"YOUR_API_KEY"in the working example with your actual, valid key).3. Save and Close the Settings File
Save the changes you made to the
cline_mcp_settings.jsonfile.It's often recommended to close and reopen VSCode to ensure the changes take full effect.
4. Restart the Claude Extension or VSCode
MCP servers are usually started automatically by the Claude extension. However, if you're getting a "Not connected" error, the server might not have started correctly or might have crashed.
The most reliable method is to completely close and restart VSCode to force all MCP servers and the extension to reload.
Alternatively, you can try disabling and then re-enabling the Claude extension from the VSCode Extensions tab.
5. Wait a Few Seconds
After restarting VSCode or the extension, wait for 5-10 seconds to allow the MCP server time to initialize in the background.
Then, try using your MCP tool (e.g., the Brave Search command) again.
6. Check for Typos or Wrong Server Names
When calling the MCP tool (e.g., in a chat prompt or via the command palette), ensure the server name (
server_name) you use exactly matches the key in yourcline_mcp_settings.jsonfile (e.g.,"github.com/modelcontextprotocol/servers/tree/main/src/brave-search").Even a minor typo or an extra character will cause a "Not connected" error.
7. Verify Internet Connection
Some MCP servers, like Brave Search, require an active internet connection to function.
Make sure your internet connection is working and that no firewall or proxy settings are blocking outgoing connections from the server process (or the
npxcommand).8. Update or Reinstall the MCP Server Package
There might be an issue with the NPM package that runs the server. To check this, open a terminal (Command Prompt, PowerShell, or Terminal) and try running the package with the
--helpflag (e.g., for Brave Search):If this command results in an error, hangs for a long time, or doesn't run at all, the package might be corrupted or there might have been an issue during download.
You can try the following steps:
npm cache clean --forcenpxdownloads packages (often a location like%LocalAppData%\npm-cache\_npxon Windows) and deleting the folder for the problematic package.9. Check for Errors in the VSCode Output Panel
For more detailed error messages, check the VSCode Output panel:
Ctrl+Shift+U).10. As a Last Resort: Remove and Re-add the MCP Server
If none of the above steps work, try completely removing and then re-adding the problematic MCP server configuration as a last resort:
cline_mcp_settings.jsonfile.xiao-yuhan commentedon Apr 14, 2025
Thanks, it works
cliffhall commentedon Apr 19, 2025
Deprecation Notice: Development for
server-githubhas been moved to GitHub in the http://github.com/github/github-mcp-server repo. PRs toserver-githubin this repo are no longer being merged.foe919 commentedon Apr 22, 2025
The 3 adds are the key.
EzioMercer commentedon Feb 23, 2026
This works perfectly:
I also find another workaround. Instead of another layer of shell I wrote the absolute path to my
npx: