Skip to content

getting error #19

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

Closed
fisforfaheem opened this issue Apr 18, 2025 · 74 comments
Closed

getting error #19

fisforfaheem opened this issue Apr 18, 2025 · 74 comments
Labels
mcp Related to mcp server

Comments

@fisforfaheem
Copy link

Image

@kamiljaneczek
Copy link

+1 have the same issue

@rickiicat
Copy link

I have the same issue, the mcp server for cursor isn't working. I'm using windows.

@JvdsReform
Copy link

+1, I have the same error.

@R3verseIN
Copy link

I have the same error.

@klppl
Copy link

klppl commented Apr 19, 2025

Running Cursor (Linux) also get "client closed".

2025-04-19 09:52:04.679 [info] >>>>> MCP Startup
2025-04-19 10:50:01.444 [info] ext7: Handling CreateClient action
2025-04-19 10:50:01.445 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:50:01.445 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:01.445 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:01.446 [info] ext7: Client closed for command
2025-04-19 10:50:01.447 [error] ext7: Error in MCP: Client closed
2025-04-19 10:50:01.470 [info] ext7: Handling CreateClient action
2025-04-19 10:50:01.470 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:50:01.470 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:01.470 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:01.471 [info] ext7: Client closed for command
2025-04-19 10:50:01.471 [error] ext7: Error in MCP: Client closed
2025-04-19 10:50:01.473 [info] ext7: Handling ListOfferings action
2025-04-19 10:50:01.473 [error] ext7: No server info found
2025-04-19 10:50:01.473 [info] ext7: Handling ListOfferings action
2025-04-19 10:50:01.473 [error] ext7: No server info found
2025-04-19 10:50:12.836 [info] ext7: Handling ReloadClient action
2025-04-19 10:50:12.836 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:50:12.837 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:12.837 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:12.837 [error] ext7: Failed to reload client: A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:12.851 [info] ext7: Client closed for command
2025-04-19 10:50:12.851 [error] ext7: Error in MCP: Client closed
2025-04-19 10:50:12.876 [info] ext7: Handling ListOfferings action
2025-04-19 10:50:12.876 [error] ext7: No server info found
2025-04-19 10:50:13.722 [info] ext7: Handling ReloadClient action
2025-04-19 10:50:13.722 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:50:13.722 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:13.722 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:13.722 [error] ext7: Failed to reload client: A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:13.723 [info] ext7: Client closed for command
2025-04-19 10:50:13.723 [error] ext7: Error in MCP: Client closed
2025-04-19 10:50:13.724 [info] ext7: Handling ListOfferings action
2025-04-19 10:50:13.724 [error] ext7: No server info found
2025-04-19 10:50:36.551 [info] ext7: Handling CreateClient action
2025-04-19 10:50:36.551 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:50:36.551 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:36.551 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:36.552 [info] ext7: Client closed for command
2025-04-19 10:50:36.552 [error] ext7: Error in MCP: Client closed
2025-04-19 10:50:36.577 [info] ext7: Handling CreateClient action
2025-04-19 10:50:36.577 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:50:36.577 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:36.577 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:36.578 [info] ext7: Client closed for command
2025-04-19 10:50:36.578 [error] ext7: Error in MCP: Client closed
2025-04-19 10:50:36.579 [info] ext7: Handling ListOfferings action
2025-04-19 10:50:36.579 [error] ext7: No server info found
2025-04-19 10:50:36.579 [info] ext7: Handling ListOfferings action
2025-04-19 10:50:36.579 [error] ext7: No server info found
2025-04-19 10:51:53.354 [info] ext7: Handling CreateClient action
2025-04-19 10:51:53.354 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:51:53.354 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:51:53.354 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:51:53.355 [info] ext7: Client closed for command
2025-04-19 10:51:53.355 [error] ext7: Error in MCP: Client closed
2025-04-19 10:51:53.370 [info] ext7: Handling CreateClient action
2025-04-19 10:51:53.370 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:51:53.370 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:51:53.370 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:51:53.370 [info] ext7: Client closed for command
2025-04-19 10:51:53.370 [error] ext7: Error in MCP: Client closed
2025-04-19 10:51:53.371 [info] ext7: Handling ListOfferings action
2025-04-19 10:51:53.371 [error] ext7: No server info found
2025-04-19 10:51:53.372 [info] ext7: Handling ListOfferings action
2025-04-19 10:51:53.372 [error] ext7: No server info found
2025-04-19 10:51:55.876 [info] ext7: Handling ReloadClient action
2025-04-19 10:51:55.876 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:51:55.876 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:51:55.876 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:51:55.876 [error] ext7: Failed to reload client: A system error occurred (spawn npx ENOENT)
2025-04-19 10:51:55.877 [info] ext7: Client closed for command
2025-04-19 10:51:55.878 [error] ext7: Error in MCP: Client closed
2025-04-19 10:51:55.887 [info] ext7: Handling ListOfferings action
2025-04-19 10:51:55.888 [error] ext7: No server info found
2025-04-19 10:52:44.005 [info] ext7: Handling ReloadClient action
2025-04-19 10:52:44.005 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:52:44.006 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:52:44.006 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:52:44.006 [error] ext7: Failed to reload client: A system error occurred (spawn npx ENOENT)
2025-04-19 10:52:44.007 [info] ext7: Client closed for command
2025-04-19 10:52:44.007 [error] ext7: Error in MCP: Client closed
2025-04-19 10:52:44.020 [info] ext7: Handling ListOfferings action
2025-04-19 10:52:44.020 [error] ext7: No server info found
2025-04-19 10:53:08.209 [info] ext7: Handling ReloadClient action
2025-04-19 10:53:08.209 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:53:08.209 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:53:08.210 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:53:08.210 [error] ext7: Failed to reload client: A system error occurred (spawn npx ENOENT)
2025-04-19 10:53:08.211 [info] ext7: Client closed for command
2025-04-19 10:53:08.211 [error] ext7: Error in MCP: Client closed
2025-04-19 10:53:08.227 [info] ext7: Handling ListOfferings action
2025-04-19 10:53:08.227 [error] ext7: No server info found
2025-04-19 10:53:09.180 [info] ext7: Handling ReloadClient action
2025-04-19 10:53:09.180 [info] ext7: Starting new stdio process with command: npx -y @upstash/context7-mcp@latest
2025-04-19 10:53:09.180 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:53:09.181 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:53:09.181 [error] ext7: Failed to reload client: A system error occurred (spawn npx ENOENT)
2025-04-19 10:53:09.182 [info] ext7: Client closed for command
2025-04-19 10:53:09.183 [error] ext7: Error in MCP: Client closed
2025-04-19 10:53:09.185 [info] ext7: Handling ListOfferings action
2025-04-19 10:53:09.185 [error] ext7: No server info found

