Fix: Use absolute path to uv executable when installing MCP server (closes #478) #481
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix Claude Desktop MCP server startup failures by using absolute path to uv executable
Motivation and Context
This change fixes issue #478 where MCP servers fail to start in Claude Desktop with "spawn uv ENOENT" errors. The problem occurs because the MCP SDK hardcodes "uv" as the command without using the full path, and Claude Desktop can't find the executable in its PATH when launched.
How Has This Been Tested?
Tested by installing an MCP server with the modified code and verifying that Claude Desktop can start it without ENOENT errors. Also verified that it falls back gracefully when the uv path can't be determined.
Breaking Changes
None. This is a strictly internal improvement that requires no changes from users.
Types of changes
Checklist
Additional context
The change adds a
find_uv_path()
utility function that tries to locate the full path to the uv executable using platform-appropriate commands (which
on Unix-like systems,where
on Windows). If the path is found, it's used in the command configuration; otherwise, it falls back to the current behavior.