Feedback

Read MySQL MCP Server

@benborla Claim

Basic information

Runtime
JavaScript
Version
1.0.0
Category
License
MIT
Transports
stdio
Author
benborla
Submitted by
Community
Quality
10
Stars
1.3K

About Read MySQL MCP Server

Securely join MySQL databases with Read MySQL for read-only query access and in-depth data analysis.

Read MySQL is a MCP server in the Databases category listed in the AddMCP.net directory, published by benborla. It exposes 1 tool, including Monitoring. Supported transport: stdio. Runtime: JavaScript. License: MIT. The repository has 1,294 GitHub stars. Source code is hosted on github.com. Related topics: community, databases, developer-tools.

Setup

{
    "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",
                "PATH": "/path/to/node/bin:/usr/bin:/bin",
                "MYSQL_POOL_SIZE": "10",
                "MYSQL_QUERY_TIMEOUT": "30000",
                "MYSQL_CACHE_TTL": "60000",
                "MYSQL_RATE_LIMIT": "100",
                "MYSQL_MAX_QUERY_COMPLEXITY": "1000",
                "MYSQL_SSL": "true",
                "ENABLE_LOGGING": "true",
                "MYSQL_LOG_LEVEL": "info",
                "MYSQL_METRICS_ENABLED": "true",
                "ALLOW_INSERT_OPERATION": "false",
                "ALLOW_UPDATE_OPERATION": "false",
                "ALLOW_DELETE_OPERATION": "false"
            }
        }
    }
}

Read MySQL MCP Server config

Add this server to your MCP-compatible client using the configuration below.

{
    "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",
                "PATH": "/path/to/node/bin:/usr/bin:/bin",
                "MYSQL_POOL_SIZE": "10",
                "MYSQL_QUERY_TIMEOUT": "30000",
                "MYSQL_CACHE_TTL": "60000",
                "MYSQL_RATE_LIMIT": "100",
                "MYSQL_MAX_QUERY_COMPLEXITY": "1000",
                "MYSQL_SSL": "true",
                "ENABLE_LOGGING": "true",
                "MYSQL_LOG_LEVEL": "info",
                "MYSQL_METRICS_ENABLED": "true",
                "ALLOW_INSERT_OPERATION": "false",
                "ALLOW_UPDATE_OPERATION": "false",
                "ALLOW_DELETE_OPERATION": "false"
            }
        }
    }
}

Read MySQL MCP Server tools

  • Monitoring — comprehensive query logging and performance metrics.

Overview

What is Read MySQL?

A Model Context Protocol server that provides access to MySQL databases, enabling LLMs to inspect database schemas and execute SQL queries. It’s designed for developers using AI assistants like Claude or Cursor to interact with MySQL databases.

How to use Read MySQL?

Install via npx -y @benborla29/mcp-server-mysql, Smithery, MCP Get, npm/pnpm, or by cloning the repository. Configure environment variables like MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASS, and MYSQL_DB. Use the mysql_query tool to run SQL queries; write operations (INSERT/UPDATE/DELETE) are disabled by default and must be enabled via ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION, ALLOW_DELETE_OPERATION.

Key features of Read MySQL

  • Execute SQL queries via the mysql_query tool.
  • Enforce read-only operations by default.
  • Optional INSERT, UPDATE, DELETE permissions.
  • Automatic discovery of table schemas, indexes, constraints.
  • Security features: prepared statements, rate limiting, query complexity analysis.
  • Performance optimizations: connection pooling, caching, result streaming.
  • Monitoring: comprehensive query logging and performance metrics.

Use cases of Read MySQL

  • Allow an LLM (e.g., Claude) to inspect MySQL database schemas.
  • Let an LLM run SQL SELECT queries for data analysis.
  • Enable an LLM to insert, update, or delete data when explicitly permitted.
  • Integrate with Cursor IDE for database-aware coding assistance.
  • Use via Smithery for one-click setup with any compliant client.

Frequently asked questions

1 What are the system requirements?

Node.js v18 or higher and MySQL 5.7 or higher (MySQL 8.0+ recommended). The MySQL user must have appropriate permissions for the operations needed.

2 Are write operations enabled by default?

No. INSERT, UPDATE, and DELETE operations are disabled by default for security. Set ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION, or ALLOW_DELETE_OPERATION to "true" to enable them.

3 How do I install this server?

You can install via npx -y @benborla29/mcp-server-mysql, using Smithery (npx -y @smithery/cli@latest install @benborla29/mcp-server-mysql --client claude), MCP Get, npm/pnpm globally, or by cloning the GitHub repository and building from source.

4 Does the server support SSL/TLS for database connections?

Yes. Set MYSQL_SSL to "true" in the environment configuration to enable encrypted connections.

5 How does the server protect against SQL injection?

All queries use prepared statements to prevent SQL injection. Additional security measures include rate limiting, query complexity analysis, and optional query whitelisting/blacklisting.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