@enesgules
Copy link
Collaborator

Could you please try bunx instead of npx?

Also at which point this started to happen? The first install? Or when you tried to reload the server?

@enesgules
Copy link
Collaborator

For windows could you try this please:

{
  "servers": {
    "context7": {
       "type": "stdio",
      "command": "C:\\Windows\\System32\\cmd.exe",
      "args": [
        "/c",
        "npx",
        "-y",
        "@upstash/context7-mcp@latest"
      ]
    }
  }
}

@klppl
Copy link

klppl commented Apr 19, 2025

Could you please try bunx instead of npx?

Also at which point this started to happen? The first install? Or when you tried to reload the server?

First install.

bunx gives me the same error "client closed".

2025-04-19 14:08:25.048 [info] >>>>> MCP Startup
2025-04-19 14:08:25.048 [info] ext7: Handling CreateClient action
2025-04-19 14:08:25.048 [info] ext7: Starting new stdio process with command: bunx -y @upstash/context7-mcp@latest
2025-04-19 14:08:25.048 [error] ext7: Client error for command A system error occurred (spawn bunx ENOENT)
2025-04-19 14:08:25.048 [error] ext7: Error in MCP: A system error occurred (spawn bunx ENOENT)
2025-04-19 14:08:25.048 [info] ext7: Client closed for command
2025-04-19 14:08:25.048 [error] ext7: Error in MCP: Client closed
2025-04-19 14:08:25.048 [info] ext7: Handling ListOfferings action
2025-04-19 14:08:25.048 [error] ext7: No server info found

