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-opennutrition
MCP server providing access to the comprehensive OpenNutrition food database with 300,000+ food items, nutritional data, and barcode lookups.
affannahmed/MCP-Server-with-Claude-Ai
An MCP implementation enabling secure interaction between AI applications and MySQL databases
chroma-mcp
A Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma
neondatabase-labs/mcp-server-neon
An open-source MCP server that enables natural language interaction with Neon Postgres databases via the Neon Management API.
@f4ww4z/mcp-mysql-server
A Model Context Protocol server for MySQL database operations
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.