M
MySQL MCP Server
Provides AI assistants with access to MySQL databases through MCP, enabling SQL queries, table listing, and schema inspection via a secure connection string.
stdioLocalApiKeynpm
What This Server Exposes
Tools
querylist_tablesdescribe_table
Resources
- •table schemas
- •query results
Setup Instructions
- 1Ensure a MySQL database is running and accessible
- 2Create a database user with the minimum required permissions
- 3Add the MySQL server config to your Claude Desktop configuration
- 4Set the MYSQL_URL environment variable with the connection string
- 5Restart Claude Desktop
Configuration
Claude Desktop Configuration
claude_desktop_config.json
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mysql"
],
"env": {
"MYSQL_URL": "mysql://user:password@localhost:3306/dbname"
}
}
}
}Environment Variables
| Name | Required | Secret | Description |
|---|---|---|---|
| MYSQL_URL | ✓ | 🔒 | MySQL connection URL including user, password, host, port, and database name |
MYSQL_URL
MySQL connection URL including user, password, host, port, and database name
Required🔒 Secret
Server Manifest
No official server.json manifest found. Generate one with our MCP server.json Generator →
Compatibility
Claude DesktopClaude Code
⚠
Safety Notes
Use a database user with read-only or minimal permissions to limit the impact of unintended queries. Never expose production MySQL credentials. Store the connection URL securely and never commit it to version control.
This listing is for informational purposes only. CodexSpot is not affiliated with MySQL MCP Server.