MySQL MCP Server
Integrates with MySQL databases to provide secure database access for LLMs.
MySQL MCP Server
An MCP server implementation that integrates with MySQL databases, providing secure database access capabilities for LLMs.
Features
- Read Operations
- Execute read-only SELECT queries
- List all database tables
- Show table structures
- View schema information
- Write Operations
- Execute INSERT/UPDATE/DELETE with transaction support
- Parameterized queries for data safety
- Returns affected rows and insert IDs
- Security
- Read-only transaction mode for SELECT queries
- Query length and result size limits
- Performance monitoring and logging
- Automatic transaction handling
Installation
npm install -g @kevinwatt/mysql-mcp
Usage with Dive Desktop
- Click "+ Add MCP Server" in Dive Desktop
- Copy and paste this configuration:
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"@kevinwatt/mysql-mcp"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "",
"MYSQL_DB": "your_database"
}
}
}
}
- Click "Save" to install the MCP server
Tool Documentation
-
mysql_query
- Execute read-only SELECT queries
- Inputs:
sql(string): SQL SELECT query to execute
- Limits:
- Maximum query length: 4096 characters
- Maximum result rows: 1000
- Query timeout: 30 seconds
-
mysql_execute
- Execute data modification operations
- Inputs:
sql(string): SQL statement (INSERT/UPDATE/DELETE)params(array, optional): Parameters for the SQL statement
- Features:
- Returns affected rows count
- Returns last insert ID
- Automatic transaction handling
-
list_tables
- List all tables in current database
- No inputs required
-
describe_table
- Show table structure
- Inputs:
table(string): Table name to describe
Usage Examples
Ask your LLM to:
"Show me all tables in the database"
"Describe the structure of users table"
"Select all active users from the database"
"Insert a new record into orders table"
Manual Start
If needed, start the server manually:
npx @kevinwatt/mysql-mcp
Requirements
- Node.js 18+
- MySQL Server
- MCP-compatible LLM service
License
MIT
Author
Dewei Yen
Keywords
- mcp
- mysql
- database
- dive
- llm
- ai
Related Servers
Chroma MCP Server
An MCP server for the Chroma embedding database, providing persistent, searchable working memory for AI-assisted development with features like automated context recall and codebase indexing.
qmcp Server
An MCP server for integrating with and querying q/kdb+ databases.
MCP Memory Dashboard
A desktop application for managing and interacting with the MCP Memory Service, a semantic memory system built on the Model Context Protocol.
Drug Gene Interaction Database (DGIdb)
A bridge to the Drug Gene Interaction Database (DGIdb) API, enabling AI clients to query drug-gene interaction data.
CData Reckon
A read-only MCP server for Reckon, enabling LLMs to query live data using the CData JDBC Driver.
Trino MCP Server
Securely interact with Trino databases to list tables, read data, and execute SQL queries.
MySQL MCP Server
Provides direct access to MySQL databases, allowing AI agents to execute SQL queries and manage database content.
Kollektiv MCP
Build and access a personal LLM knowledge base from your editor or client without any infrastructure setup.
PostgreSQL MCP Server by CData
A read-only MCP server for PostgreSQL, enabling LLMs to query live data from PostgreSQL databases.
CockroachDB
Integrate with CockroachDB, a cloud-native, distributed SQL database.