Skip to main content
Glama

MySQL MCP Server

by kevinwatt

MySQL MCP Server

An MCP server implementation that integrates with MySQL databases, providing secure database access capabilities for LLMs.

Features

  • Read Operations
    • Execute read-only SELECT queries
    • List all database tables
    • Show table structures
    • View schema information
  • Write Operations
    • Execute INSERT/UPDATE/DELETE with transaction support
    • Parameterized queries for data safety
    • Returns affected rows and insert IDs
  • Security
    • Read-only transaction mode for SELECT queries
    • Query length and result size limits
    • Performance monitoring and logging
    • Automatic transaction handling

Installation

npm install -g @kevinwatt/mysql-mcp

Usage with Dive Desktop

  1. Click "+ Add MCP Server" in Dive Desktop
  2. Copy and paste this configuration:
{ "mcpServers": { "mysql": { "command": "npx", "args": [ "-y", "@kevinwatt/mysql-mcp" ], "env": { "MYSQL_HOST": "127.0.0.1", "MYSQL_PORT": "3306", "MYSQL_USER": "root", "MYSQL_PASS": "", "MYSQL_DB": "your_database" } } } }
  1. Click "Save" to install the MCP server

Tool Documentation

  • mysql_query
    • Execute read-only SELECT queries
    • Inputs:
      • sql (string): SQL SELECT query to execute
    • Limits:
      • Maximum query length: 4096 characters
      • Maximum result rows: 1000
      • Query timeout: 30 seconds
  • mysql_execute
    • Execute data modification operations
    • Inputs:
      • sql (string): SQL statement (INSERT/UPDATE/DELETE)
      • params (array, optional): Parameters for the SQL statement
    • Features:
      • Returns affected rows count
      • Returns last insert ID
      • Automatic transaction handling
  • list_tables
    • List all tables in current database
    • No inputs required
  • describe_table
    • Show table structure
    • Inputs:
      • table (string): Table name to describe

Usage Examples

Ask your LLM to:

"Show me all tables in the database" "Describe the structure of users table" "Select all active users from the database" "Insert a new record into orders table"

Manual Start

If needed, start the server manually:

npx @kevinwatt/mysql-mcp

Requirements

  • Node.js 18+
  • MySQL Server
  • MCP-compatible LLM service

License

MIT

Author

Dewei Yen

Keywords

  • mcp
  • mysql
  • database
  • dive
  • llm
  • ai
-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

An MCP server that integrates with MySQL databases, enabling secure read and write operations through LLM-driven interfaces with support for transaction handling and performance monitoring.

  1. Features
    1. Installation
      1. Usage with Dive Desktop
        1. Tool Documentation
          1. Usage Examples
            1. Manual Start
              1. Requirements
                1. License
                  1. Author
                    1. Keywords

                      Related MCP Servers

                      • A
                        security
                        A
                        license
                        A
                        quality
                        An MCP server that provides read-only access to MySQL databases.
                        Last updated -
                        4
                        826
                        40
                        JavaScript
                        MIT License
                        • Linux
                        • Apple
                      • A
                        security
                        A
                        license
                        A
                        quality
                        An MCP server that enables MySQL database integration with Claude. You can execute SQL queries and manage database connections.
                        Last updated -
                        2
                        7
                        Python
                        MIT License
                        • Apple
                      • -
                        security
                        F
                        license
                        -
                        quality
                        An MCP server that allows working with MySQL databases by providing tools for executing read-only SQL queries, getting table schemas, and listing database tables.
                        Last updated -
                        436
                        2
                        JavaScript
                      • -
                        security
                        F
                        license
                        -
                        quality
                        A FastMCP-based server that enables interaction with MySQL databases, supporting client-server communication for querying and analyzing MySQL data.
                        Last updated -
                        Python

                      View all related MCP servers

                      MCP directory API

                      We provide all the information about MCP servers via our MCP API.

                      curl -X GET 'https://glama.ai/api/mcp/v1/servers/kevinwatt/mysql-mcp'

                      If you have feedback or need assistance with the MCP directory API, please join our Discord server