Registry / database / mcp-mysql-connector

mcp-mysql-connector

JSON →
library1.0.10jsnpmunverified

A Model Context Protocol (MCP) plugin v1.0.10 for connecting to MySQL databases from Cursor IDE. Active development on npm. It creates an HTTP server that implements MCP, accepting SQL queries via POST and returning JSON results. Key differentiator: easy setup via npx or a guided setup script, supports SSL through connection string. Currently limited to Cursor IDE integration. Release cadence is not publicly documented.

npm install mcp-mysql-connector
INSTALL
IMPORT
SIG · MCP-MYSQL-CONNECTO
M
mcp-mysql-connector
databasejavascriptv1.0.10
harness data pending
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.

default (running via npx)
npx -y mcp-mysql-connector mysql://user:password@host:port/database
npx mcp-mysql-connector mysql://user:password@host:port/database
Use -y to avoid prompt; the tool is executed directly, not imported as a library.
setup script
npx -y mcp-mysql-connector-setup
This runs an interactive setup for Cursor IDE. There is no import; it's a CLI tool.
global installation
npm install -g mcp-mysql-connector && mcp-mysql-connector mysql://user:password@host:port/database
Installs globally and then runs the command.

Run the MCP MySQL Connector via npx, connecting to a local MySQL database.

npx -y mcp-mysql-connector mysql://root:password@localhost:3306/mydatabase
Debug
Known issues
gotchaThe MySQL connection uses the port in the connection string (default 3306), but the MCP server runs on port 3000. Ensure Cursor IDE is configured to use port 3000.
fix
Check Cursor IDE MCP server configuration: set port to 3000.
affects: <=1.0.10
gotchaThe connection string must include credentials in the URL; if password contains special characters, URL-encode them.
fix
Use percent-encoding for special characters (e.g., %40 for @).
affects: <=1.0.10
gotcha-y flag is recommended with npx to avoid interactive prompt; without it, npx may hang waiting for confirmation.
fix
Always use npx -y.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'mcp-mysql-connector'
Running without -y flag or without global install.
fix
Use npx -y mcp-mysql-connector mysql://...
Error: getaddrinfo ENOTFOUND host
Invalid hostname in connection string.
fix
Ensure the host is correct and reachable (e.g., localhost).
Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'user'@'host'
Incorrect username or password.
fix
Verify credentials in the connection string.
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
mcp-mysql-connector — npm install mcp-mysql-connector · libregistry