DEV.co
MCP Servers · designcomputer

mysql_mcp_server

MySQL MCP Server is a Python-based bridge that lets AI applications (like Claude) safely query MySQL databases through a structured protocol. It supports multiple deployment modes including local installation, Docker, and hosted options, with features like SSH tunneling and HTTP transport.

Source: GitHub — github.com/designcomputer/mysql_mcp_server
1.3k
GitHub stars
242
Forks
Python
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorydesigncomputer/mysql_mcp_server
Ownerdesigncomputer
Primary languagePython
LicenseMIT — OSI-approved
Stars1.3k
Forks242
Open issues1
Latest releasev0.4.2 (2026-06-20)
Last updated2026-06-20
Sourcehttps://github.com/designcomputer/mysql_mcp_server

What mysql_mcp_server is

A Model Context Protocol (MCP) server written in Python that exposes MySQL database interaction through three tools: execute_sql, get_schema_info, and get_table_sample. Supports both STDIO and SSE (Server-Sent Events) transport modes, multi-database operation, and SSH tunneling via environment variable configuration.

Quickstart

Get the mysql_mcp_server source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/designcomputer/mysql_mcp_server.gitcd mysql_mcp_server# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

AI-Assisted Database Exploration

Enable Claude or other AI agents to interactively explore database schemas, sample data, and run analytical queries without direct terminal access. Useful for non-technical stakeholders or rapid data discovery workflows.

Secure Database Access Layer for LLM Applications

Provide a controlled, credential-managed interface between language models and production MySQL databases. The server enforces single-statement execution and proper error handling, reducing risk of destructive operations.

Remote Database Administration & Debugging

Deploy the server (via Fronteir AI or self-hosted) to enable remote, SSH-tunneled access to MySQL instances without exposing direct database credentials to client machines.

Implementation considerations

  • Environment variables (MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) must be carefully managed; Claude Desktop users cannot rely on .env files in the project directory—credentials must be set in the MCP config.
  • SSH tunneling is optional but requires key-based authentication; ensure SSH_KEY_PATH is accessible to the process and permissions are correctly set (e.g., 0600).
  • For SSE/HTTP deployments, configure MCP_SSE_ALLOWED_HOSTS to restrict which hosts can connect; default is localhost and 127.0.0.1, but Docker/remote setups need explicit allowlisting.
  • Test single-statement execution limits early; refactor any multi-statement SQL workflows before deploying.
  • SSL mode (MYSQL_SSL_MODE) defaults to DISABLED; for production use, consider REQUIRED or VERIFY_CA and ensure certificate chain is available.

When to avoid it — and what to weigh

  • Multi-Statement Transaction Requirements — The server explicitly does not support multi-statement queries (e.g., `USE db; SELECT ...`). If your workflow requires atomic multi-step operations or transactions, you cannot use this server alone.
  • Complex Real-Time Streaming or Event-Driven Workflows — This is a request-response tool, not a real-time data streaming solution. If you need continuous database change notifications or event-driven triggers, look elsewhere.
  • Compliance Scenarios Requiring Formal Audit Trails — While the server logs connections, the README does not document comprehensive audit logging, compliance certifications (SOC 2, HIPAA, etc.), or formal data retention policies. Review security requirements before use in regulated industries.
  • Non-MySQL Relational Databases — The server is MySQL-specific. PostgreSQL, SQL Server, or Oracle users need alternative implementations.

License & commercial use

MIT License. This is a permissive OSI-approved license allowing commercial use, modification, and redistribution with no warranty and minimal restrictions (attribution required).

MIT License explicitly permits commercial use. However, review the license text and the project's use-case terms (if any) to confirm there are no downstream restrictions. The license itself imposes no liability or warranty guarantees; you assume risk of use. No commercial support level or SLA is documented.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

Environment variables store credentials; ensure they are never committed to version control or logged. The server does not validate SQL queries (single-statement enforcement is a boundary, not a firewall). SSL mode is configurable but defaults to DISABLED; enable for production. SSH tunneling support offloads credential exposure risk if configured correctly. No explicit mention of rate limiting, query timeouts (beyond MYSQL_CONNECT_TIMEOUT), or injection prevention mechanisms. Audit logging is mentioned but scope is unclear. AgentAudit 'safe' badge is present but criteria are not defined in the README.

Alternatives to consider

LangChain / LlamaIndex MySQL Integrations

Framework-native integrations that bind MySQL directly to LLM chains with less scaffolding, but lack the MCP protocol's standardized interface and may have tighter coupling to specific LLM vendors.

PostgreSQL MCP Server (similar architecture, Postgres-native)

Drop-in alternative if you use PostgreSQL; same MCP interface, likely similar feature set (SSH tunneling, SSE, prompts), but not interchangeable for MySQL workloads.

Custom REST API + Standard HTTP Client

Build your own lightweight HTTP wrapper around MySQL using Flask/FastAPI; more control and no MCP dependency, but requires more development and loses the MCP ecosystem benefits.

Software development agency

Build on mysql_mcp_server with DEV.co software developers

MySQL MCP Server bridges MySQL and large language models securely. Start with local installation via pip, or use Fronteir AI for managed hosting. Explore your database with Claude in minutes.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

mysql_mcp_server FAQ

Can I run multiple queries in one call (e.g., `USE db; SELECT ...`)?
No. The server explicitly does not support multi-statement queries. Each call to execute_sql must be a single SQL statement. For cross-database queries, use the `database.table` notation instead.
Where should I store my database credentials for Claude Desktop?
In the `env` block of your Claude Desktop MCP config (claude_desktop_config.json), not in a .env file in the project directory. Claude Desktop launches the server from its own working directory, so the project's .env will not be found.
What is the difference between STDIO and SSE transport?
STDIO is the default, using standard input/output for local or tightly-coupled deployments. SSE (Server-Sent Events) is HTTP-based, better suited for remote or self-hosted scenarios. Set MCP_TRANSPORT=sse and configure MCP_SSE_HOST and PORT for SSE mode.
Is this suitable for production use?
It has active maintenance, a reasonable feature set, and an AgentAudit 'safe' badge, but no formal security audit, SLA, or warranty (MIT License). Conduct your own security review, test thoroughly with production credentials in a non-production database first, and enable SSL mode (MYSQL_SSL_MODE=REQUIRED or VERIFY_CA).

Software developers & web developers for hire

DEV.co helps companies turn open-source tools like mysql_mcp_server into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your mcp servers stack.

Ready to Connect Your Database to AI?

MySQL MCP Server bridges MySQL and large language models securely. Start with local installation via pip, or use Fronteir AI for managed hosting. Explore your database with Claude in minutes.