
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
A Model Context Protocol (MCP) server that provides an interface for AI models to interact with MySQL databases through natural language queries.
This package creates an MCP server that connects to a MySQL database and exposes a tool to execute SQL queries. It allows AI models like Claude to interact with your MySQL database without direct database access.
You can install the MCP MySQL server using pip:
pip install mcp_mysql_connect
Or using UV:
uv pip install mcp_mysql_connect
The server requires the following environment variables:
DB_HOST
- MySQL server hostDB_USER
- MySQL usernameDB_PASSWORD
- MySQL passwordDB_NAME
- MySQL database nameYou can set these using a .env
file or directly in your environment.
Add the following to your ~/.cursor/mcp.json
configuration:
"mysql-mcp-server": {
"command": "uvx",
"args": [
"--from",
"mcp_mysql_connect",
"mcp_mysql_connect"
],
"env": {
"DB_HOST": "your-mysql-host",
"DB_USER": "your-username",
"DB_PASSWORD": "your-password",
"DB_NAME": "your-database"
}
}
Alternative configuration:
"mysql-mcp-server": {
"command": "uv",
"args": [
"run",
"--with",
"mcp_mysql_connect",
"-m",
"mcp_mysql_connect"
],
"env": {
"DB_HOST": "your-mysql-host",
"DB_USER": "your-username",
"DB_PASSWORD": "your-password",
"DB_NAME": "your-database"
}
}
from mcp.client import Client
from mcp.tools import Tools
# Connect to the MySQL MCP server
tools = Tools()
tools.add_server("mysql", "mcp_mysql_connect")
# Create a client with the tools
client = Client(tools=tools)
# Example query
response = client.complete(
messages=[
{"role": "user", "content": "Query all users from the database"}
]
)
print(response.content)
Start the server manually:
# Set environment variables first
export DB_HOST=your-mysql-host
export DB_USER=your-username
export DB_PASSWORD=your-password
export DB_NAME=your-database
# Then run the server
python -m mcp_mysql_connect
The server provides a SQL execution tool that can be used to query your MySQL database:
read_query(query: str, params: List[str] = None)
- Execute a SQL SELECT query against the databaseWhen using with Claude or other AI models, you can ask natural language questions like:
The AI model will translate these into SQL queries and use the MCP server to execute them.
MIT License
Contributions welcome! Please feel free to submit a Pull Request.
FAQs
MCP Server to connect the MySQL database
We found that mcp-mysql-connect demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.