MySQL

MySQL

MySQL database integration in Python with configurable access controls and schema inspection

994
Stars
207
Forks
6
Releases

Overview

The MySQL MCP Server is a Model Context Protocol implementation that enables secure interaction with MySQL databases. This server component facilitates communication between AI applications (hosts/clients) and MySQL databases, making database exploration and analysis safer and more structured through a controlled interface. It is not designed to be used as a standalone server, but rather as a MCP protocol implementation between AI applications and MySQL databases. It supports listing available MySQL tables as resources, reading table contents, and executing SQL queries with robust error handling, all while enforcing secure access via environment variables. Configuration is done through environment variables such as MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE, enabling safer deployments without hard-coded credentials. The project emphasizes comprehensive logging for auditing and debugging. It is intended to be integrated with AI applications like Claude Desktop and VS Code, with guidance for configuration in Claude Desktop and VS Code. A dedicated MCP Inspector is provided for debugging, and security considerations and best practices are outlined.

Details

Owner
designcomputer
Language
Python
License
MIT License
Updated
2025-12-07

Features

List available MySQL tables as resources

Expose database tables as MCP resources for discovery and structured access.

Read table contents

Retrieve data from tables via MCP operations with safe result handling.

Execute SQL queries with proper error handling

Run SQL statements through the MCP server with robust error handling and feedback.

Secure database access through environment variables

Configure credentials via environment variables to avoid hard-coded secrets.

Comprehensive logging

Provide extensive logs of operations for auditability and debugging.

Audience

AI applicationsEnable safe MySQL access for AI hosts/clients through MCP protocol.
IntegratorsIntegrators can seamlessly connect Claude Desktop and VS Code environments to query MySQL via MCP.

Tags

MCPMySQLdatabasesecurityloggingAI integrationenvironment variablesSQLClaude DesktopVS Code