MySQL MCP Server

MCP server that provides direct access to MySQL databases

Local serverstdio

What is the MySQL MCP server?

MCP server that provides direct access to MySQL databases. The mysql mcp server wraps that behind the Model Context Protocol, so an assistant can use it through 9 defined tools rather than through you.

What it actually does

A powerful MCP server that provides direct access to MySQL databases. This server enables AI agents to interact with MySQL databases, execute SQL queries, and manage database content through a simple interface.

Adding it to your client

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

Its toolset

Everything the assistant can do here goes through one of these:

  • create_note — Create new text notes in the database
  • list_tables — List all tables in the connected database
  • count_tables — Get the total number of tables in the database
  • search_tables — Search for tables using LIKE pattern
  • describe_table — Get the structure of a specific table
  • execute_sql — Execute custom SQL queries
  • Resources — The Resources tool exposed by this server
  • Tools — The Tools tool exposed by this server
  • Debugging — Use the MCP Inspector to debug the server: bash npm run inspector

Configuration

You will need 4 environment variables: MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Node.js 18 or higher - MySQL server installed and running - A database with appropriate permissions

Caveats

  • 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.
  • With 9 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch MySQL.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mysql mcp server does with a few real requests.

When to reach for it

This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. MySQL's toolset — create_note, list_tables, count_tables and 6 more — is a fair guide to whether it matches your workflow. It is maintained by LeonMelamud; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
create_noteCreate new text notes in the database
list_tablesList all tables in the connected database
count_tablesGet the total number of tables in the database
search_tablesSearch for tables using LIKE pattern
describe_tableGet the structure of a specific table
execute_sqlExecute custom SQL queries
ResourcesThe Resources tool exposed by this server.
ToolsThe Tools tool exposed by this server.
DebuggingUse the MCP Inspector to debug the server: bash npm run inspector

Configuration

  • Node.js 18 or higher - MySQL server installed and running - A database with appropriate permissions
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_DATABASEConfiguration value read at startup.Optional

Example prompts to try

  • Use MySQL to create note.
  • Use MySQL to list tables.
  • Use MySQL to count tables.

Frequently asked questions

You need Node.js 18 or higher, a running MySQL server, and a database with appropriate permissions.