Data as of
MySQL MCP Server for Cursor: Setup & Config
Cursor: Expose MySQL schema inspection, data samples, and SQL execution to MCP assistants.
What you can do with MySQL in Cursor
Choose it for focused MySQL exploration with schemas, bounded samples, and explicit SQL access.
- Query multiple databases using qualified table names.
- Reach a MySQL instance through a configured SSH tunnel.
Before you start: MySQL in Cursor
- uv for the documented uvx launch
- An accessible MySQL instance
- MySQL credentials with the required permissions
- An MCP-compatible client
This is the README's VS Code stdio launch. Put database values in the client's env block rather than assuming the project's .env will be discovered. Network SSE deployments require an authentication proxy outside localhost.
MySQL Cursor configuration
Choose Cursor configuration scope
For MySQL MCP Server, open Project: .cursor/mcp.json User: ~/.cursor/mcp.json. Merge into mcpServers at project or user scope.
Add MySQL MCP Server to Cursor
Use the mysql_mcp_server entry below in mcpServers. Keep MySQL MCP Server's documented stdio connection fields and your other Cursor entries.
Check MySQL MCP Server in Cursor
MySQL MCP Server: Enable in Cursor’s MCP settings; inspect tools.
Config file · Project: .cursor/mcp.json
User: ~/.cursor/mcp.json
{
"mcpServers": {
"mysql_mcp_server": {
"command": "uvx",
"args": [
"--from",
"mysql-mcp-server",
"mysql_mcp_server"
],
"env": {
"MYSQL_HOST": "<MySQL hostname>",
"MYSQL_PORT": "<MySQL port, default 3306>",
"MYSQL_USER": "<dedicated least-privilege MySQL username>",
"MYSQL_PASSWORD": "<MySQL account password>",
"MYSQL_DATABASE": "<optional default database; omit for multi-database mode>"
}
}
}
}MySQL tools available to Cursor
MySQL's stored tool list documents 3 tools; compare it with Cursor's connected tool list, because the stored list is not a live check.
- execute_sql
Find execute_sql under MySQL in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Run one SQL statement, including reads and permitted data-modification operations.
- get_schema_info
Find get_schema_info under MySQL in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- get_table_sample
Find get_table_sample under MySQL in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Read a table sample capped at 20 rows, including cross-database targets.
Troubleshooting MySQL in Cursor
- Cursor must find uvx --from (from uv, for Python tools) for MySQL MCP Server. Enable the project/user entry in MCP settings and inspect its tools.
- Review MYSQL_DATABASE, MYSQL_HOST, MYSQL_PASSWORD, MYSQL_PORT, MYSQL_USER for MySQL MCP Server before sharing project .cursor/mcp.json; project scope travels with the repository.
- MySQL MCP Server uses stdio here: Cursor must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
- Known limitation: SQL execution includes writes when database permissions allow them.
- Known limitation: Only single-statement SQL calls are supported.
- Known limitation: SSE mode needs external authentication when exposed beyond localhost.
- General Cursor troubleshooting lives in the /clients/cursor guide.
MySQL MCP Server — details. Cursor guide