@eylonshm
Copy link

Same here, using MacOS, Cursor, tried both npx and bunx

@enesgules
Copy link
Collaborator

The error spawn npx ENOENT means that your system tried to run the npx command, but couldn’t find it.

Run npx -v in your terminal.
If it says “command not found”, install Node.js.

Ensure Node.js is in your PATH.

@klppl
Copy link

klppl commented Apr 19, 2025

The error spawn npx ENOENT means that your system tried to run the npx command, but couldn’t find it.

Run npx -v in your terminal. If it says “command not found”, install Node.js.

Ensure Node.js is in your PATH.

This is what I get.
I will go away for a few hours and can continue troubleshoot.

$ npx -v
10.8.2

$ which nodejs
/usr/bin/nodejs

$ nodejs -v
v20.19.0

My guess that it could be releated that Cursor runs as appimage. I will get back here later when I can google some more.

@klppl
Copy link

klppl commented Apr 19, 2025

Hm... this is strange. Last message before I left I had troubleshooted for about 20 minutes.
Just came back to my computer and refreshed the MCP and it now works.

Has it been self-resolved?

Does it work for you now?
@fisforfaheem @kamiljaneczek @rivenrowe @JvdsReform @R3verseIN

@R3verseIN
Copy link

Hm... this is strange. Last message before I left I had troubleshooted for about 20 minutes. Just came back to my computer and refreshed the MCP and it now works.

Has it been self-resolved?

Does it work for you now? @fisforfaheem @kamiljaneczek @rivenrowe @JvdsReform @R3verseIN

no

Image

@dunfe
Copy link

dunfe commented Apr 20, 2025

For Windows user:

Create npm folder in this path:

C:\Users\<User>\AppData\Roaming\npm

@R3verseIN
Copy link

For Windows user:

Create npm folder in this path:

C:\Users\<User>\AppData\Roaming\npm

its already there
Directory of C:\Users\r3versein\AppData\Roaming\npm

18-04-2025 21:20

.
18-04-2025 21:20 ..
18-04-2025 21:20 439 context7-mcp
18-04-2025 21:20 350 context7-mcp.cmd
18-04-2025 21:20 905 context7-mcp.ps1
23-02-2025 21:42 407 cordova
23-02-2025 21:42 334 cordova.cmd
23-02-2025 21:42 841 cordova.ps1
23-03-2025 16:57 423 http-server
23-03-2025 16:57 342 http-server.cmd
23-03-2025 16:57 873 http-server.ps1
12-02-2025 19:57 411 lt
12-02-2025 19:57 336 lt.cmd
12-02-2025 19:57 849 lt.ps1
23-02-2025 17:50 445 next-on-pages
23-02-2025 17:50 353 next-on-pages.cmd
23-02-2025 17:50 917 next-on-pages.ps1
18-04-2025 21:20 node_modules
14-02-2025 17:15 405 npm
14-02-2025 17:15 333 npm.cmd
14-02-2025 17:15 837 npm.ps1
14-02-2025 17:15 405 npx
14-02-2025 17:15 333 npx.cmd
14-02-2025 17:15 837 npx.ps1
19-01-2025 13:13 403 pnpm
19-01-2025 13:13 332 pnpm.cmd
19-01-2025 13:13 833 pnpm.ps1
19-01-2025 13:13 403 pnpx
19-01-2025 13:13 332 pnpx.cmd
19-01-2025 13:13 833 pnpx.ps1
23-02-2025 14:04 405 tsc
23-02-2025 14:04 333 tsc.cmd
23-02-2025 14:04 837 tsc.ps1
23-02-2025 14:04 415 tsserver
23-02-2025 14:04 338 tsserver.cmd
23-02-2025 14:04 857 tsserver.ps1
23-02-2025 17:48 417 wrangler
23-02-2025 17:48 339 wrangler.cmd
23-02-2025 17:48 861 wrangler.ps1
23-02-2025 17:48 417 wrangler2
23-02-2025 17:48 339 wrangler2.cmd
23-02-2025 17:48 861 wrangler2.ps1
39 File(s) 20,930 bytes
3 Dir(s) 32,650,571,776 bytes free

