Skip to main content
Glama

MySQL MCP Server

by dave-wind

@davewind/mysql-mcp-server

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@localhost/ 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.

Component Interaction

Component Interaction

Security Model

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

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.

License

MIT

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

LLM에 MySQL 데이터베이스에 대한 읽기 전용 액세스 권한을 제공하는 서버로, 이를 통해 LLM은 데이터베이스 스키마를 검사하고 읽기 전용 쿼리를 실행할 수 있습니다.

  1. 주요 특징
    1. 도구
      1. 자원
        1. 설치하다
          1. 구성
            1. 시험
            2. 환경
            3. 시스템 아키텍처
            4. 구성 요소 상호 작용
            5. 구성 요소 상호 작용
            6. 보안 모델
            7. LLM과의 통합
          2. 특허

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              Enables LLMs to interact with MySQL databases by inspecting schemas and executing safe, read-only queries within transactions.
              Last updated -
              3
              8
              MIT License
              • Apple
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that provides read-only access to MySQL databases, enabling LLMs to inspect database schemas and execute read-only queries.
              Last updated -
              3,655
              732
              MIT License
              • Linux
              • Apple
            • A
              security
              A
              license
              A
              quality
              An MCP server that provides read-only access to MySQL databases.
              Last updated -
              4
              731
              41
              MIT License
              • Linux
              • Apple
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server providing read-only access to MySQL databases, enabling LLMs to inspect database schemas and execute read-only queries.
              Last updated -
              0
              1
              MIT License
              • Linux
              • Apple

            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/dave-wind/mysql-mcp-server'

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