Registry / database / dynamic-mysql-mcp

dynamic-mysql-mcp

JSON →
library2.0.1jsnpmunverified

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.

databaseai-ml
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM-only package; no CommonJS support. Use 'import' syntax.

import Server from 'dynamic-mysql-mcp'

Main class export name is MCPMySQLServer, not Server. Check docs for exact named export.

import { MCPMySQLServer } from 'dynamic-mysql-mcp'

Type export for Tool type, only available in TypeScript.

import { MySQLTool } from 'dynamic-mysql-mcp'

String constant for the package version.

import { version } from 'dynamic-mysql-mcp'

Creates and starts the MCP server programmatically, which then listens for MCP client connections.

import { MCPMySQLServer } from 'dynamic-mysql-mcp'; const server = new MCPMySQLServer(); await server.start(); // Then connect via MCP client // Example: npx dynamic-mysql-mcp
Debug
Known footguns
gotchaThe MCP server does not accept credentials at startup; auth must be called via the auth_mysql tool, or tools will fail with 'No authenticated connection'.
breakingIn version 2.0.0, the package switched to ESM-only and dropped CommonJS support. require() will throw a runtime error.
deprecatedThe execute_sql tool allows raw SQL execution and bypasses ORM-style safety checks.
gotchaThe server does not support SSL/TLS by default; connections are unencrypted unless you pass ssl options to auth_mysql.
gotchaThe logout tool disconnects the current auth session, requiring re-authentication to use tools again.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
11 hits · last 30 days
gptbot
3
amazonbot
3
bingbot
1
ahrefsbot
1
Resources