context7 icon indicating copy to clipboard operation
context7 copied to clipboard

getting error

Open fisforfaheem opened this issue 1 year ago • 81 comments

Image

fisforfaheem avatar Apr 18 '25 14:04 fisforfaheem

+1 have the same issue

kamiljaneczek avatar Apr 18 '25 15:04 kamiljaneczek

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

rickiicat avatar Apr 18 '25 18:04 rickiicat

+1, I have the same error.

JvdsReform avatar Apr 18 '25 21:04 JvdsReform

I have the same error.

R3verseIN avatar Apr 19 '25 03:04 R3verseIN

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

klppl avatar Apr 19 '25 08:04 klppl

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 avatar Apr 19 '25 11:04 enesgules

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"
      ]
    }
  }
}

enesgules avatar Apr 19 '25 11:04 enesgules

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

klppl avatar Apr 19 '25 12:04 klppl

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

eylonshm avatar Apr 19 '25 12:04 eylonshm

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.

enesgules avatar Apr 19 '25 12:04 enesgules

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 avatar Apr 19 '25 13:04 klppl

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

klppl avatar Apr 19 '25 18:04 klppl

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

R3verseIN avatar Apr 19 '25 18:04 R3verseIN

For Windows user:

Create npm folder in this path:

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

dunfe avatar Apr 20 '25 02:04 dunfe

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>

R3verseIN avatar Apr 20 '25 03:04 R3verseIN

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.

enesgules avatar Apr 20 '25 08:04 enesgules

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

JvdsReform avatar Apr 20 '25 20:04 JvdsReform

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.

0xSam404 avatar Apr 20 '25 23:04 0xSam404

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.

enesgules avatar Apr 20 '25 23:04 enesgules

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

0xSam404 avatar Apr 21 '25 00:04 0xSam404