- Explore MCP Servers
- mcp-mysql-client
Mcp Mysql Client
What is Mcp Mysql Client
mcp-mysql-client is a Model Context Protocol (MCP) server designed for interacting with MySQL databases. It allows AI models to perform database operations through a standardized interface.
Use cases
Use cases include AI model training that requires data retrieval from MySQL, automated database management tasks, and applications needing to interact with MySQL databases for data storage and retrieval.
How to use
To use mcp-mysql-client, first build the server with ‘go build’, then run it using ‘./mcp-mysql-client’. You can connect to a MySQL database by providing the required parameters such as host, port, username, and password.
Key features
Key features include the ability to connect to MySQL databases, execute SQL queries, list available databases, list tables within a database, and describe table structures.
Where to use
mcp-mysql-client can be used in various fields such as data analysis, machine learning, and application development where interaction with MySQL databases is required.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Mysql Client
mcp-mysql-client is a Model Context Protocol (MCP) server designed for interacting with MySQL databases. It allows AI models to perform database operations through a standardized interface.
Use cases
Use cases include AI model training that requires data retrieval from MySQL, automated database management tasks, and applications needing to interact with MySQL databases for data storage and retrieval.
How to use
To use mcp-mysql-client, first build the server with ‘go build’, then run it using ‘./mcp-mysql-client’. You can connect to a MySQL database by providing the required parameters such as host, port, username, and password.
Key features
Key features include the ability to connect to MySQL databases, execute SQL queries, list available databases, list tables within a database, and describe table structures.
Where to use
mcp-mysql-client can be used in various fields such as data analysis, machine learning, and application development where interaction with MySQL databases is required.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MySQL MCP Server
A Model Context Protocol (MCP) server for interacting with MySQL databases.
Overview
This project implements a MySQL client as an MCP server using Go. It allows AI models to interact with MySQL databases through a standardized interface, enabling them to perform database operations like querying, listing databases and tables, and describing table structures.
Features
- Connect to MySQL databases
- Execute SQL queries
- List available databases
- List tables in a database
- Describe table structure
Project Structure
. ├── main.go # Main application entry point ├── pkg/ │ ├── datastore/ # Database connection management │ │ ├── interface.go # Interface for datastore operations │ │ └── mysql.go # MySQL implementation │ ├── handlers/ # MCP tool handlers │ │ ├── handlers.go │ │ └── handlers_test.go │ ├── integration/ # Integration tests with real MySQL │ │ ├── helper.go │ │ └── handlers_integration_test.go │ └── utils/ # Utility functions │ └── formatter.go ├── docker-compose.yml # Docker setup for testing └── README.md
Requirements
- Go 1.24 or later
- MySQL server
Dependencies
- github.com/mark3labs/mcp-go - MCP Go library
- github.com/go-sql-driver/mysql - MySQL driver for Go
Building and Running
# Build the server
go build
# Run the server
./mcp-mysql-client
Testing
Unit Tests
Run the unit tests with:
make test-unit
MCP Tools
Connect
Establishes a connection to a MySQL database.
Parameters:
host(required): MySQL host addressport(default: “3306”): MySQL portusername(required): MySQL usernamepassword(required): MySQL passworddatabase(default: “”): MySQL database name
Query
Executes a SQL query on the connected database.
Parameters:
sql(required): SQL query to execute
List Databases
Lists all databases available on the connected MySQL server.
Parameters: None
List Tables
Lists all tables in the current database or a specified database.
Parameters:
database(optional): Database name (uses current connection if not specified)
Describe Table
Describes the structure of a specified table.
Parameters:
table(required): Table name
License
MIT
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










