MCP Catalogs
Home

mysql_mcp_server

by designcomputer·1,251·Score 52

MCP server enabling secure interaction with MySQL databases through structured API.

databasedeveloper-toolssecurity
236
Forks
57
Open issues
12 mo ago
Last commit
2d ago
Indexed

Overview

MySQL MCP Server is a production-ready Model Context Protocol implementation that facilitates secure communication between AI applications and MySQL databases. It provides a controlled interface for database exploration and analysis with proper error handling and comprehensive logging. The server supports listing available tables, reading table contents, and executing SQL queries through environment variable-based configuration for secure database access.

Try asking AI

After installing, here are 5 things you can ask your AI assistant:

you:Data analysis by AI models through secure SQL queries
you:Database exploration and schema inspection for AI assistants
you:Integration of MySQL data with AI-powered applications
you:Is this server designed to be used as a standalone application?
you:What security considerations should I keep in mind?

When to choose this

Choose this when you need secure, structured access to MySQL databases for AI applications with comprehensive logging and environment variable-based security.

When NOT to choose this

Don't choose this if you need write access to databases (current implementation appears read-only) or if you require authentication beyond environment variables.

Tools this server exposes

3 tools extracted from the README
  • list_tables

    List available MySQL tables as resources

  • read_table

    Read table contents from MySQL database

  • execute_query

    Execute SQL queries with proper error handling

Comparable tools

postgres-mcpmariadb-mcpsupabase-mcpmysql-shell-mcp

Installation

Installation

Manual Installation
pip install mysql-mcp-server
Installing via Smithery

To install MySQL MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mysql-mcp-server):

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

Set the following environment variables:

MYSQL_HOST=localhost     # Database host
MYSQL_PORT=3306         # Optional: Database port (defaults to 3306 if not specified)
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=your_database
With Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "mysql": {
      "command": "uv",
      "args": [
        "--directory",
        "path/to/mysql_mcp_server",
        "run",
        "mysql_mcp_server"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

FAQ

Is this server designed to be used as a standalone application?
No, MySQL MCP Server is designed to be used as a communication protocol implementation between AI applications and MySQL databases, not as a standalone server.
What security considerations should I keep in mind?
Always use a dedicated MySQL user with minimal permissions, never use root credentials, restrict database access to only necessary operations, enable logging for audit purposes, and implement regular security reviews.

Compare mysql_mcp_server with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.