@davewind/mysql-mcp-server

by dave-wind

13 stars
259 downloads
Not rated
GitHub

About

Provides read-only access to MySQL databases, allowing LLMs to inspect schemas and execute queries.

Details

Author
dave-wind
GitHub stars
13
Downloads
259
Categories
Database

- Read-only database access with SQL validation and READ ONLY transactions
- Automatic schema discovery for all tables in the database
- Single query tool that accepts and executes SELECT statements
- Full compliance with the Model Context Protocol specification
- Simple configuration requiring only a connection string

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 @davewind/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 the package globally via npm install @davewind/mysql-mcp-server -g, then configure your MCP settings file with the server command and a MySQL connection string. The server is invoked with npx -y @davewind/mysql-mcp-server mysql://user:password@localhost:port/database.

Claude Desktop / Cursor

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

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

McpServers

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

@davewind/mysql-mcp-server

Trust Score

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.

Key Features

1.Read-Only Database Access: Enforces read-only operations through SQL validation and READ ONLY transactions 2.Schema Discovery: Automatically identifies and exposes database table structures 3.SQL Query Execution: Provides a query tool that accepts and executes SELECT statements 4.Model Context Protocol Compliance: Implements the MCP specification for seamless integration with compatible LLMs 5.Simple Configuration: Easy setup with minimal configuration required

Tools

- 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 (mysql://user:password@localhost:3306/database)
- JSON schema information for each table
- Includes column names and data types
- Automatically discovered from database metadata

Install

npm install @davewind/mysql-mcp-server -g

Configuration

MCP settings configuration file:

> recommended use

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

Test

> Replace mysql://user:password@localhost:port/ and npm run inspector
  "scripts": {
    "inspector": "npx @modelcontextprotocol/inspector@0.10.2 build/index.js mysql://user:password@localhost:port/database
  }

Env


node v18 +

System Architecture

> The MySQL MCP Server acts as an intermediary between LLMs and MySQL databases, processing requests according to the Model Context Protocol. <p> </p>

Component Interaction

<p> </p>

Component Interaction

<p> </p>

Security Model

> The MySQL MCP Server implements a strict security model to ensure that database access is read-only. <p> </p>

Security measures include:

1.SQL query validation to allow only SELECT statements
2.Execution of all queries within READ ONLY transactions
3.No support for data modification operations (INSERT, UPDATE, DELETE, etc.)
4. No support for database schema modification (CREATE, ALTER, DROP, etc.)

Integration with LLMs

> The MySQL MCP Server is designed to work with any LLM system that supports the Model Context Protocol. It communicates through JSON-RPC over stdio, following the MCP specification. <p> </p>

License

MIT

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.