ai2mysql-mcp-server

ai2mysql-mcp-server

0

The MySQL MCP Server provides a way to communicate with MySQL databases using the MCP protocol, supporting query and data manipulation operations. It is configurable via environment variables and includes debug logging for troubleshooting.

MySQL MCP Server

A MySQL database connection server built on the go-mcp, supporting communication with clients via stdio, allowing execution of SQL queries and data manipulation operations.

Features

  • Communicates with clients through the MCP protocol
  • Supports connection to MySQL databases
  • Supports query operations (SELECT, SHOW, DESCRIBE)
  • Supports data manipulation operations (INSERT/UPDATE/DELETE)
  • Permission control (configurable for insert, update, delete operations)
  • Flexible configuration via environment variables
  • Debug mode with detailed logging to file

Installation

Method 1: Direct Installation (Recommended)

Install directly from GitHub using Go's install command.

Method 2: Manual Build

  • Clone the repository.
  • Build the server using Go.

Configuration

The server is configured using environment variables.

Usage

Starting the Server

Run the server after installation. Enable development mode as needed.

Using with Cursor

Designed to work with clients like Cursor that support the MCP protocol.

Development

Project Structure

Main program entry point located in cmd/ai2mysql-mcp-server/main.go.

Dependencies

Uses go-sql-driver/mysql and go-mcp libraries.

Debugging and Troubleshooting

Enable debug mode by setting IS_DEV=true to output detailed logs.