Labsco
MCP SERVER

MySQL MCP Server

by dkabx

Three MySQL tools — run a query, describe a table, list the tables — wired straight into your editor.

Relational SQL Databases
Summary
The database user is your only access control.

`mysql_query` executes what it is given, so the boundary is entirely the credentials you put in the config — grant SELECT only and this is a safe question-answering tool, grant more and it is a shell into your data. The pairing with schema discovery is what makes it work in practice: the model reads the table structure first, so the SQL it writes matches your columns rather than its assumptions.

What it is

A minimal MySQL bridge for assistants. It gives the model the three things it needs to answer a database question on its own: what tables exist, what shape one of them is, and the result of a query. Connection details come from environment variables in your client config.

What you get
  • `mysql_list_tables` lists every table in the configured database
  • `mysql_describe_table` returns the schema for a named table
  • `mysql_query` executes any SQL statement you pass it
  • Error handling that reports database failures back rather than dropping the call
Requirements

Node.js v14 or higher and a reachable MySQL instance. Clone, `npm install`, and point your client at the server file with `MYSQL_HOST`, `MYSQL_USER`, `MYSQL_PASSWORD`, `MYSQL_DATABASE` and `MYSQL_PORT` in the env block — the port defaults to 3306. Queries run with the permissions of the user in that config, and `mysql_query` accepts any SQL, so a read-only account is the difference between a lookup tool and a write handle.

Setup effort

One command plus a key — npx -y mysql-mcp-server, then supply credentials