mysql-legacy-mcp
This server lets AI agents inspect and query legacy MySQL 5.0–5.6 databases over stdio, with read-only operations by default and write tools available only when explicitly enabled.
Health check:
mysql_legacy_pingreturns the MySQL version.Read-only SELECT: run one parsed SELECT statement with result limits and read-only transaction support on MySQL 5.6.5+.
Schema inspection: list databases (
mysql_legacy_list_databases), list tables/views (mysql_legacy_list_tables), describe columns (mysql_legacy_describe_table), show CREATE TABLE DDL (mysql_legacy_show_create_table), and list indexes (mysql_legacy_list_indexes).Opt-in writes: INSERT, UPDATE, DELETE, and DDL tools are disabled by default; each requires its own
MYSQL_LEGACY_ALLOW_*flag.Safety guards: UPDATE and DELETE always require a WHERE clause; DDL is limited to table-level operations and rejects destructive database/object deletions.
Legacy compatibility: uses MySQL 5.1-compatible SQL and SHOW metadata queries, avoiding modern MySQL features unsupported by old servers.
Provides SELECT-only querying and SHOW-based schema inspection (list databases, tables, columns, indexes, and show create table) for legacy MySQL 5.0–5.6 deployments.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mysql-legacy-mcp show the columns of the orders table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MySQL Legacy MCP
MCP server for legacy MySQL 5.0–5.6 databases through stdio. The package is on npm as mysql-legacy-mcp and in the official MCP Registry as io.github.Rufflet/mysql-legacy-mcp.
It uses MySQL 5.1-compatible SQL and SHOW metadata queries. Live MCP tests cover MySQL 5.0.51a, 5.1.73, 5.5.62, and 5.6.51. It is deliberately small: read-only by default, with INSERT/UPDATE/DELETE/DDL as opt-in tools disabled unless explicitly enabled; no TLS configuration, and no custom authentication or charset options.
Is this for you?
You need an AI agent to inspect a MySQL 5.0, 5.1, 5.5, or 5.6 database.
Your current MySQL MCP server assumes MySQL 5.7+, JSON functions, or newer
information_schemafields.You need schema inspection and SELECT queries, with write operations off by default and opt-in per statement type.
If you are seeing ER_NOT_SUPPORTED_AUTH_MODE, HANDSHAKE_INSECURE_AUTH, Old password authentication is not supported, legacy TLS errors, or garbled cp1251 / latin1 text, read Troubleshooting first. Those symptoms are not all solved by this package.
Related MCP server: MCP Server for MySQL
Requirements
Node.js 18.14.1 or later
npm
A dedicated MySQL account with only the required read and metadata privileges
Where it is listed
Installation is always local stdio via npm (npx -y mysql-legacy-mcp). Directory pages do not make that faster; they are discovery indexes. The official MCP Registry is the machine-readable source (io.github.Rufflet/mysql-legacy-mcp) that aggregators ingest, including env-var metadata from server.json. Clients that speak that registry can pre-fill configuration from it.
Maintainer submission status for other directories is in docs/RELEASE_CHECKLIST.md.
Quick install
Claude Code
claude mcp add --transport stdio mysql-legacy \
--env MYSQL_LEGACY_HOST=127.0.0.1 \
--env MYSQL_LEGACY_USER=legacy_reader \
--env MYSQL_LEGACY_PASSWORD=replace-with-a-secret \
--env MYSQL_LEGACY_DATABASE=legacy_app \
-- npx -y mysql-legacy-mcpCodex
codex mcp add mysql-legacy \
--env MYSQL_LEGACY_HOST=127.0.0.1 \
--env MYSQL_LEGACY_USER=legacy_reader \
--env MYSQL_LEGACY_PASSWORD=replace-with-a-secret \
--env MYSQL_LEGACY_DATABASE=legacy_app \
-- npx -y mysql-legacy-mcpCursor and other clients
{
"mcpServers": {
"mysql-legacy": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mysql-legacy-mcp"],
"env": {
"MYSQL_LEGACY_HOST": "127.0.0.1",
"MYSQL_LEGACY_USER": "legacy_reader",
"MYSQL_LEGACY_PASSWORD": "replace-with-a-secret",
"MYSQL_LEGACY_DATABASE": "legacy_app"
}
}
}
}Use the schema required by your client. Full copy-paste instructions for Claude Desktop, Codex, VS Code, Windsurf, Gemini, Trae, Qoder, and more are in the Installation guide.
Compatibility
MySQL | Status |
5.0 | Verified: 5.0.51a |
5.1 | Verified: 5.1.73 |
5.5 | Verified: 5.5.62 |
5.6 | Verified: 5.6.51 |
5.7 | Verified reference only: 5.7.44 |
8.0 | Not a target; default |
Each tested target passed all 11 tools — the 7 read-only tools plus the 4 opt-in write tools, with MYSQL_LEGACY_ALLOW_* flags checked both left at their default false and explicitly enabled — through a real MCP stdio session. On MySQL 5.6.5 and later, this also exercised the actual START TRANSACTION READ ONLY path used by mysql_legacy_select; below that version it exercised the silent plain-query fallback. Exact sources, test conditions, and the MySQL 8.0 boundary are recorded in the compatibility audit. This does not cover pre-4.1 old_password, custom connection charsets, TLS, or your server's exact patch level.
Compared with modern MySQL MCP servers
Server | Stated MySQL baseline | Focus |
| Verified live: 5.0–5.6 | Legacy schema inspection and SELECT by default; opt-in INSERT/UPDATE/DELETE/DDL, with UPDATE/DELETE always requiring a WHERE clause |
5.7+; 8.0+ recommended | Modern MySQL features such as TLS, SSH tunnels, and optional writes |
This is a compatibility distinction, not a benchmark: choose the modern server for its modern-database features.
Features
Read-only
SELECTtool with parser checks and result-size limits, wrapped in a read-only transaction on MySQL 5.6.5+SHOW-based database, table, column, CREATE TABLE, and index inspectionOpt-in INSERT/UPDATE/DELETE/DDL tools, each disabled by default and gated by its own
MYSQL_LEGACY_ALLOW_*flag; UPDATE and DELETE always require a WHERE clauseA small pooled set of MySQL connections (
MYSQL_LEGACY_POOL_SIZE); no reliance on CTEs, JSON functions, or modern metadata columns
Tools
Tool | Purpose |
| Return |
| Run one parsed SELECT statement |
| Run one INSERT statement (opt-in, |
| Run one UPDATE statement with a required WHERE clause (opt-in, |
| Run one DELETE statement with a required WHERE clause (opt-in, |
| Run one table-level CREATE/ALTER/DROP/TRUNCATE/RENAME statement (opt-in, |
| List databases |
| List tables and views |
| Show columns |
| Show table DDL |
| Show indexes |
Documentation
Installation guide — client-specific setup
Configuration — environment variables, privileges, and security limits
Troubleshooting — authentication, TLS, encoding, and startup errors
Compatibility audit — reproducible version evidence
Roadmap — deliberately deferred work and why
Why this exists
This project came from a QA/fullstack workflow that needed AI-assisted inspection of a production MySQL 5.1 database. It is a focused utility for exploring legacy schemas and preparing migrations.
Contributing
See CONTRIBUTING.md for how to propose changes, run checks locally, and what evidence a compatibility claim needs. Quick start:
npm ci
npm run check
npm run smoke:staticFor authorized database testing, see the smoke-test instructions in the compatibility audit.
License
MIT.
Available Tools
11 toolsmysql_legacy_ddlADestructive
Runs exactly one table-level CREATE, ALTER, DROP, TRUNCATE, or RENAME supplied in sql. Off unless MYSQL_LEGACY_ALLOW_DDL=true. DROP and TRUNCATE are irreversible. Rejects DROP DATABASE, views, and indexes. For row changes use mysql_legacy_insert, mysql_legacy_update, or mysql_legacy_delete.
Inputs: sql (required).
mysql_legacy_deleteADestructive
Runs exactly one DELETE supplied in sql. WHERE is required and cannot be disabled. Off unless MYSQL_LEGACY_ALLOW_DELETE=true. Returns affectedRows. To empty a table use TRUNCATE via mysql_legacy_ddl, not a WHERE-less DELETE.
Inputs: sql (required).
mysql_legacy_describe_tableARead-onlyIdempotent
Lists columns for database.table via SHOW FULL COLUMNS, including type, nullability, keys, comments, and collation. Use this for per-column metadata. For the full CREATE TABLE text and default charset use mysql_legacy_show_create_table. For index column order use mysql_legacy_list_indexes.
Inputs: table (required), database (required).
mysql_legacy_insertADestructive
Runs exactly one INSERT supplied in sql. Off unless MYSQL_LEGACY_ALLOW_INSERT=true. Returns insertId and affectedRows. INSERT ... ON DUPLICATE KEY UPDATE is accepted and can overwrite existing rows. For UPDATE/DELETE/DDL use mysql_legacy_update, mysql_legacy_delete, or mysql_legacy_ddl.
Inputs: sql (required).
mysql_legacy_list_databasesARead-onlyIdempotent
Lists database names via SHOW DATABASES. Hides mysql and information_schema unless include_system_databases=true (or MYSQL_LEGACY_HIDE_SYSTEM_DATABASES=false). Then pass a name to mysql_legacy_list_tables. Does not list tables or columns.
Inputs: include_system_databases.
mysql_legacy_list_indexesARead-onlyIdempotent
Lists indexes for database.table via SHOW INDEX (key name, columns, uniqueness, type). Use this for keys. For column types use mysql_legacy_describe_table; for full DDL use mysql_legacy_show_create_table.
Inputs: table (required), database (required).
mysql_legacy_list_tablesARead-onlyIdempotent
Lists base tables and views in one database via SHOW FULL TABLES FROM database. Pass database. For column types use mysql_legacy_describe_table; for CREATE TABLE text use mysql_legacy_show_create_table; for keys use mysql_legacy_list_indexes. To list databases first, use mysql_legacy_list_databases.
Inputs: database (required).
mysql_legacy_pingARead-onlyIdempotent
Checks the MySQL connection with SELECT VERSION() AS version and returns {connected, version}. Call this first after connecting. For schema use mysql_legacy_list_tables; for row data use mysql_legacy_select.
Inputs: no named parameters.
mysql_legacy_selectARead-onlyIdempotent
Runs exactly one SELECT supplied in sql. Rejects SELECT INTO and locking reads; truncates by MYSQL_LEGACY_MAX_ROWS and MYSQL_LEGACY_MAX_RESULT_BYTES. On MySQL 5.6.5+ wraps in START TRANSACTION READ ONLY unless MYSQL_LEGACY_DISABLE_READ_ONLY_TRANSACTIONS=true. For columns use mysql_legacy_describe_table; for CREATE TABLE text use mysql_legacy_show_create_table; for writes use mysql_legacy_insert, mysql_legacy_update, or mysql_legacy_delete.
Inputs: sql (required).
mysql_legacy_show_create_tableARead-onlyIdempotent
Returns SHOW CREATE TABLE for database.table plus the parsed default charset. Use this for DDL text. For per-column types and collation use mysql_legacy_describe_table. For unique/non-unique keys use mysql_legacy_list_indexes.
Inputs: table (required), database (required).
mysql_legacy_updateADestructive
Runs exactly one UPDATE supplied in sql. WHERE is required and cannot be disabled. Off unless MYSQL_LEGACY_ALLOW_UPDATE=true. Returns affectedRows and changedRows. To empty a table use TRUNCATE via mysql_legacy_ddl, not a WHERE-less UPDATE.
Inputs: sql (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct operation: query, write, schema change, database/table listing, schema introspection, and connection check. The descriptions explicitly cross-reference each other to prevent confusion between similar metadata tools like describe_table and show_create_table.
All tools share the mysql_legacy_ prefix and use snake_case, with most following a verb_noun pattern like list_tables and describe_table. The mysql_legacy_ddl tool is a minor deviation since it uses a noun/acronym rather than a clear verb.
Eleven tools is well-scoped for a MySQL database server covering connection, querying, writing, schema changes, and metadata inspection. Each tool has a clear role and none feel redundant or excessive.
The tool surface covers the core CRUD lifecycle, DDL operations, database/table discovery, column introspection, index listing, and connection verification. Minor gaps exist such as lack of transaction control, index creation/dropping, and view management, but these appear to be intentional safety restrictions.
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Read-only ArcadeOps discovery for developer docs, OAuth, OpenAPI and synthetic sandbox.
Read-only cited financial datasets, bounded research queries and source diagnostics.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Related MCP Servers
- AlicenseAqualityBmaintenanceAllows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.319,243 PyPI1,409MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides read-only access to MySQL databases, enabling LLMs to inspect database schemas and execute read-only queries.21,010 npm2,212MIT
- FlicenseNot gradedqualityDmaintenanceEnables safe interaction with MySQL databases through SELECT queries, table structure inspection, and database schema exploration. Provides read-only access to query data and examine database metadata.1-
- AlicenseNot gradedqualityCmaintenanceConnect AI agents to SQL databases (SQLite, PostgreSQL, MySQL) with a unified interface for querying data, exploring schemas, inserting rows, and exporting results to CSV. Includes safety features like dangerous query blocking and write guards.5 npm32 PyPIMIT