MySQL MCP Server
Provides read-only access to MySQL databases, enabling exploration of schemas, table structures, and execution of SELECT queries.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MySQL MCP ServerShow me the tables in the 'inventory' schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MySQL MCP Server
A Model Context Protocol (MCP) server that provides read-only access to MySQL databases. This server allows MCP clients (like Claude Desktop or other AI assistants) to explore database schemas, inspect table structures, and execute SELECT queries safely.
Features
Tools
describe_table - Shows table structure including columns, types, and keys
query - Executes validated read-only SQL queries (SELECT statements only)
Resources
mysql://schemas - Lists all available database schemas
mysql://schemas/{schema}/tables - Lists tables in a specific schema
Prompts
explore-schema - Guided exploration of a database schema's structure and relationships
query-builder - Interactive help for constructing SELECT queries
Related MCP server: MySQL MCP Server
Prerequisites
Node.js (v18 or higher recommended)
Access to a MySQL database
Installation
Clone the repository and install dependencies:
npm installBuild the TypeScript source:
npm run buildConfiguration
Create a .env file based on the example:
cp .env.example .envEdit .env with your MySQL connection details:
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=your_username
MYSQL_PASSWORD=your_passwordUsage
Running Directly
npm startConfiguring with an MCP Client
Add the server to your MCP client configuration. For example, in Claude Desktop's config file:
{
"mcpServers": {
"mysql": {
"command": "node",
"args": ["/path/to/mysql_mcp/dist/index.js"],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "your_username",
"MYSQL_PASSWORD": "your_password"
}
}
}
}Security
This server enforces read-only access by parsing and validating all queries before execution. Only SELECT statements are permitted. Any attempt to run INSERT, UPDATE, DELETE, or other modifying statements will be rejected.
License
ISC
This server cannot be deployed
Maintenance
Related MCP Connectors
- dataOAuthco.thinair
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Read-only MCP tools for AI agent discovery, structured resources, and NIULAI information.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables safe interaction with MySQL databases through SELECT queries, table structure inspection, and database schema exploration. Provides read-only access to query data and examine database metadata.1-
- AlicenseNot gradedqualityCmaintenanceEnables safe querying and optional writing to MySQL databases via MCP tools, with support for schema inspection, connection management, and read-only mode.16 npm3MIT
- AlicenseNot gradedqualityDmaintenanceEnables schema introspection and safe read-only queries on MySQL databases, supporting table/column discovery, relationship exploration, and controlled SELECT queries.8 npmMIT
- FlicenseAqualityCmaintenanceRead-only MySQL database access via MCP. Enables listing databases, tables, schemas, running SELECT queries, and EXPLAIN plans.6-