Labsco
MCP SERVER

MySQL MCP Server

by dave-wind

Read-only MySQL access for a model: table schemas exposed as resources, and SELECTs run inside a READ ONLY transaction.

Relational SQL Databases
Summary
Schema exposed automatically, writes impossible by construction.

The automatic schema discovery is what makes the single `query` tool workable — the model can see column names and types before writing SQL rather than guessing. And read-only is enforced twice, in validation and in the transaction, so the guarantee does not depend on the model behaving. Small surface, clear promise.

What it is

A deliberately narrow MySQL server. It gives a model two things — the schema of every table, and one tool for running SELECT statements — and enforces read-only at two levels: the SQL is validated to allow only SELECT, and every query runs inside a READ ONLY transaction. There is no path to INSERT, UPDATE, DELETE, CREATE, ALTER or DROP.

What you get
  • A SQL query executed against the connected database, inside a READ ONLY transaction — `query`
  • JSON schema information for each table, discovered automatically from database metadata, with column names and data types, exposed as resources rather than requiring a call
  • A hard boundary: SQL validation permits SELECT only, and no data-modification or schema-modification statement can pass
  • Communication over JSON-RPC on stdio, which is what a local client expects
Requirements

Node v18 or newer. The connection string is a command-line argument: `npx -y @davewind/mysql-mcp-server mysql://user:password@localhost:port/database`, so the credential lives in your client's config file — give it a database user with read permission only, and the enforcement is then belt and braces. It can also be installed globally with `npm install @davewind/mysql-mcp-server -g`.

Setup effort

One command plus a key — npm install @davewind/mysql-mcp-server -g, then supply credentials