C:\Users\r3versein\AppData\Roaming\npm>

@enesgules
Copy link
Collaborator

Would anyone be interested to hop on a call and share their screen so that we can try to solve the issue together? I can't reproduce it.

@JvdsReform
Copy link

For windows could you try this please:

{
  "servers": {
    "context7": {
       "type": "stdio",
      "command": "C:\\Windows\\System32\\cmd.exe",
      "args": [
        "/c",
        "npx",
        "-y",
        "@upstash/context7-mcp@latest"
      ]
    }
  }
}

Doesn't work for me

@0xSam404
Copy link

0xSam404 commented Apr 20, 2025

I got the same issue.

using Cursor 0.49.2 and macOS.

when I change the mcp configuration to the following

"context7": {
      "command": "npx",
      "args": ["--no-install", "@upstash/context7-mcp", "--stdio"]
    }
  }

it works but I got a different issue then:

When the MCP tool "get-library-docs" is used, it fails because the parameter is at 2000 tokens. But it says it has to be at 5000

Parameters:

{
  "context7CompatibleLibraryID": "/flutter/flutter",
  "topic": "create app",
  "tokens": 2000
}

Result:

{"error": "MCP error -32602: MCP error -32602: Invalid arguments for tool get-library-docs: [\n {\n \"code)": \"custom\", \n \"message)": \ "Must be a number >= 5000\", \n \"path\": [\n \"tokens\"\n ]\n 3\n]"}

When I tell the agent to use at least 5000 tokens it works.

@enesgules
Copy link
Collaborator

So the LLM doesn’t correct its error on its own here? Do you think we should completely remove the minimum limit? In our tests, we saw that without the limit, LLMs tend to use very small context windows and don’t really benefit from using Context7.

@0xSam404
Copy link

0xSam404 commented Apr 21, 2025

So the LLM doesn’t correct its error on its own here? Do you think we should completely remove the minimum limit? In our tests, we saw that without the limit, LLMs tend to use very small context windows and don’t really benefit from using Context7.

Unfortunately the agent/ LLM doesn't correct the token parameter (tried different models - all the same).

I got it working for me with this MCP config with Cursor 0.49.2 and macOS, so the used parameter always 5000 token, which is in my opionion definitely needed because like you already said the LLM doesn't benefit from such small context.

