# designcomputer/mysql_mcp_server [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/designcomputer/mysql_mcp_server  
**GitHub Stars:** 1422  
**Views:** 16  
**Installs:** 0  
**Upvotes:** 1  
**Directory Page:** https://allmcps.com/mcp/designcomputer-mysql-mcp-server

## Description
MySQL database integration with configurable access controls, schema inspection, and comprehensive security guidelines

## Tools
Capabilities this server exposes over MCP:

- **execute_sql** — Executes any standard SQL query.
- **get_schema_info** — Provides detailed metadata about database structures.
- **get_table_sample** — Fetches a representative sample of data.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "mysql-mcp-server": {
    "command": "uvx",
    "args": ["mysql_mcp_server"],
    "env": {
      "MYSQL_HOST": "",
      "MYSQL_USER": "",
      "MYSQL_PASSWORD": ""
    }
  }
}
```

**Requires environment variables:** `MYSQL_HOST`, `MYSQL_USER`, `MYSQL_PASSWORD` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What designcomputer/mysql_mcp_server does

designcomputer/mysql_mcp_server gives MCP clients a controlled interface to MySQL databases. Agents can run SQL, inspect database structure, preview table contents, and enumerate available tables through MCP resources. The server is suitable for database exploration, analysis, and operations that require standard SQL, including SELECT, SHOW, DESCRIBE, INSERT, UPDATE, and DELETE statements.

Two guided MCP prompts provide higher-level workflows. `explore_database` discovers tables, examines their schemas, samples data, and produces a summary. `analyze_table` performs a similar focused workflow for one table and can accept a qualified `database.table` name.

## How it works

The server connects to MySQL using connection details supplied through environment variables. It can run over STDIO for local MCP host integrations or over Streamable HTTP/SSE for hosted and remote deployments. The optional SSH tunneling configuration lets the server reach a MySQL instance through a jump host.

Set `MYSQL_DATABASE` to work primarily within one database. If it is omitted, multi-database mode exposes user databases while filtering system databases. In that mode, queries and tool arguments can use fully qualified names such as `sales.orders`. Each SQL request must contain one statement; sequences such as `USE sales; SELECT ...` are not supported.

## Setup and configuration

Install the package from PyPI with `pip install mysql-mcp-server`, then launch the `mysql_mcp_server` entry point through an MCP client or a compatible runner such as `uvx`. Claude Desktop, Claude Code, and Visual Studio Code examples use STDIO configuration. A `.env` file can be loaded from the process working directory or its parent directories when the server is launched locally.

Provide `MYSQL_HOST`, `MYSQL_USER`, and `MYSQL_PASSWORD` for the database connection. `MYSQL_PORT` defaults to 3306, while `MYSQL_DATABASE` is optional. Additional settings control TLS mode, connection timeout, SQL mode, character encoding, authentication plugin, warning behavior, and the transport. For HTTP/SSE deployments, configure the listener host, port, and allowed Host headers. SSH tunneling requires the jump-host, key, remote-host, and local-port settings.

When Claude Desktop or Claude Code launches the process from its own working directory, place the `MYSQL_*` values in the client's MCP environment block rather than relying on a project-local `.env` file.

## Tools and capabilities

- `execute_sql` accepts a SQL string and returns the query result with error handling. Data-changing statements are marked with a destructive hint.
- `get_schema_info` reports column names, types, nullability, defaults, and comments for a selected table or the configured database context.
- `get_table_sample` returns a small data preview, with a maximum limit of 20 rows.
- Resource listing exposes available MySQL tables or user databases, depending on the configured mode.
- Qualified names support cross-database schema inspection and sampling. Table and database identifiers are restricted to alphanumeric characters, underscores, dollar signs, and an optional dot separator.
- The `explore_database` and `analyze_table` prompts coordinate schema inspection and sampling for repeatable investigation workflows.

## Limitations and notes

SQL execution supports only one statement per request. Sampling is intentionally limited to 20 rows, and identifier validation applies to schema and table tool arguments. HTTP/SSE deployments should configure an appropriate bind host and allowed Host headers. The server is intended to run through an MCP host or inspector rather than as a standalone Python script.

_Full upstream README: https://allmcps.com/mcp/designcomputer-mysql-mcp-server/readme_

