mysql_mcp_server icon indicating copy to clipboard operation
mysql_mcp_server copied to clipboard

D:\soft\python\python.exe: No module named mysql_mcp_server.__main__; 'mysql_mcp_server' is a package and cannot be directly executed

Open qinglikong opened this issue 9 months ago • 6 comments

when i run "python -m mysql_mcp_server" ,error accur

qinglikong avatar Mar 10 '25 02:03 qinglikong

直接mysql_mcp_server, 不行的话添加环境变量

linhong1994 avatar Mar 19 '25 19:03 linhong1994

@qinglikong Have you tried configuring and running the mysql_mcp_server via Claude Desktop?

designcomputer avatar Mar 22 '25 20:03 designcomputer

I'm facing the exact same issue, I'm trying to run it from docker, just edited dockerfile with env vars, build image, and then run, but it dies immediately

Image

sal0m0n avatar Mar 23 '25 01:03 sal0m0n

@qinglikong Have you tried configuring and running the mysql_mcp_server via Claude Desktop?

fine , running the mysql_mcp_server via Claude Desktop is OK ,thanks

qinglikong avatar Apr 09 '25 01:04 qinglikong

mysql_mcp_server does not support python -m because it does not comply with the -m code specification. You can uvx mysql_mcp_server or uv --directory {path}\src run mysql_mcp_server

xuzexin-hz avatar Apr 09 '25 07:04 xuzexin-hz

After careful consideration, I've decided not to add a main.py file at this time.

While I appreciate the flexibility this would add for running the server via python -m mysql_mcp_server, the mysql_mcp_server is specifically designed to be integrated with AI applications rather than run as a standalone tool. Using uv as the execution method is the recommended approach for MCP servers in our ecosystem, as it provides better dependency management and consistent behavior with how the server is intended to be used in production.

Adding a main.py entry point could give users the impression that the server is meant to be run standalone, which might lead to confusion about its intended use.

I've updated the README to clarify that this server should be run via uv and to use the MCP Inspector for debugging purposes. Thank you again for your contribution and understanding.

designcomputer avatar Apr 11 '25 14:04 designcomputer