"context7": { "command": "npx", "args": [ "--no-install", "@upstash/context7-mcp", "--stdio" ], "toolParams": { "get-library-docs": { "tokens": { "defaultValue": 5000, "minimum": 5000 }

So it uses minimum 5000 tokens and it never gets down the 5000 token

@rafapradana
Copy link

This is a quick note for anyone encountering MCP issues on Windows.

This config didn't work for me:

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

It kept throwing an error when launching the MCP server. After some digging, I found that Windows doesn’t handle npx well unless it’s run through the command shell.

Switching to this fixed the problem:

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

So if you're on Windows and MCP isn't starting, try using cmd /c npx instead.
Hope this saves someone else the headache!

@thorizer
Copy link

thorizer commented Apr 21, 2025

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

not working either , bunx works though

@zullum
Copy link

zullum commented Apr 21, 2025

Not working for me as well. Client closed error on mac os with apple silicon
npx -v
9.6.7
node -v
18.17.1

@cheyanru
Copy link

For those encountering a similar installation issue, here's how I resolved it:

If you're seeing an error like this:

2025-04-19 10:50:12.837 [error] ext7: Client error for command A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:12.837 [error] ext7: Error in MCP: A system error occurred (spawn npx ENOENT)
2025-04-19 10:50:12.837 [error] ext7: Failed to reload client: A system error occurred (spawn npx ENOENT)

The error spawn npx ENOENT or spawn bunx ENOENT indicates that the npx or bunx commands are not recognized or installed. This issue typically results from your terminal PATH not correctly configured to locate these commands. Ensure npx or bunx is properly installed and added to your system's PATH.

In my case, I encountered a slightly different issue where the client repeatedly closed, shown by errors like:

2025-04-21 17:16:20.253 [error] ext7: Error in MCP: Client closed
2025-04-21 17:16:20.253 [error] ext7: Failed to reload client: MCP error -32000: Connection closed

I resolved this by modifying the MCP configuration to remove the @latest tag from the package name. After this adjustment, it worked without any issues:

Here's my updated MCP configuration:

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

I'm unsure why omitting @latest resolves this issue; perhaps someone with deeper knowledge can provide additional insights.

Image

@enesgules
Copy link
Collaborator

Could you please try this which is not ideal but might fix the issue: #47 (comment)

@enesgules enesgules added the mcp Related to mcp server label Apr 22, 2025
@iBuildiPawn
Copy link

For Cursor Windows users. Try this:

Build it in docker. Then use this in cursor mcp:

{
  "mcpServers": {
    "context7": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "context7-mcp"
      ]
    }
  }
}

Good luck..

@brainoir
Copy link
Contributor

brainoir commented Apr 22, 2025

Yes with docker works.

Here is instruction:

Building and Running Context7 MCP Docker Image and Configuration

This guide will walk you through the steps to build a Docker image for the context7-mcp, run it as a container, and configure it in your VSCode settings for Cline.

Prerequisites:

  • Docker installed on your system.
  • VSCode with the Cline extension installed.

Steps:

  1. Create the Dockerfile:
    Create a file named Dockerfile in a directory of your choice (e.g., context7-mcp-docker) with the following content:

    FROM node:18-alpine
    
    WORKDIR /app
    
    # Install dependencies
    RUN npm install -g @upstash/context7-mcp@latest
    
    # Run the server when the container starts
    CMD ["context7-mcp"]
  2. Build the Docker Image:
    Open your terminal or PowerShell, navigate to the directory where you saved the Dockerfile, and run the following command:

    docker build -t context7-mcp .

    This command builds the Docker image and tags it as context7-mcp. The . at the end indicates that the Dockerfile is in the current directory.

  3. Run the Docker Container:
    Once the image is built, you can run a container from it using the following command:

    docker run -i --rm context7-mcp
    • -i: Keeps the standard input open, allowing interaction.
    • --rm: Automatically removes the container when it exits.
    • context7-mcp: The name of the Docker image to run.

    Keep this terminal window open as the MCP server runs in the background.

  4. Configure Cline MCP Settings:
    Open your Cline MCP settings file (cline_mcp_settings.json). Based on the content you provided, ensure the mcpServers section includes the configuration for github.com/upstash/context7-mcp:

    {
      "mcpServers": {
        "github.com/upstash/context7-mcp": {
          "autoApprove": [],
          "disabled": false,
          "timeout": 60,
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "context7-mcp"
          ],
          "transportType": "stdio"
        }
      }
    }

    Make sure this entry exists in your mcpServers object. If it's missing, add it. Save the file.

After completing these steps, the context7-mcp Docker container will be running, and Cline will be configured to use it.

@enesgules
Copy link
Collaborator

