benborla/mcp-server-mysql
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.
What it solves
This project provides a bridge between Large Language Models (LLMs) like Claude and MySQL databases, allowing AI agents to interact with structured data directly. It solves the problem of AI agents lacking native access to live database schemas and the ability to execute SQL queries to answer data-driven questions.
How it works
It implements the Model Context Protocol (MCP), which standardizes how AI models can access external tools and resources. The server exposes a mysql_query tool for executing SQL and a mysql://tables resource to provide the model with the database schema and column metadata, enabling the model to write and execute queries based on the database structure.
Who it’s for
This is for developers and data analysts who want to integrate their MySQL databases with AI agents (such as Claude Code or Claude Desktop) to automate data retrieval and database inspection.
Highlights
- Read-only by default: Prevents accidental data modification by requiring explicit environment flags to enable write operations.
- SSH Tunnel Support: Allows secure connection to remote databases.
- PII Redaction: Automatically masks sensitive data in query results to improve privacy.
- Multi-DB Mode: Enables querying across multiple databases without needing to reconnect.
- SSL/TLS Support: Encrypted connections with an option for mTLS.
- Remote Mode: Supports HTTP transport with bearer token authentication.
Related
- Project
- Project
- Project
- Project
- Project