MySQL MCP Server

by affannahmed

332 downloads
Not rated
GitHub

Description

![Tests](https://github.com/designcomputer/mysql_mcp_server/actions/workflows/test.yml/badge.svg) [![smithery badge](https://smithery.ai/badge/mysql-mcp-server)](https://smithery.ai/server/mysql-mcp-server) # MySQL MCP Server A Model Context Protocol (MCP) implementation that…

About

![Tests](https://github.com/designcomputer/mysql_mcp_server/actions/workflows/test.yml/badge.svg) [![smithery badge](https://smithery.ai/badge/mysql-mcp-server)](https://smithery.ai/server/mysql-mcp-server) # MySQL MCP Server A Model Context Protocol (MCP) implementation that enables secure interaction with MySQL…

Details

Author
affannahmed
Downloads
332
Categories
AI

- List available MySQL tables as resources
- Read table contents
- Execute SQL queries with proper error handling
- Secure database access through environment variables
- Comprehensive logging

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MySQL MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install via pip install mysql-mcp-server or automatically through Smithery. Configure by setting environment variables for MySQL host, port, user, password, and database. Integrate with Claude Desktop by adding the server configuration to claude_desktop_config.json.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mysql mcp server": {
            "MCP-Server-with-Claude-Ai": {
                "command": "npx",
                "args": [
                    "-y",
                    "@smithery/cli",
                    "install",
                    "mysql-mcp-server",
                    "--client",
                    "claude"
                ]
            }
        }
    }
}

McpServers

{
    "MCP-Server-with-Claude-Ai": {
        "command": "npx",
        "args": [
            "-y",
            "@smithery/cli",
            "install",
            "mysql-mcp-server",
            "--client",
            "claude"
        ]
    }
}

MySQL MCP Server

A Model Context Protocol (MCP) implementation that enables secure interaction with MySQL databases. This server component facilitates communication between AI applications (hosts/clients) and MySQL databases, making database exploration and analysis safer and more structured through a controlled interface.

> Note: MySQL MCP Server is not designed to be used as a standalone server, but rather as a communication protocol implementation between AI applications and MySQL databases.

Features

- List available MySQL tables as resources - Read table contents - Execute SQL queries with proper error handling - Secure database access through environment variables - Comprehensive logging

Installation

Manual Installation

pip install mysql-mcp-server

Installing via Smithery

To install MySQL MCP Server for Claude Desktop automatically via Smithery:
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

Usage

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"
      }
    }
  }
}

Debugging with MCP Inspector

While MySQL MCP Server isn't intended to be run standalone or directly from the command line with Python, you can use the MCP Inspector to debug it.

The MCP Inspector provides a convenient way to test and debug your MCP implementation:

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.