MySQL Explorer

by hkk101

Not rated
GitHub

About

Provides read-only access to MySQL databases for schema inspection and safe query execution, enabling database exploration and data analysis without modifying contents.

Details

Author
hkk101
Repository
hkk101/mcp-server-mysql
License
MIT License
Categories
Productivity, Developer Tools, Design, AI, Search, Frontend, Infrastructure, Database

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 Explorer
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @benborla29/mcp-server-mysql
    Environment
    • MYSQL_DB db_name
    • MYSQL_HOST 127.0.0.1
    • MYSQL_PASS
    • MYSQL_PORT 3306
    • MYSQL_USER root

    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

To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your claude_desktop_config.json:

{
  "mcpServers": {
    "mcp_server_mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql",
      ],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASS": "",
        "MYSQL_DB": "db_name"
      }

}
}
}

Replace /db_name with your database name or leave it blank to retrieve all databases.

mysql_query

Execute read-only SQL queries against the connected database. Input: `sql` (string): The SQL query to execute. All queries are executed within a READ ONLY transaction.

- mysql_query
- Execute read-only SQL queries against the connected database
- Input: sql (string): The SQL query to execute
- All queries are executed within a READ ONLY transaction

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "mysql explorer": {
            "env": {
                "MYSQL_DB": "db_name",
                "MYSQL_HOST": "127.0.0.1",
                "MYSQL_PASS": "",
                "MYSQL_PORT": "3306",
                "MYSQL_USER": "root"
            },
            "args": [
                "-y",
                "@benborla29/mcp-server-mysql"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": {
        "MYSQL_DB": "db_name",
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PASS": "",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root"
    },
    "args": [
        "-y",
        "@benborla29/mcp-server-mysql"
    ],
    "command": "npx"
}

Macos

{
    "env": {
        "MYSQL_DB": "db_name",
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PASS": "",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root"
    },
    "args": [
        "-y",
        "@benborla29/mcp-server-mysql"
    ],
    "command": "npx"
}

Windows

{
    "env": {
        "MYSQL_DB": "db_name",
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PASS": "",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root"
    },
    "args": [
        "/c",
        "npx",
        "-y",
        "@benborla29/mcp-server-mysql"
    ],
    "command": "cmd"
}

MCP Server for MySQL based on NodeJS

smithery badge Demo

A Model Context Protocol server that provides read-only access to MySQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.

Components

Tools

- mysql_query
- Execute read-only SQL queries against the connected database
- Input: sql (string): The SQL query to execute
- All queries are executed within a READ ONLY transaction

Resources

The server provides schema information for each table in the database:

- Table Schemas
- JSON schema information for each table
- Includes column names and data types
- Automatically discovered from database metadata

Usage with Claude Desktop

To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your claude_desktop_config.json:

{
  "mcpServers": {
    "mcp_server_mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql",
      ],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASS": "",
        "MYSQL_DB": "db_name"
      }

}
}
}

Replace /db_name with your database name or leave it blank to retrieve all databases.

Troubleshooting

If you encounter an error "Could not connect to MCP server mcp-server-mysql", you may need to explicitly set the path of all required binaries such as the configuration below:
{
  "mcpServers": {
    "mcp_server_mysql": {
      "command": "/path/to/npx/binary/npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql",
      ],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASS": "",
        "MYSQL_DB": "db_name"
        "PATH": "/path/to/node/bin:/usr/bin:/bin" <-- Add this
      }

}
}
}

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

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.