MySQL MCP Server
Provides MySQL database connectivity and schema inspection tools, allowing users to connect to MySQL databases and retrieve table structures through configurable connection parameters.
README
MySQL MCP Server
A Model Context Protocol (MCP) server that provides MySQL database connectivity and tools.
Installation
npm install
npm run build
Usage
Command-Line Arguments
The server accepts the following 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:
mysql-mcp
Specify custom host and database:
mysql-mcp --host db.example.com --database myapp
Using short flags:
mysql-mcp -h 192.168.1.100 -u myuser -P mypass -d production
Claude Desktop Configuration
Using npx (recommended after publishing to npm):
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"mysql-mcp@1.0.0",
"--host",
"your-mysql-host",
"--port",
"3306",
"--user",
"your-username",
"--password",
"your-password",
"--database",
"your-database"
]
}
}
}
Or using short flags:
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"mysql-mcp@1.0.0",
"-h",
"your-mysql-host",
"-p",
"3306",
"-u",
"your-username",
"-P",
"your-password",
"-d",
"your-database"
]
}
}
}
For local development:
{
"mcpServers": {
"mysql": {
"command": "node",
"args": [
"/path/to/your/mysql-mcp/build/index.js",
"-h",
"localhost",
"-u",
"root",
"-d",
"test"
]
}
}
}
Available Tools
- get-schema: Get the schema/structure of a MySQL table
- Parameters:
schemaName(string) - The name of the table to describe
- Parameters:
Development
# Install dependencies
npm install
# Run in development mode
npm run server:dev
# Build the project
npm run build
# Watch and rebuild on changes
npm run server:build:watch
# Run with MCP Inspector (for debugging)
npm run server:inspect
Publishing to npm
To make this package available via npx:
- Update the package.json with your npm account details
- Run:
npm publish
License
ISC
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.