MySQL MCP Server

MCP Server for MySQL

Local serverstdio

What is the MySQL MCP server?

If you already use MySQL, the mysql mcp server is the piece that lets your assistant work with it directly. MCP Server for MySQL.

What the server does

The server exposes several tools via MCP for database interaction. All tools are designed for read-only operations.

This project provides a read-only Model Context Protocol (MCP) server for interacting with MySQL & PostgreSQL databases. It allows clients compatible with MCP to inspect database schemas, retrieve metadata, and execute read-only SQL queries through a set of defined tools. The server is built with extensibility in mind and enforces read-only operations for safety.

Installation

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

Credentials and setup notes

Configuration is passed through the environment: MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_PORT, PG_HOST, PG_USER, PG_PASSWORD, PG_PORT. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Where it fits

Among the database access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. It is maintained by kaulvimal; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Configuration

VariableDescriptionRequired
MYSQL_HOSTEndpoint or connection string the server talks to.Optional
MYSQL_USERConfiguration value read at startup.Optional
MYSQL_PASSWORDConfiguration value read at startup.Optional
MYSQL_PORTConfiguration value read at startup.Optional
PG_HOSTEndpoint or connection string the server talks to.Optional
PG_USERConfiguration value read at startup.Optional
PG_PASSWORDConfiguration value read at startup.Optional
PG_PORTConfiguration value read at startup.Optional

Frequently asked questions

Yes, all operations are read-only to prevent data modification.