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 💡
PostgresSchemaServer
An MCP server built with Spring Boot and Spring AI that provides tools to inspect PostgreSQL database schema using SSE transport
mcp-adonet-server
A C#-based MCP server enabling ADO.NET ODBC database interactions for LLMs via Model Context Protocol, supporting SQL/SPARQL queries and Virtuoso-specific features
cdata-jdbc-mcp-server
A read-only MCP Server that connects Claude Desktop to external data through CData JDBC Drivers
influxdb-mcp-server
An MCP Server for querying InfluxDB
@niledatabase/nile-mcp-server
MCP server for Nile Database - Manage and query databases, tenants, users, auth using LLMs
ydb-mcp
Model Context Protocol server for YDB, enabling AI-powered database operations and natural language interactions with YDB instances via LLM that supports MCP