MySQL MCP Server

MySQL MCP Server

A server that provides LLMs with read-only access to MySQL databases, allowing them to inspect database schemas and execute read-only queries.

Category
Visit Server

README

@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: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> <img src="./docs/High-Level Architecture.png" alt=""/> </p>

Component Interaction

<p> <img src="./docs/component-Interaction.png" alt=""/> </p>

Component Interaction

<p> <img src="./docs/component-Interaction.png" alt=""/> </p>

Security Model

The MySQL MCP Server implements a strict security model to ensure that database access is read-only. <p> <img src="./docs/Security Model.png" alt=""/> </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> <img src="./docs/Integration with LLMs.png" alt=""/> </p>

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured