mcp-mysql-server

This repository provides a Model Context Protocol (MCP) server enabling AI models to interact with MySQL databases through a standardized interface for executing queries and managing data. This repository provides

87
10

@f4ww4z/mcp-mysql-server

A Model Context Protocol (MCP) server that allows AI models to interact with MySQL databases through a standardized interface. It facilitates database operations by providing a set of tools accessible via the MCP.

Installation

Install via Smithery using the command: npx -y @smithery/cli install @f4ww4z/mcp-mysql-server --client claude. Alternatively, install manually using npx @f4ww4z/mcp-mysql-server.

Configuration

Configure the server by setting environment variables in your MCP settings file, including MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE.

Features

Key features include secure connection handling, prepared statement support, comprehensive error handling, TypeScript support, and automatic connection management.

Security

The server uses prepared statements to prevent SQL injection, supports secure password handling via environment variables, validates queries, and automatically closes connections.

Error Handling

Detailed error messages are provided for connection failures, invalid queries, missing parameters, and database errors.

Contributing

Contributions are welcome via Pull Requests to the GitHub repository.

License

MIT

Repository

F4
f4ww4z

f4ww4z/mcp-mysql-server

Created

December 13, 2024

Updated

March 28, 2025

Language

JavaScript

Category

Database