MySQL MCP Server SSE
MySQL query server based on the MCP sse.Multi-level SQL risk control & injection protection Docker support for quick deployment
What is MySQL MCP Server SSE?
MySQL MCP Server SSE is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mysql query server based on the mcp sse.multi-level sql risk control & injection protection docker support for quick deployment
MySQL query server based on the MCP sse.Multi-level SQL risk control & injection protection Docker support for quick deployment
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MySQL query server based on the MCP sse.Multi-level SQL risk
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mysql-mcp-server-sseConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MySQL MCP Server SSE
MySQL MCP Server SSE is a Python-based MCP server that exposes MySQL database query capabilities to AI assistants via Server-Sent Events (SSE) transport, with multi-level SQL risk control and injection protection built in. It classifies SQL operations by risk level (LOW through CRITICAL), enforces mandatory WHERE clauses on destructive operations, automatically masks sensitive fields, and supports database isolation to prevent cross-database access — making it safe to give AI agents read and write access to production-grade MySQL databases. Docker support enables rapid deployment with a single run command.
Prerequisites
- Python 3.8+ and pip (for manual install) or Docker (for containerised deployment)
- A running MySQL server (local or remote) with credentials
- An MCP-compatible client that supports SSE transport such as Claude Desktop or a custom MCP client
- Network access from the server host to the MySQL instance
Deploy with Docker (recommended)
Pull and run the pre-built Docker image, passing your MySQL connection details as environment variables. The server listens on port 3000.
docker run -d --name mysql-mcp-server-sse \
-e MYSQL_HOST=your_mysql_host \
-e MYSQL_PORT=3306 \
-e MYSQL_USER=your_user \
-e MYSQL_PASSWORD=your_password \
-e MYSQL_DATABASE=your_database \
-p 3000:3000 \
mangooer/mysql-mcp-server-sse:latestOr install manually with pip
Clone the repository and install Python dependencies, then run the server directly.
git clone https://github.com/mangooer/mysql-mcp-server-sse.git
cd mysql-mcp-server-sse
pip install -r requirements.txt
MYSQL_HOST=localhost MYSQL_USER=root MYSQL_PASSWORD=secret MYSQL_DATABASE=mydb python -m src.serverConfigure security and risk levels
Set ALLOWED_RISK_LEVELS to control which SQL operation classes agents can execute. In production, set ENV_TYPE=production to auto-enable strict database isolation.
export ENV_TYPE=production
export ENABLE_DATABASE_ISOLATION=true
export DATABASE_ACCESS_LEVEL=strict
export ALLOWED_RISK_LEVELS=LOW,MEDIUMConfigure sensitive field masking
Set SENSITIVE_INFO_FIELDS to a comma-separated list of column name patterns that should be automatically masked in query results.
export SENSITIVE_INFO_FIELDS=password,secret,token,ssn,credit_cardAdd to your MCP client config
Since this server uses SSE transport, point your MCP client at the running server's SSE endpoint instead of using a command launch.
{
"mcpServers": {
"mysql-mcp-sse": {
"url": "http://localhost:3000/sse"
}
}
}MySQL MCP Server SSE Examples
Client configuration
MCP client config connecting to the MySQL SSE server running on localhost port 3000.
{
"mcpServers": {
"mysql-mcp-sse": {
"url": "http://localhost:3000/sse"
}
}
}Prompts to try
Example prompts that let an AI assistant query and inspect a MySQL database through the server.
- "Show me the schema for the 'orders' table in the current database."
- "How many records are in the 'users' table and when was the most recent signup?"
- "List all tables in the database and their row counts."
- "Find orders placed in the last 7 days with a total above $500."
- "What indexes exist on the 'products' table and are any columns missing indexes?"Troubleshooting MySQL MCP Server SSE
Docker container exits immediately after start
Run without the -d flag to see error output: `docker run --rm -e MYSQL_HOST=... mangooer/mysql-mcp-server-sse:latest`. The most common cause is a missing or incorrect MYSQL_* environment variable.
SQL query rejected with 'risk level not allowed'
Check ALLOWED_RISK_LEVELS and add the required tier (e.g. MEDIUM or HIGH). ALTER TABLE and DROP operations are classified as HIGH or CRITICAL risk and are blocked by default in production mode.
MCP client cannot reach the SSE endpoint
Verify the server is running with `curl http://localhost:3000/sse`. If using Docker, ensure port 3000 is published (-p 3000:3000) and no firewall is blocking the connection.
Frequently Asked Questions about MySQL MCP Server SSE
What is MySQL MCP Server SSE?
MySQL MCP Server SSE is a Model Context Protocol (MCP) server that mysql query server based on the mcp sse.multi-level sql risk control & injection protection docker support for quick deployment It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MySQL MCP Server SSE?
Follow the installation instructions on the MySQL MCP Server SSE GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MySQL MCP Server SSE?
MySQL MCP Server SSE works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MySQL MCP Server SSE free to use?
Yes, MySQL MCP Server SSE is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MySQL MCP Server SSE Alternatives — Similar Databases Servers
Looking for alternatives to MySQL MCP Server SSE? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
Browse More Databases MCP Servers
Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MySQL MCP Server SSE in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MySQL MCP Server SSE?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.