So the LLM doesn’t correct its error on its own here? Do you think we should completely remove the minimum limit? In our tests, we saw that without the limit, LLMs tend to use very small context windows and don’t really benefit from using Context7.

Unfortunately the agent/ LLM doesn't correct the token parameter (tried different models - all the same).

I got it working for me with this MCP config with Cursor 0.49.2 and macOS, so the used parameter always 5000 token, which is in my opionion definitely needed because like you already said the LLM doesn't benefit from such small context.

"context7": { "command": "npx", "args": [ "--no-install", "@upstash/context7-mcp", "--stdio" ], "toolParams": { "get-library-docs": { "tokens": { "defaultValue": 5000, "minimum": 5000 }

So it uses minimum 5000 tokens and it never gets down the 5000 token

We have updated this in this PR: #69 Instead of returning an error we transform it to 5000 tokens.
It should be available in the next release and hopefully you won't need all these tool parameters in your config!

@enesgules
Copy link
Collaborator

Mcp server seems to work but the request seems to fail. You have a stable internet connection right. Could you try eith other libraries please? Which version of the mcp server are you using?

@restyler
Copy link

restyler commented May 1, 2025

For me, upgrading my global system level nodejs v18->v20, updating PATH var, AND cleaning npm cache finally helped to launch context7 MCP server (I run Cursor on Mac)

npm cache clean --force
rm -rf ~/.npm/_npx

Better Cursor MCP logs would definitely help debugging this..... they are seriously lacking info

@garysassano
Copy link

Out of curiosity, anyone who managed to get this to work uses WSL2?

@garysassano
Copy link

If you are using Cursor with WSL2, you need the following configuration in your mcp.json:

{
  "mcpServers": {
    "context7": {
      "command": "wsl",
      "args": [
        "bash",
        "-c",
        "'/home/user/.bun/bin/bunx -y @upstash/context7-mcp@latest'"
      ],
      "enabled": true
    }
  }
}

Replace /home/user/.bun/bin/bunx with the absolute path to your npx or bunx binary. You can find the absolute path by running which npx or which bunx.

@fisforfaheem
Copy link
Author

fisforfaheem commented May 5, 2025 via email

@djedlajn
Copy link

djedlajn commented May 5, 2025

Neither

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

Nor npx versions worked for me. I'm pretty sure it worked yesterday any clue whats up?

Spinning it in standalone mode works fine

Context7 Documentation MCP Server running on stdio

Getting regular errors like the others

2025-05-05 13:01:42.404 [info] ext7: Handling CreateClient action
2025-05-05 13:01:42.404 [info] ext7: Starting new stdio process with command: bunx -y @upstash/context7-mcp@latest
2025-05-05 13:01:42.414 [info] ext7: Handling CreateClient action
2025-05-05 13:01:42.414 [info] ext7: Starting new stdio process with command: bunx -y @upstash/context7-mcp@latest
2025-05-05 13:01:43.036 [info] ext7: Client closed for command
2025-05-05 13:01:43.036 [error] ext7: Error in MCP: Client closed
2025-05-05 13:01:43.036 [info] ext7: Client closed for command
2025-05-05 13:01:43.036 [error] ext7: Error in MCP: Client closed
2025-05-05 13:01:43.037 [info] ext7: Handling ListOfferings action
2025-05-05 13:01:43.037 [error] ext7: No server info found
2025-05-05 13:01:43.037 [info] ext7: Handling ListOfferings action
2025-05-05 13:01:43.037 [error] ext7: No server info found
2025-05-05 13:01:43.037 [info] ext7: Handling ListOfferings action
2025-05-05 13:01:43.037 [error] ext7: No server info found
2025-05-05 13:01:43.037 [info] ext7: Handling ListOfferings action
2025-05-05 13:01:43.037 [error] ext7: No server info found
2025-05-05 13:01:44.029 [info] ext7: Client closed for command
2025-05-05 13:01:44.029 [error] ext7: Error in MCP: Client closed
2025-05-05 13:01:44.030 [info] ext7: Client closed for command
2025-05-05 13:01:44.030 [error] ext7: Error in MCP: Client closed
2025-05-05 13:01:44.030 [info] ext7: Handling ListOfferings action
2025-05-05 13:01:44.030 [error] ext7: No server info found
2025-05-05 13:01:44.030 [info] ext7: Handling ListOfferings action
2025-05-05 13:01:44.030 [error] ext7: No server info found
2025-05-05 13:01:44.030 [info] ext7: Handling ListOfferings action
2025-05-05 13:01:44.030 [error] ext7: No server info found
2025-05-05 13:01:44.030 [info] ext7: Handling ListOfferings action
2025-05-05 13:01:44.030 [error] ext7: No server info found

@citizenll
Copy link
Contributor

Use cmd /c in Windows to solve this problem:

{
  "mcpServers": {
    "github.com/upstash/context7-mcp": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@upstash/context7-mcp@latest"
      ],
      "disabled": false,
      "autoApprove": []
    }
  }
}

@enesgules
Copy link
Collaborator

Hey @citizenll ff this windows config works fine would you mind creating a PR?

@enesgules
Copy link
Collaborator

Hey @djedlajn could you try smithery please?

@enesgules
Copy link
Collaborator

Hey @fisforfaheem have you tried using Smithery?

@xiaofei-guan
Copy link

I ran into the same issue, but I figured it out. Here's my scenario:
I'm on a Windows 11 machine with Cursor installed, and I connect to a remote server. First, I checked the Node.js version on remote the server, which met the requirements, but it didnt work. I suspected that when Cursor configures MCP, it doesn't rely on the remote server's Node environment. Instead, it probably uses the Node.js installed on my local machine where Cursor is running. So, I installed Node locally.js on my Windows 11 setup, and restarted Cursor, and everything worked fine.
Does it work for you?
@fisforfaheem @kamiljaneczek @rivenrowe @JvdsReform @R3verseIN @eylonshm @klppl

@eybarta
Copy link

eybarta commented May 6, 2025

I was able to resolve this (in cursor mac) using the version from docs instead of 'latest':

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

@enesgules
Copy link
Collaborator

1.0.7 is out @eybarta

@rocketmandrey
Copy link

I had the same issue with npx — the terminal said zsh: command not found: npx. This is also a common problem.
Solution:
The reason is that npx comes with Node.js and npm, so if you don’t have Node.js installed, npx won’t work either.
To fix this, I installed Node.js (which includes both npm and npx). The easiest way on macOS is to use Homebrew:

brew install node

Or you can download the installer from the official Node.js website:
https://nodejs.org/
After installing Node.js, both npm and npx commands started working for me. So, just make sure Node.js is installed, and you’ll have access to npx as well!

Also you can ask Cursor:
Can you please initialize context7 into my project?

It's going to do all the things above by itself.

@citizenll
Copy link
Contributor

Hey @citizenll ff this windows config works fine would you mind creating a PR?

@enesgules Here #166

@rainer37
Copy link

rainer37 commented May 9, 2025

use @upstash/context7-mcp@v1.0.8 with explicit version somehow solves the issue, but with @upstash/context7-mcp@latest would not work.

My node version is 22 btw

@944750720
Copy link

944750720 commented May 9, 2025

I use both of wsl2 and macos. Meanwhile, I use fnm for managing nodejs version. I met this problem on both systems. And I think I figure out the reason and solution. No matter you use cline or Cursor.
Connect MCP Servers error"spawn npx enoent" means mcp client can't correctly find npx command in your system. So if you're using fnm, don't use which npx to set npx path directly. This path is temporarily created by fnm so it'll outdate when restart device.
The right way is to find to your fnm directory by command which fnm. For example, mine is /Users/CHJ/.local/state/fnm_multishells/32996_1746258653075/bin/npx. Then access to /Users/CHJ/.local/share/fnm/node-version/<select a version you want to use>/installation/bin/, you should be able to see npx file. To my understanding, fnm create temporary folder based on these nodejs versions under /Users/CHJ/.local/share/fnm/.
Whatever, find the npx file that is constant and permanent. Then use this path alternate the npx in every mcp setting json.
For example, in wsl2 using context7 mcp server by Cursor:

{
  "mcpServers": {
    "context7": {
      "command": "wsl",
      "args": [
        "bash",
        "-c",
        "'/Users/CHJ/.local/share/fnm/node-versions/v22.15.0/installation/bin/npx -y @upstash/context7-mcp@latest'"
      ],
      "enabled": true
    }
  }
}

in macos using context7 mcp server by Cursor:

{
  "mcpServers": {
        "context7": {
            "command": "/Users/CHJ/.local/share/fnm/node-versions/v22.15.0/installation/bin/npx",
            "args": [
                "-y",
                "@upstash/context7-mcp@latest"
            ]
        }
  }
}

Hope it can help you.

@wdavids-myai
Copy link

wdavids-myai commented May 11, 2025

Had issues with @upstash/context7-mcp@latest using Curson on mac - which grabs the latest version. Having versioning working would be good.

What worked for me was the following
Image

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

@ertan2002
Copy link

ertan2002 commented May 12, 2025

this works in windows

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

and if you have a key from smithery.ai ( https://smithery.ai/server/@upstash/context7-mcp ) then you can also use this

{ "mcpServers": { "context7-mcp": { "command": "npx", "args": [ "-y", "@smithery/cli@latest", "run", "@upstash/context7-mcp", "--key", "YOUR_KEY" ] } } }

make sure you installed nodejs ( https://nodejs.org/en/download )
and then open command line and type npx to ensure if it works. If yes then you can use the json that I shared above

Image

Versions:
npx --version
10.9.2

node --version
v22.15.0

cursor: 0.49.6
vs code: 1.96.2

I hope it helps

@fisforfaheem
Copy link
Author

fisforfaheem commented May 12, 2025 via email

@enesgules
Copy link
Collaborator

@fisforfaheem have you tried without the @latest tag or with smithery?

@01RK
Copy link

01RK commented May 13, 2025

    "context7": {
        "command": "cmd",
        "args": [
            "/c",
            "npx",
            "-y",
            "@upstash/context7-mcp@1.0.8"
        ],
        "env": {
            "CONTEXT7_API_KEY": "your_context7_api_key"
        }
    },

This works for me. Windows

@Avi-E-Koenig
Copy link

workbench.desktop.main.js:2479 [Extension Host] Error: Start of the range is outside the file.
    at o (***\AppData\Local\Programs\cursor\resources\app\extensions\cursor-always-local\dist\main.js:4:221505)
    at t.changeModel (***\AppData\Local\Programs\cursor\resources\app\extensions\cursor-always-local\dist\main.js:4:222689)
    at t.formatDiffHistory (***\AppData\Local\Programs\cursor\resources\app\extensions\cursor-always-local\dist\main.js:4:257286)
    at async Promise.allSettled (index 0)
    at aZt.$getEverythingAllLocalProviderRunCommand (file:///***/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:158:1083376)
    "context7": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@upstash/context7-mcp@1.0.8"
      ]
    }

tried every suggestion above...

@enesgules
Copy link
Collaborator

Hey @Avi-E-Koenig what is your node version?

@Avi-E-Koenig
Copy link

Hey @Avi-E-Koenig what is your node version?

23.10

@enesgules
Copy link
Collaborator

Could you make sure you are using this node? You could try adding the entire path to your config.

@enesgules
Copy link
Collaborator

Also please try smithery or bun

@Avi-E-Koenig
Copy link

ok upon further troubleshoot this was a PATH issue with npx I manily work with gitbash but cursor and those setups were pointing to use of windows cmd
having set node and related env vars to PATH got the mcp to run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mcp Related to mcp server
Projects
None yet
Development

No branches or pull requests