MySQL MCP Server
by kevinwatt
An MCP server implementation that integrates with MySQL databases, providing secure database access capabilities for LLMs. It enables both read and write operations with security features.
Last updated: N/A
What is MySQL MCP Server?
MySQL MCP Server is an implementation of the MCP (Model Control Protocol) that allows LLMs (Large Language Models) to securely interact with MySQL databases. It provides a controlled interface for LLMs to execute queries and manage data within a MySQL database.
How to use MySQL MCP Server?
The server can be installed using npm (npm install -g @kevinwatt/mysql-mcp
). It's designed to be integrated with platforms like Dive Desktop. Configuration involves specifying database connection details (host, port, user, password, database name) within the MCP server's environment variables. The server can be started manually using npx @kevinwatt/mysql-mcp
.
Key features of MySQL MCP Server
Read Operations: Execute SELECT queries, list tables, show table structures, view schema information.
Write Operations: Execute INSERT/UPDATE/DELETE statements with transaction support and parameterized queries.
Security: Read-only transaction mode, query length and result size limits, performance monitoring and logging, automatic transaction handling.
Tool Documentation: Provides specific tools like
mysql_query
,mysql_execute
,list_tables
, anddescribe_table
for interacting with the database.
Use cases of MySQL MCP Server
Allowing LLMs to retrieve information from a MySQL database to answer user questions.
Enabling LLMs to update data in a MySQL database based on user instructions.
Building applications where LLMs can manage and analyze data stored in MySQL.
Integrating LLMs with existing MySQL-backed systems to automate tasks.
FAQ from MySQL MCP Server
What is the maximum query length for mysql_query
?
What is the maximum query length for mysql_query
?
The maximum query length is 4096 characters.
What is the maximum number of result rows for mysql_query
?
What is the maximum number of result rows for mysql_query
?
The maximum number of result rows is 1000.
What is the query timeout for mysql_query
?
What is the query timeout for mysql_query
?
The query timeout is 30 seconds.
Does mysql_execute
handle transactions automatically?
Does mysql_execute
handle transactions automatically?
Yes, mysql_execute
provides automatic transaction handling.
What are the requirements for running the MySQL MCP Server?
What are the requirements for running the MySQL MCP Server?
The requirements are Node.js 18+, a MySQL Server, and an MCP-compatible LLM service.