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
Recommend MCP Servers 💡
mcp-mysql-server
A Python-based MCP server for interacting with a local MySQL database via stdio, offering query execution, schema inspection, and data manipulation.
mcp-sqlalchemy-server
A simple MCP ODBC server using FastAPI, ODBC and SQLAlchemy.
leeb003/supabase-mcp
A Model Context Protocol server for interacting with Supabase databases using FastAPI and FastMCP, providing CRUD operations and real-time event streaming via SSE.
allizwellai/mysql-mcp-server
An MCP server providing secure, read-only access to MySQL databases for listing, describing, and querying data.
singlestore-mcp-server
An MCP server that enables natural language interaction with SingleStore Management API and services, allowing users to perform database operations and manage workspaces via LLM clients.
mcp-jdbc-server
Java-based MCP Server for JDBC, compatible with Virtuoso and other JDBC-compliant DBMS.