MySQL MCP Server SSE

v1.0.0Databasesstable

MySQL query server based on the MCP sse.Multi-level SQL risk control & injection protection Docker support for quick deployment

aidockerfilemcpmysql
Share:
102
Stars
0
Downloads
0
Weekly
0/5

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

MySQL query execution
SQL injection protection
Docker deployment support
mangooer

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 18, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mysql-mcp-server-sse

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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:latest
2

Or 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.server
3

Configure 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,MEDIUM
4

Configure 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_card
5

Add 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.

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.

Quick Config Preview

{ "mcpServers": { "mysql-mcp-server-sse": { "command": "npx", "args": ["-y", "mysql-mcp-server-sse"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides