Skip to content

Use shell to launch MCP and ACP servers#42382

Merged
reflectronic merged 5 commits intozed-industries:mainfrom
reflectronic:shell-launch-servers
Dec 10, 2025
Merged

Use shell to launch MCP and ACP servers#42382
reflectronic merged 5 commits intozed-industries:mainfrom
reflectronic:shell-launch-servers

Conversation

@reflectronic
Copy link
Member

@reflectronic reflectronic commented Nov 10, 2025

npx, and any npm install-ed programs, exist as batch scripts/PowerShell scripts on the PATH. We have to use a shell to launch these programs.

Fixes #41435
Closes #42651

Release Notes:

  • windows: Custom MCP and ACP servers installed through npm now launch correctly.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 10, 2025
@Veykril Veykril force-pushed the shell-launch-servers branch 2 times, most recently from 0f4c5fc to 2be1277 Compare November 11, 2025 15:19
@reflectronic reflectronic force-pushed the shell-launch-servers branch 2 times, most recently from 94fbf8d to 6a571de Compare November 21, 2025 18:19
reflectronic and others added 4 commits December 3, 2025 21:40
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
Co-authored-by: Julia Ryan <juliaryan3.14@gmail.com>
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
@reflectronic reflectronic merged commit d832012 into zed-industries:main Dec 10, 2025
24 checks passed
@stippi
Copy link
Contributor

stippi commented Dec 11, 2025

There is also #42646. Should this also be closed, or does the fix not address this?

@Veykril
Copy link
Member

Veykril commented Dec 11, 2025

Yes I think it should, thanks for crosslinking!

Veykril added a commit that referenced this pull request Dec 12, 2025
Follow up to #42382

Release Notes:

- N/A *or* Added/Fixed/Improved ...
nrbnlulu pushed a commit to nrbnlulu/zed that referenced this pull request Dec 14, 2025
`npx`, and any `npm install`-ed programs, exist as batch
scripts/PowerShell scripts on the PATH. We have to use a shell to launch
these programs.

Fixes zed-industries#41435
Closes zed-industries#42651


Release Notes:

- windows: Custom MCP and ACP servers installed through `npm` now launch
correctly.

---------

Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
nrbnlulu pushed a commit to nrbnlulu/zed that referenced this pull request Dec 14, 2025
Follow up to zed-industries#42382

Release Notes:

- N/A *or* Added/Fixed/Improved ...
CherryWorm pushed a commit to CherryWorm/zed that referenced this pull request Dec 16, 2025
`npx`, and any `npm install`-ed programs, exist as batch
scripts/PowerShell scripts on the PATH. We have to use a shell to launch
these programs.

Fixes zed-industries#41435
Closes zed-industries#42651


Release Notes:

- windows: Custom MCP and ACP servers installed through `npm` now launch
correctly.

---------

Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
CherryWorm pushed a commit to CherryWorm/zed that referenced this pull request Dec 16, 2025
Follow up to zed-industries#42382

Release Notes:

- N/A *or* Added/Fixed/Improved ...
someone13574 pushed a commit to someone13574/zed that referenced this pull request Dec 16, 2025
`npx`, and any `npm install`-ed programs, exist as batch
scripts/PowerShell scripts on the PATH. We have to use a shell to launch
these programs.

Fixes zed-industries#41435
Closes zed-industries#42651


Release Notes:

- windows: Custom MCP and ACP servers installed through `npm` now launch
correctly.

---------

Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
someone13574 pushed a commit to someone13574/zed that referenced this pull request Dec 16, 2025
Follow up to zed-industries#42382

Release Notes:

- N/A *or* Added/Fixed/Improved ...
Veykril pushed a commit that referenced this pull request Jan 26, 2026
Closes #47303 

The command quoting for `cmd` shell was first introduced (at least in
this case) in PR #41216 three months ago:

https://github.com/zed-industries/zed/blob/3d4582d4dc9145270650e12f9ce5a534b888f4a2/crates/project/src/terminals.rs#L202-L210

And a month ago, PR #42382 added command quoting for `cmd` in a
different place:

https://github.com/zed-industries/zed/blob/3d4582d4dc9145270650e12f9ce5a534b888f4a2/crates/util/src/shell.rs#L413-L434

As a result, the command is now quoted twice when using `cmd`. `cmd`
interprets the entire double-quoted string (e.g., ""command & args"") as
a single (invalid) executable name, and this would lead to an error like
“The system cannot find the path specified” in #47303 .

The solution is to remove the redundant manual quoting in `terminals.rs`
and rely on the centralized logic in `util/src/shell.rs`.

/cc @Veykril @reflectronic 

Release Notes:

- Fixed a bug where terminal tasks failed to start on Windows when using
`cmd.exe`.
github-actions bot pushed a commit that referenced this pull request Jan 26, 2026
Closes #47303 

The command quoting for `cmd` shell was first introduced (at least in
this case) in PR #41216 three months ago:

https://github.com/zed-industries/zed/blob/3d4582d4dc9145270650e12f9ce5a534b888f4a2/crates/project/src/terminals.rs#L202-L210

And a month ago, PR #42382 added command quoting for `cmd` in a
different place:

https://github.com/zed-industries/zed/blob/3d4582d4dc9145270650e12f9ce5a534b888f4a2/crates/util/src/shell.rs#L413-L434

As a result, the command is now quoted twice when using `cmd`. `cmd`
interprets the entire double-quoted string (e.g., ""command & args"") as
a single (invalid) executable name, and this would lead to an error like
“The system cannot find the path specified” in #47303 .

The solution is to remove the redundant manual quoting in `terminals.rs`
and rely on the centralized logic in `util/src/shell.rs`.

/cc @Veykril @reflectronic 

Release Notes:

- Fixed a bug where terminal tasks failed to start on Windows when using
`cmd.exe`.
zed-zippy bot added a commit that referenced this pull request Jan 26, 2026
…(cherry-pick to preview) (#47627)

Cherry-pick of #47534 to preview

----
Closes #47303 

The command quoting for `cmd` shell was first introduced (at least in
this case) in PR #41216 three months ago:


https://github.com/zed-industries/zed/blob/3d4582d4dc9145270650e12f9ce5a534b888f4a2/crates/project/src/terminals.rs#L202-L210

And a month ago, PR #42382 added command quoting for `cmd` in a
different place:


https://github.com/zed-industries/zed/blob/3d4582d4dc9145270650e12f9ce5a534b888f4a2/crates/util/src/shell.rs#L413-L434

As a result, the command is now quoted twice when using `cmd`. `cmd`
interprets the entire double-quoted string (e.g., ""command & args"") as
a single (invalid) executable name, and this would lead to an error like
“The system cannot find the path specified” in #47303 .

The solution is to remove the redundant manual quoting in `terminals.rs`
and rely on the centralized logic in `util/src/shell.rs`.

/cc @Veykril @reflectronic 

Release Notes:

- Fixed a bug where terminal tasks failed to start on Windows when using
`cmd.exe`.

Co-authored-by: Xin Zhao <zx0@mail.ustc.edu.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: Cannot launch NPX MCP servers on Windows

3 participants