Skip to content

fix: module not found#26

Closed
robinroy03 wants to merge 3 commits intomodelcontextprotocol:mainfrom
robinroy03:main
Closed

fix: module not found#26
robinroy03 wants to merge 3 commits intomodelcontextprotocol:mainfrom
robinroy03:main

Conversation

@robinroy03
Copy link
Copy Markdown

Motivation and Context

Solved #25. Earlier when the user did a command like uv run client.py "C:\Users\Robin Roy\Desktop\quickstart-resources\weather-server-python\weather.py" it'll throw ModuleNotFoundError because the spawned process was unable to use the .venv libs. I modified uv to use the libs.

How Has This Been Tested?

I tested it locally for the problems #23 and #24.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally (no tests)
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@robinroy03 robinroy03 mentioned this pull request Apr 29, 2025
@a-akimov
Copy link
Copy Markdown
Contributor

@robinroy03 Thank you for your contribution! I see that currently this PR has changes that are related to the proposed "module not found" fix, as well as general formatting changes across the python client file. To make it easier for reviewers to review and accept your changes, and also for the history, could you please split this PR into 2: one with a fix, and another one with formatting changes?

Comment thread mcp-client-python/client.py Outdated
Comment thread mcp-client-python/client.py Outdated
@robinroy03 robinroy03 requested a review from dsp-ant September 30, 2025 14:13
path = Path(server_script_path).resolve()
server_params = StdioServerParameters(
command="uv",
args=["--directory", path.parent, "run", path.name],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robinroy03 currently this example fails because path.parent should be a string. Suggest changing to:

args=["--directory", str(path.parent), "run", path.name],

@a-akimov
Copy link
Copy Markdown
Contributor

@robinroy03 This PR cannot be merged because the code fails as path.parent is not a string. Please fix this, and resolve the conflicts so that it can be merged.

@robinroy03
Copy link
Copy Markdown
Author

@a-akimov I'm not working on this anymore. You could either close it or write code on top of it.

@a-akimov a-akimov mentioned this pull request Nov 16, 2025
9 tasks
@jonathanhefner
Copy link
Copy Markdown
Member

Closing in favor of #75.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants