Provides MySQL database connectivity with tools for querying table schemas and structures in MySQL databases.
MySQL MCP Server
A Model Context Protocol (MCP) server that provides MySQL database connectivity and tools.
Installation
Usage
Configuration
The server can be configured using either environment variables or command-line arguments. Environment variables take precedence over command-line arguments.
Environment Variables
MYSQL_HOST: MySQL host (default: localhost)MYSQL_PORT: MySQL port (default: 3306)MYSQL_USER: MySQL user (default: root)MYSQL_PASSWORD: MySQL password (default: empty)MYSQL_DATABASE: MySQL database (default: test)
Command-Line Arguments
-h, --host: MySQL host (default: localhost)-p, --port: MySQL port (default: 3306)-u, --user: MySQL user (default: root)-P, --password: MySQL password (default: empty)-d, --database: MySQL database (default: test)
Examples
Basic usage with default settings:
Specify custom host and database:
Using short flags:
Claude Desktop Configuration
Using environment variables (recommended):
For local development:
Available Tools
get-schema: Get the schema/structure of a MySQL table
Parameters:
schemaName(string) - The name of the table to describe
Development
Publishing to npm
To make this package available via npx:
Update the package.json with your npm account details
Run:
npm publish
License
ISC