🚀 Socket Launch Week 🚀 Day 4: Introducing Historical Analytics.Learn More
Socket
Sign inDemoInstall
Socket

mcp-mysql-connector

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mcp-mysql-connector

Model Context Protocol plugin for MySQL

1.0.10
latest
npm
Version published
Weekly downloads
11
-63.33%
Maintainers
0
Weekly downloads
 
Created
Source

MCP MySQL Connector

A Model Context Protocol (MCP) plugin for connecting to MySQL databases from Cursor IDE.

Installation

You can use the plugin directly with npx without installing it:

npx -y mcp-mysql-connector mysql://user:password@host:port/database

Option 2: Install globally

npm install -g mcp-mysql-connector
mcp-mysql-connector mysql://user:password@host:port/database

Option 3: Clone the repository

# Clone the repository
git clone https://github.com/yourusername/mcp-mysql-connector.git
cd mcp-mysql-connector

# Install dependencies
npm install

# Run the plugin
node index.js mysql://user:password@host:port/database

Setup with Cursor IDE

For easier setup with Cursor IDE, you can use the setup script:

npx -y mcp-mysql-connector-setup

This will guide you through the process of setting up the MCP MySQL Connector with Cursor IDE.

Connection String Format

The connection string should be in the following format:

mysql://user:password@host:port/database

Example:

mysql://root:password@localhost:3306/mydatabase

You can also add SSL support by appending ?ssl=true to the connection string:

mysql://user:password@host:port/database?ssl=true

How It Works

This plugin creates a simple HTTP server that implements the Model Context Protocol. It connects to your MySQL database and allows Cursor IDE to run SQL queries against it.

The server listens on port 3000 by default and accepts POST requests with SQL queries. The results are returned as JSON.

Important Note: The MySQL connection uses the port specified in the connection string (default: 3306), while the MCP server runs on port 3000. Make sure Cursor is configured to use port 3000 for the MCP connection.

Using with Cursor IDE

Once the MCP server is running, you can use it with Cursor IDE to run SQL queries against your MySQL database.

  • Open Cursor
  • Go to MCP Servers
  • Click "Add new MCP server"
  • Enter a name (e.g., "MySQL")
  • Enter the command: npx -y mcp-mysql-connector mysql://user:password@host:port/database

Publishing to npm

If you want to publish this package to npm, follow these steps:

  • Create an npm account if you don't have one: https://www.npmjs.com/signup
  • Login to npm from the command line:
    npm login
    
  • Publish the package:
    npm publish
    

License

MIT

Keywords

mcp

FAQs

Package last updated on 05 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts