René's URL Explorer Experiment


Title: Fix ENOENT error when installing MCP server with `mcp install server.py` · Issue #478 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Fix ENOENT error when installing MCP server with `mcp install server.py` · Issue #478 · modelcontextprotocol/python-sdk

X Title: Fix ENOENT error when installing MCP server with `mcp install server.py` · Issue #478 · modelcontextprotocol/python-sdk

Description: Describe the bug When using mcp install server.py to install a Model Context Protocol server in Claude Desktop, the installation appears successful but fails at runtime with "spawn uv ENOENT" errors. This happens because the MCP SDK hard...

Open Graph Description: Describe the bug When using mcp install server.py to install a Model Context Protocol server in Claude Desktop, the installation appears successful but fails at runtime with "spawn uv ENOENT" error...

X Description: Describe the bug When using mcp install server.py to install a Model Context Protocol server in Claude Desktop, the installation appears successful but fails at runtime with "spawn uv ENOENT&q...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/478

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fix ENOENT error when installing MCP server with `mcp install server.py`","articleBody":"**Describe the bug**\nWhen using `mcp install server.py` to install a Model Context Protocol server in Claude Desktop, the installation appears successful but fails at runtime with \"spawn uv ENOENT\" errors. This happens because the MCP SDK hardcodes \"uv\" as the command without using the full path, and Claude Desktop can't find the executable when launched.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Install the [MCP demo server](https://github.com/modelcontextprotocol/python-sdk?tab=readme-ov-file#quickstart) with `uv run mcp install server.py`: \n```zsh\n➜  mcp-server-demo git:(main) ✗ uv run mcp install server.py\n[04/10/25 17:07:31] INFO     Added server 'Demo' to Claude config                                  claude.py:129\n                    INFO     Successfully installed Demo in Claude app                                cli.py:467\n➜  mcp-server-demo git:(main) ✗\n```\n2. Open Claude Desktop\n3. Observe three error notifications pop up:    \n   - \"MCP Demo: spawn uv ENOENT 2\"\n   - \"Could not connect to MCP server Demo\"\n   - \"MCP Demo: Server disconnected. For troubleshooting guidance, please visit our debugging documentation\"\n\n**Expected behavior**\nThe MCP server should start properly when Claude Desktop launches, without any ENOENT errors. The SDK should use the full path to the `uv` executable rather than assuming it's in the PATH.\n\n**Screenshots**\nN/A\n\n**Desktop (please complete the following information):**\n- OS: macOS Sonoma 14.5\n- Claude Desktop: 0.9.2\n- modelcontextprotocol/python-sdk: 1.6.0\n\n**Smartphone (please complete the following information):**\nN/A\n\n**Additional context**\n\n**Log Output**\n\nThe following is present in `mcp-server-Demo.log`:\n```\n\u003csnip-server-pre-initialization-logs>\n2025-04-10T14:46:54.177Z [Demo] [info] Initializing server...\n2025-04-10T14:46:54.204Z [Demo] [error] spawn uv ENOENT {\"context\":\"connection\",\"stack\":\"Error: spawn uv ENOENT\\n    at ChildProcess._handle.onexit (node:internal/child_process:285:19)\\n    at onErrorNT (node:internal/child_process:483:16)\\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\"}\n2025-04-10T14:46:54.204Z [Demo] [error] spawn uv ENOENT {\"stack\":\"Error: spawn uv ENOENT\\n    at ChildProcess._handle.onexit (node:internal/child_process:285:19)\\n    at onErrorNT (node:internal/child_process:483:16)\\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\"}\n\u003csnip-server-disconnect-logs>\n```\n\n**Root Cause Analysis**\n\nThe `mcp install server.py` command configures the `Demo` server's `command` in `claude_desktop_config.json` to be \"uv\":\n```json\n \"Demo\": {\n      \"command\": \"uv\",\n      \"args\": [\n        \"run\",\n        \"--with\",\n        \"mcp[cli]\",\n        \"mcp\",\n        \"run\",\n        \"\u003cfull-path-to-server-py-file>\"\n      ]\n    }\n```\n\nSpawn emits the ENOENT error because 'uv' doesn't exist in the directories defined in PATH when Claude Desktop runs.\n\nThe Model Context Protocol [server quickstart docs](https://modelcontextprotocol.io/quickstart/server) warn about this: \"You may need to put the full path to the `uv` executable in the `command` field. You can get this by running `which uv` on MacOS/Linux or `where uv` on Windows.\"\n\n**Verification**\nChanging the `command` from \"uv\" to the full path to the uv executable fixes the errors:\n```json\n \"Demo\": {\n      \"command\": \"\u003cfull-path-to-uv-executable>\",\n      \"args\": [\n        \"run\",\n        \"--with\",\n        \"mcp[cli]\",\n        \"mcp\",\n        \"run\",\n        \"\u003cfull-path-to-server-py-file>\"\n      ]\n    }\n```\n\n**Code Issue**\nCurrently, \"command\" is hardcoded to be \"uv\": https://github.com/modelcontextprotocol/python-sdk/blob/c4beb3e8eff4869b4eb063d3a5f257bdf67dd62f/src/mcp/cli/claude.py#L120 \n\n**Proposed Solution**\nCreate a function that returns the full path to the uv executable:\n```python\nimport os\nimport subprocess\nimport platform\n\ndef find_uv_path() -> str | None:\n    \"\"\"Find the full path to the 'uv' executable across platforms\"\"\"\n    \n    system = platform.system()\n    \n    if system == \"Windows\":\n        try:\n            result = subprocess.run([\"where\", \"uv\"], capture_output=True, text=True, check=True)\n            paths = result.stdout.strip().split('\\n')\n            return paths[0] if paths else None\n        except subprocess.CalledProcessError:\n            return None\n    else:\n        try:\n            result = subprocess.run([\"which\", \"uv\"], capture_output=True, text=True, check=True)\n            return result.stdout.strip()\n        except subprocess.CalledProcessError:\n            return None\n```\n\nWhich could then be used in `src/mcp/cli/claude.py` like so:\n```python\ndef update_claude_config(\u003csnip>) -> bool:\n    \u003csnip>\n    \n    uv_path = find_uv_path()\n    if uv_path:\n        server_config: dict[str, Any] = {\"command\": uv_path, \"args\": args}\n    else: \n        server_config: dict[str, Any] = {\"command\": \"uv\", \"args\": args}\n        \n    \u003csnip>\n```","author":{"url":"https://github.com/rossheat","@type":"Person","name":"rossheat"},"datePublished":"2025-04-10T16:14:28Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/478"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ce57810a-86da-7cab-f8c8-bf9f8633d731
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8286:21AC3F:E98E0:13252D:6B00BA49
html-safe-nonce2523781ff51515fa5014b74b3bc73e9c3892a611976e69ad109ee8f36f8a74da
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Mjg2OjIxQUMzRjpFOThFMDoxMzI1MkQ6NkIwMEJBNDkiLCJ2aXNpdG9yX2lkIjoiODM2OTE1MTU4MDkwMDk5NzcwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac15a9e07b98a689b9d0b9cfcefc305647306ac537e56f4b5f13c16665e1f1ae08
hovercard-subject-tagissue:2986198213
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/478/issue_layout
twitter:imagehttps://opengraph.githubassets.com/63f6dc727f24efdecbbc6cfabb23bf0ccb76dbea366b6fe4ae048af91e1cbee6/modelcontextprotocol/python-sdk/issues/478
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/63f6dc727f24efdecbbc6cfabb23bf0ccb76dbea366b6fe4ae048af91e1cbee6/modelcontextprotocol/python-sdk/issues/478
og:image:altDescribe the bug When using mcp install server.py to install a Model Context Protocol server in Claude Desktop, the installation appears successful but fails at runtime with "spawn uv ENOENT" error...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerossheat
hostnamegithub.com
expected-hostnamegithub.com
None1d07c25977adfc5ff6acb0a962a9bc168c07afbda6fef765f9761c350c2ae4a2
turbo-cache-controlno-preview
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5429cbfc6aca8c7b9a086a3c8f47400346f38cc9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/478#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F478
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F478
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/478
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/478
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/478
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues308 (308)https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests112 (112)https://github.com/modelcontextprotocol/python-sdk/pulls
Actionshttps://github.com/modelcontextprotocol/python-sdk/actions
Projectshttps://github.com/modelcontextprotocol/python-sdk/projects
Security and quality12 (12)https://github.com/modelcontextprotocol/python-sdk/security
Insightshttps://github.com/modelcontextprotocol/python-sdk/insights
https://github.com/modelcontextprotocol/python-sdk
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/478
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/478
Fix ENOENT error when installing MCP server with mcp install server.pyhttps://github.com/modelcontextprotocol/python-sdk/issues/478#top
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
needs confirmationNeeds confirmation that the PR is actually required or needed.https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22needs%20confirmation%22
https://github.com/rossheat
rossheathttps://github.com/rossheat
on Apr 10, 2025https://github.com/modelcontextprotocol/python-sdk/issues/478#issue-2986198213
MCP demo serverhttps://github.com/modelcontextprotocol/python-sdk?tab=readme-ov-file#quickstart
server quickstart docshttps://modelcontextprotocol.io/quickstart/server
python-sdk/src/mcp/cli/claude.pyhttps://github.com/modelcontextprotocol/python-sdk/blob/c4beb3e8eff4869b4eb063d3a5f257bdf67dd62f/src/mcp/cli/claude.py#L120
c4beb3ehttps://github.com/modelcontextprotocol/python-sdk/commit/c4beb3e8eff4869b4eb063d3a5f257bdf67dd62f
felixweinbergerhttps://github.com/felixweinberger
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
needs confirmationNeeds confirmation that the PR is actually required or needed.https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22needs%20confirmation%22
on Oct 6, 2025https://github.com/modelcontextprotocol/python-sdk/issues/478#event-20122102659
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
on Oct 6, 2025https://github.com/modelcontextprotocol/python-sdk/issues/478#issuecomment-3373051449
@rossheathttps://github.com/rossheat
rossheathttps://github.com/rossheat
completedhttps://github.com/modelcontextprotocol/python-sdk/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 9, 2025https://github.com/modelcontextprotocol/python-sdk/issues/478#event-20187821472
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/478
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/478
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
needs confirmationNeeds confirmation that the PR is actually required or needed.https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22needs%20confirmation%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.