vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Bug: command in .vscode/mcp.json should executed inside the workspace

Open tidefield opened this issue 7 months ago • 3 comments

Does this issue occur when all extensions are disabled?: No

  • VS Code Version: Version: 1.99.3 (Universal)
  • OS Version: macOS 15.4.1 (24E263)

Steps to Reproduce:

  1. Follow https://eslint.org/docs/latest/use/mcp#set-up-eslint-mcp-server-in-vs-code to add .cursor/mcp.json for Eslint MCP server
  2. Start the server
  3. If you have two versions of eslint: one defined inside the workspace's package.json and one defined globally, the global eslint will be used. This is because the command is executed from the root directory, not the workspace directly.

I believe the command should only be executed from root directory if the server is defined in settings.json. Commands in .cursor/mcp.json should be executed with respect to where they are defined.

If someone can confirm this is really a bug, I can contribute a fix.

tidefield avatar May 06 '25 09:05 tidefield

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.99.3. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

There should be a missing cwd field to configure the execution directory https://code.visualstudio.com/docs/reference/variables-reference#_environment-variables However, the mcp configuration doesn't seem to be supported at the moment

lvzhenbo avatar May 07 '25 05:05 lvzhenbo

This is a really strange omission, if you are developing an MCP service locally it's almost impossible to test without the means to set some working directory

benc-uk avatar May 23 '25 13:05 benc-uk

Added this last week

connor4312 avatar May 27 '25 17:05 connor4312