A Model Context Protocol (MCP) server for MySQL that enables AI assistants to query and mutate MySQL data at runtime. Version 2.0.1 requires Node >=18 and ships TypeScript types. Unlike static MySQL MCP servers that require credentials at startup, this server accepts authentication at runtime via the auth_mysql tool, allowing dynamic switching between databases and environments without restart. It provides 13 tools including row operations (select_rows, insert_row, update_rows, delete_rows), schema discovery, and custom SQL execution with parameterized queries.
npm install dynamic-mysql-mcpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates and starts the MCP server programmatically, which then listens for MCP client connections.
Call auth_mysql tool with host/user/password before using other tools.
Use import syntax and ensure your project is configured for ESM (e.g., type: 'module' in package.json).
Use parameterized queries with the 'params' option to prevent SQL injection; avoid executing DDL or DROP statements.
Pass an ssl object with necessary CA/cert keys to auth_mysql for encrypted connections.
Only call logout when you intend to end the session; otherwise, the session persists until logout or server restart.
Switch to ESM: add 'type': 'module' in package.json, or rename file to .mjs and use import syntax.
Call auth_mysql with valid credentials before using any data access tools.
Enable 'mysql_native_password' on the MySQL user, or upgrade the mysql2 library to latest version.
Verify the hostname and ensure the MySQL server is running and accessible from the MCP server host.
No dependency data recorded yet.