TQ
MySQL MCP Server
A Model Context Protocol (MCP) server for interacting with MySQL databases in Cursor IDE.
Features
- Execute SQL queries (read-only by default).
- Inspect database schemas.
- Configurable write permissions.
Installation
npm install
Configuration
Create .env with:
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=your_username
MYSQL_PASS=your_password
MYSQL_DB=your_database
ALLOW_INSERT_OPERATION=false
ALLOW_UPDATE_OPERATION=false
ALLOW_DELETE_OPERATION=false
Usage in Cursor
Add to .cursor/mcp.json
{
"mcpServers": {
"mysqlMcpServer": {
"command": "npx",
"args": ["ts-node", "path/to/src/index.ts"],
"env": {
"MYSQL_HOST": "<host>",
"MYSQL_PORT": "<port>",
"MYSQL_USER": "<user>",
"MYSQL_PASS": "<pass>",
"MYSQL_DB": "db",
"ALLOW_INSERT_OPERATION": "false",
"ALLOW_UPDATE_OPERATION": "false",
"ALLOW_DELETE_OPERATION": "false"
}
}
}
}
License
MIT
Transport:
stdio
Language: 
Created: 4/21/2025
Updated: 4/23/2025
Recommend MCP Servers 💡
toolbox
googleapis
An open source MCP server for databases that simplifies tool development, integration, and management with features like connection pooling, authentication, and observability.
2024-06-07
streamable
greptimedb-mcp-server
GreptimeTeam
A Model Context Protocol (MCP) server for GreptimeDB
2025-03-12
mssql_mcp_server
JexinSam
An MCP server enabling secure interactions with MSSQL databases
2025-01-30
@rijk/directus-mcp-server
rijkvanzanten
MCP server that allows AI tools to connect to and use Directus API
2025-03-31
mcp_server_waii
waii-ai
A Model Context Protocol server that enables Language Models to interact with databases through natural language via WAII.
2025-04-24