Skip to main content
Glama
boyzoid

MySQL MCP Server

by boyzoid

MySQL MCP Server

A Model Context Protocol (MCP) server that provides read-only access to MySQL databases. This server allows MCP clients (like Claude Desktop or other AI assistants) to explore database schemas, inspect table structures, and execute SELECT queries safely.

Features

Tools

  • describe_table - Shows table structure including columns, types, and keys

  • query - Executes validated read-only SQL queries (SELECT statements only)

Resources

  • mysql://schemas - Lists all available database schemas

  • mysql://schemas/{schema}/tables - Lists tables in a specific schema

Prompts

  • explore-schema - Guided exploration of a database schema's structure and relationships

  • query-builder - Interactive help for constructing SELECT queries

Related MCP server: MySQL MCP Server

Prerequisites

  • Node.js (v18 or higher recommended)

  • Access to a MySQL database

Installation

  1. Clone the repository and install dependencies:

npm install
  1. Build the TypeScript source:

npm run build

Configuration

Create a .env file based on the example:

cp .env.example .env

Edit .env with your MySQL connection details:

MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password

Usage

Running Directly

npm start

Configuring with an MCP Client

Add the server to your MCP client configuration. For example, in Claude Desktop's config file:

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["/path/to/mysql_mcp/dist/index.js"],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password"
      }
    }
  }
}

Security

This server enforces read-only access by parsing and validating all queries before execution. Only SELECT statements are permitted. Any attempt to run INSERT, UPDATE, DELETE, or other modifying statements will be rejected.

License

ISC

F
license - not found
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    Enables safe interaction with MySQL databases through SELECT queries, table structure inspection, and database schema exploration. Provides read-only access to query data and examine database metadata.
    Last updated
    1
  • A
    license
    -
    quality
    B
    maintenance
    Enables safe querying and optional writing to MySQL databases via MCP tools, with support for schema inspection, connection management, and read-only mode.
    Last updated
    38
    2
    MIT
  • A
    license
    -
    quality
    C
    maintenance
    Enables schema introspection and safe read-only queries on MySQL databases, supporting table/column discovery, relationship exploration, and controlled SELECT queries.
    Last updated
    24
    MIT

View all related MCP servers

Related MCP Connectors

  • Read-only MCP server for ClassQuill, a tutoring-business-management platform.

  • Read-only MCP access to sessions, funnels, campaigns, errors, live visitors, and anomalies.

  • Read-only MCP server for Muovi, Argentina's trust-first local services marketplace (6 tools).

View all MCP Connectors

Latest Blog Posts

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/boyzoid/mysql_mcp'

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