- Home
- MCP servers
- MySQL
MySQL
- javascript
0
GitHub Stars
javascript
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"iceeeeec-mqsql-mcp": {
"command": "npx",
"args": [
"@shuwu/mcp-mysql-server"
],
"env": {
"DB_HOST": "localhost",
"DB_NAME": "your_database",
"DB_PORT": "3306",
"DB_USER": "root",
"ALLOW_WRITE": "false",
"DB_PASSWORD": "your_password"
}
}
}
}You can run a dedicated MCP server that safely queries a MySQL database on behalf of AI assistants. It supports standard SQL queries, lists tables, and reveals table structures while preventing unsafe DDL operations. This lets you integrate AI-powered querying securely with your MySQL data.
How to use
Once the MCP MySQL Server is running, you can ask your MCP client to perform common database actions. You can query data from tables, list all tables in the database, and inspect table structures. By default, write operations are disabled to protect the database, and you can enable them later if you choose to do so.
How to install
Prerequisites you need before starting:
- Node.js 22+ is required
- npm or npx is available in your environment
- A running MySQL instance you can connect to with credentials
Choose one of the installation methods below.
Method 1: Install via npm (recommended)
# Global installation
npm install -g @shuwu/mcp-mysql-server
# Or use npx (no installation needed)
npx @shuwu/mcp-mysql-server
Method 2: Local development setup
# Clone or download the project
git clone https://github.com/your-username/mcp-mysql-server.git
cd mcp-mysql-server
# Install dependencies
npm install
Additional configuration and usage notes
Create a .env file in the project folder to configure the database connection and behavior. Include the host, port, user, password, database name, and whether write operations are allowed.
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=your_database
ALLOW_WRITE=false
Available tools
query
Executes a SQL query on the connected MySQL database and returns results.
list_tables
Lists all tables in the connected database.
describe_table
Returns the structure of a specified table.