MySQL MCP Server
MySQL MCP servers enable AI models to interact with MySQL databases, providing capabilities for structured data operations, SQL queries, transaction management, and relational data management.
Overview
The MCP MySQL Server enables AI models to interact with MySQL databases, providing a standardized interface for working with this popular relational database management system. MySQL is widely used for web applications, enterprise software, and data-driven applications, making it essential for AI integrations.
Created by:
Developed by Fawaz Jullian
Key Features
Secure Connection Handling
Secure connection handling with automatic cleanup
Prepared Statement Support
Prepared statement support for query parameters
Comprehensive Error Handling
Comprehensive error handling and validation
Automatic Connection Management
Automatic connection management
Available Tools
Quick Reference
| Tool | Purpose | Category |
|---|---|---|
connect_db | Establish database connection | Connection |
query | Execute SELECT queries | Read |
execute | Execute INSERT/UPDATE/DELETE | Write |
list_tables | List all tables | Schema |
describe_table | Get table structure details | Schema |
Detailed Usage
connect_db▶
Warning:
only use when requested or if other commands fail
Establish connection to MySQL database using provided credentials.
use_mcp_tool({
server_name: "mysql",
tool_name: "connect_db",
arguments: {
host: "localhost",
user: "your_user",
password: "your_password",
database: "your_database"
}
});
query▶
Execute SELECT queries with optional prepared statement parameters.
use_mcp_tool({
server_name: "mysql",
tool_name: "query",
arguments: {
sql: "SELECT * FROM users WHERE id = ?",
params: [1]
}
});
execute▶
Execute INSERT, UPDATE, or DELETE queries with optional prepared statement parameters.
use_mcp_tool({
server_name: "mysql",
tool_name: "execute",
arguments: {
sql: "INSERT INTO users (name, email) VALUES (?, ?)",
params: ["John Doe", "[email protected]"]
}
});
list_tables▶
List all tables in the connected database.
use_mcp_tool({
server_name: "mysql",
tool_name: "list_tables",
arguments: {}
});
describe_table▶
Get the structure of a specific table.
use_mcp_tool({
server_name: "mysql",
tool_name: "describe_table",
arguments: {
table: "users"
}
});
Installation
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"@f4ww4z/mcp-mysql-server"
],
"env": {
"MYSQL_HOST": "your_host",
"MYSQL_USER": "your_user",
"MYSQL_PASSWORD": "your_password",
"MYSQL_DATABASE": "your_database"
}
}
}
}
Sources
Related Articles
Supavec MCP Server: Vector Database for AI Applications
Supavec MCP servers enable AI models to interact with vector databases, providing capabilities for storing, searching, and managing vector embeddings for AI applications.
Confluence MCP Server
Confluence MCP servers provide interfaces for LLMs to interact with Atlassian Confluence workspaces. These servers enable AI models to manage documentation, collaborate on content, and automate knowledge management tasks.
Blender MCP Server
Blender MCP Server connects Blender to Claude AI through the Model Context Protocol (MCP), enabling prompt-assisted 3D modeling, scene creation, and manipulation.