Skip to content
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

fix: handle python -m mysql_mcp_server #19

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wut0n9
Copy link

@wut0n9 wut0n9 commented Mar 27, 2025

添加支持python命令运行服务。
{
"mcpServers": {
"mysql": {
"command": "python",
"args": [
"-m",
"mysql_mcp_server"
],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "your_username",
"MYSQL_PASSWORD": "your_password",
"MYSQL_DATABASE": "your_database"
}
}
}
}

wut0n9 added 2 commits March 27, 2025 18:05
使用 python -m mysql_mcp_server命令,需创建__main__.py文件。
@designcomputer
Copy link
Owner

As I understand them, Model Context Protocol (MCP) implementations do not typically expose interfaces for standalone use. MCP is designed as a communication protocol between AI applications (hosts/clients) and external data sources or tools (servers), rather than as a standalone system. Can you explain the use case for running the mysql_mcp_server from the command line with Python?

@wut0n9
Copy link
Author

wut0n9 commented Mar 28, 2025

hi, In the MCP server example repository at https://github.com/modelcontextprotocol/servers, some servers are started using the Python command. I think both the Python command and uv/uvx can be used to start services. eg. https://github.com/modelcontextprotocol/servers/blob/main/src/fetch/README.md

@designcomputer
Copy link
Owner

@wut0n9 It looks like mcp_server_fetch may be designed to take command line arguments as a stand alone tool, "After installation, you can run it as a script using:". mysql_mcp_serve is not designed to be run that way. You can use the MCP inspector to debug it.

@designcomputer
Copy link
Owner

designcomputer commented Mar 29, 2025

@wut0n9 I've update the readme

Debugging with MCP Inspector

While MySQL MCP Server isn't intended to be run standalone or directly from the command line with Python, you can use the MCP Inspector to debug it.

The MCP Inspector provides a convenient way to test and debug your MCP implementation:

Install dependencies

pip install -r requirements.txt

Use the MCP Inspector for debugging (do not run directly with Python)

The MySQL MCP Server is designed to be integrated with AI applications like Claude Desktop and should not be run directly as a standalone Python program.

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