Simple MCP MySQL Server
Provides tools for listing tables, retrieving schema, and executing read-only SQL queries against a MySQL database.
Click on "Install 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., "@Simple MCP MySQL ServerShow me all tables in the database"
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.
Simple MCP MySQL Server
A lightweight Model Context Protocol (MCP) server that enables secure interaction with MySQL databases. This server allows AI assistants like Claude to list tables, read data, and execute SQL queries through a controlled interface.
Features
List all MySQL tables in the database
Retrieve detailed schema information for all tables
Execute read-only SQL queries with proper error handling
Secure database access through environment variables
Simple configuration and deployment
Related MCP server: MySQL MCP Server
Installation
# Clone the repository
git clone git@github.com:alexcc4/mcp-mysql-server.git
cd mysql-mcp-server
# Install dependencies using uv (recommended)
uv sync
Configuration
Set the following environment variables:
export DB_HOST=localhost # Database host
export DB_PORT=3306 # Database port (defaults to 3306 if not specified)
export DB_USER=your_username # Database username
export DB_PASSWORD=your_password # Database password
export DB_NAME=your_database # Database name
Usage
Manual Start
uv run main.pyWith Claude Desktop
Add this to your Claude Desktop configuration file:
Mac Claude Desktop config: ~/Library/Application Support/Claude/claude_desktop_config.json (create it if it doesn't exist)
{
"mcpServers": {
"sql": {
"command": "/path/uv",
"args": [
"--directory",
"code_path",
"run",
"main.py"
],
"env": {
"DB_HOST": "127.0.0.1",
"DB_PORT": "3306",
"DB_USER": "your_user",
"DB_PASSWORD": "your_password",
"DB_NAME": "your_database"
}
}
}
}Example Queries
Once configured, you can ask Claude questions like:
"Show me all tables in the database"
"Top 10 rows from users table"
"Find all orders placed in the last 30 days"
"Count of users by country"
"Show me the schema of the products table"Available Resources
The server provides the following resources:
mysql://schema- Complete database structure information including all tables and columnsmysql://tables- List of all tables in the database
Available Tools
The server provides the following tools:
query_data- Execute read-only SQL queries and return results
Requirements
uv (recommended)
Python 3.12.2+
MySQL server
Security Considerations
Use a database user with minimal required permissions (read-only)
Never use root credentials for production environments
Consider implementing query whitelisting for sensitive databases
Monitor and log all database operations
License
MIT
Reference
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceEnables secure interaction with MySQL databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.Last updated
- Alicense-qualityDmaintenanceProvides read-only access to MySQL databases with automatic schema discovery and secure query execution. Enables users to explore database structure and execute SELECT queries through natural language interactions.Last updatedMIT
- AlicenseAqualityDmaintenanceEnables AI assistants to safely query MySQL databases with read-only access, featuring SQL injection protection, connection pooling, and automatic query limits for secure database exploration.Last updated450MIT
- Alicense-qualityDmaintenanceProvides AI assistants with secure read-only access to MySQL databases through validated SELECT queries. Supports SSL/TLS connections and implements multiple security layers to prevent data modification.Last updated5953MIT
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Read-only bank access for your AI agent. Connects Claude, ChatGPT, Cursor, Gemini, Codex.
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/alexcc4/mcp-mysql-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server