Back to MCP Directory
MySQL
Model Context Protocol moderate risk

MySQL

This MCP server enables AI models to interact with MySQL databases, providing tools for querying, executing commands, and managing database structure.

Connections & Capabilities

Connects To

GitHubMySQL

Capabilities

readwriteexecadmin

Quickstart

Install

npx -y @smithery/cli install @f4ww4z/mcp-mysql-server --client claude

Config

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "@f4ww4z/mcp-mysql-server", "mysql://user:password@localhost:port/database"],
    }
  }
}

Exposed MCP Tools (5)

safe
connect_db

Establishes a connection to a MySQL database using provided credentials.

Only establishes a connection; no data is read or modified.

safe
query

Executes SELECT queries against the database.

Read-only operation; no data modification.

high
execute

Executes INSERT, UPDATE, or DELETE queries against the database.

Allows modification of data within the database.

safe
list_tables

Lists all tables in the connected database.

Read-only operation; retrieves metadata about the database.

safe
describe_table

Retrieves the structure of a specific table.

Read-only operation; retrieves metadata about a specific table.

Safety Assessment

This server provides useful database interaction capabilities but requires careful configuration and monitoring. It is safe when used with appropriate access controls and query validation. It is risky if exposed to untrusted AI models or if database credentials are not securely managed.

  • Uses prepared statements to prevent SQL injection.
  • Supports secure password handling through environment variables.
  • Validates queries before execution.
  • Automatically closes connections when done.
  • Requires database credentials, which if compromised, could lead to unauthorized access.
  • Allows execution of arbitrary SQL queries, which could be destructive if not properly controlled.
  • No built-in rate limiting or usage controls.
  • Potential for data exfiltration if the AI model is compromised.