context7 icon indicating copy to clipboard operation
context7 copied to clipboard

MCP server error in Windsurf #mcp

Open csfalcao opened this issue 1 year ago • 5 comments

Can't use the MCP server. Using the code provided below:

"}, "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp@latest"] }"

the error is:

"Error: failed to initialize server: <truncated 3 bytes> error code EEXIST npm error syscall rename npm error path /Users/csfalcao/.npm/_cacache/tmp/9ea4a422 npm error dest /Users/csfalcao/.npm/_cacache/content-v2/sha512/02/d7/e8d783a26d2bf9c00a7855636c15813501c850453bfd701196113e296561f362c845492f4d408e88e7badd2a7f5cae859531b6056cb849fb226f9992081f npm error errno -13 npm error EACCES: permission denied, rename '/Users/csfalcao/.npm/_cacache/tmp/9ea4a422' -> '/Users/csfalcao/.npm/_cacache/content-v2/sha512/02/d7/e8d783a26d2bf9c00a7855636c15813501c850453bfd701196113e296561f362c845492f4d408e88e7badd2a7f5cae859531b6056cb849fb226f9992081f' npm error File exists: /Users/csfalcao/.npm/_cacache/content-v2/sha512/02/d7/e8d783a26d2bf9c00a7855636c15813501c850453bfd701196113e296561f362c845492f4d408e88e7badd2a7f5cae859531b6056cb849fb226f9992081f npm error Remove the existing file and try again, or run npm npm error with --force to overwrite files recklessly. npm error A complete log of this run can be found in: /Users/csfalcao/.npm/_logs/2025-05-18T01_12_44_866Z-debug-0.log: server terminated. Check your configuration."

Other MCP servers are ok.

csfalcao avatar May 22 '25 01:05 csfalcao

I copied the code here https://github.com/upstash/context7/blob/master/README.md#install-in-windsurf to the map_config.json file and clicked Refresh and the error message above in red is displayed.

Using Windsurf latest version in macOS latest version.

Tried Environment Variables, ERR_MODULE_NOT_FOUND, ESM Resolution Issues, TLS/Certificate Issues and MCP Client Errors with no success

csfalcao avatar May 22 '25 01:05 csfalcao

Hi,

Thanks for reporting this! The error you're encountering:

EACCES: permission denied, rename '.../tmp/...' -> '.../content-v2/...'

usually occurs due to a permission issue or a conflict with an existing file in the npm cache.

How to Fix

Try the following steps:

  1. Clean the npm cache:

    npm cache clean --force
    
  2. (Optional) Manually delete the conflicting file (if the error persists):

    rm /Users/csfalcao/.npm/_cacache/content-v2/sha512/02/d7/...
    
  3. Ensure you own the .npm directory:

    sudo chown -R $(whoami) ~/.npm
    
  4. Retry your command with --force if needed:

    npm install --force
    

Let me know if the issue persists after trying these steps

enesgules avatar May 23 '25 00:05 enesgules

After testing the recommended fix, it didn't work (0 available MCP server) but I discovered Windsurf Version: 1.9.2 has discontinued the MCP server list panel so there's no way to see the error message now.

csfalcao avatar May 23 '25 22:05 csfalcao

Could you try with Smithery please

enesgules avatar May 24 '25 01:05 enesgules

Closing this for now, let us know if you encounter more issues

enesgules avatar May 27 '25 16:05 enesgules