Skip to content

Fix python -m command error #387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 31, 2025

Conversation

xuzexin-hz
Copy link
Contributor

Both modules should change "from server import main" to "from .server import main", otherwise it will prompt that the file cannot be found.

Motivation and Context

Fixed the issue of errors when executing the commands python -m mcp_simple_resource and python -m mcp_simple_tool.

Mainly used in vscode's continue plugin and python code.

I am an AI product developer. When mcp appeared, I started to pay attention to mcp Resources, mcp Tools, and mcp Prompts. Whenever I use python-sdk to demonstrate the three functions of mcp to my friends, the python -m mcp_simple_resource and python -m mcp_simple_tool functions always fail, so I have to modify the local code and then execute it. Whenever the python-sdk project updates its version, I need to update the local code first. So I filed an RP to permanently solve this error.

How Has This Been Tested?

Go to the corresponding directory and execute
python -m mcp_simple_resource
and
python -m mcp_simple_tool

@Kludex Kludex enabled auto-merge (squash) March 31, 2025 07:31
@Kludex
Copy link
Member

Kludex commented Mar 31, 2025

Thanks!

@Kludex Kludex merged commit 321498a into modelcontextprotocol:main Mar 31, 2025
6 checks passed
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.

2 participants